Is there a standard way to provide build time properties to an application?
The general idea is to create a properties file and package it in the jar or war on the classpath, so it can be read at runtime. Thanks, Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640
dependencyManagement and dependence of a separate project on a core module
We have a separate project that wants to use a module with jar packaging, the core, from another project. That core module's dependencies take their artifact versions from dependencyManagement in its parent pom (which we understand is a good practice). When the core is installed to the local maven repository the core pom is packaged with it, but not the parent pom. So now it seems the versions of the core dependencies can't be determined. We would like to know how this should be done. Would it be to create the same dependencies (runtime) in the new project pom? Or would it be to add dependencyManagement to that pom? Either way seems un-maven-like, as that project seems to have to define the transitive dependency verisions of one of its artifacts. Maybe there is another way? During install, could the effective core pom be packaged instead of the literal pom? Put another way: What is the right way to depend on only one module of a multiple module project that uses dependencyManagement? Thanks, Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640
maven-default-skin artifact is failing our builds
[INFO] artifact org.apache.maven.skins:maven-default-skin: checking for updates from central [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '7f1b64b38fb9268def21e3808c0d44 8146d7bf37'; remote = 'fa58f552f7b0d2d697f7b006e4b007996bcbaae1' - RETRYING [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '7f1b64b38fb9268def21e3808c0d44 8146d7bf37'; remote = 'fa58f552f7b0d2d697f7b006e4b007996bcbaae1' - IGNORING [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] The skin does not exist: Unable to determine the release version This just started happening in multiple environments for our project. Maven 2.0.9 is in use. Any idea what's happening? We are using Artifactory as the company repo server. Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640
RE: maven-default-skin artifact is failing our builds
More information: This happens only with the site goal. Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640 -Original Message- From: Brewster, Richard [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 07, 2008 12:50 PM To: Maven Users List Subject: maven-default-skin artifact is failing our builds [INFO] artifact org.apache.maven.skins:maven-default-skin: checking for updates from central [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '7f1b64b38fb9268def21e3808c0d44 8146d7bf37'; remote = 'fa58f552f7b0d2d697f7b006e4b007996bcbaae1' - RETRYING [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '7f1b64b38fb9268def21e3808c0d44 8146d7bf37'; remote = 'fa58f552f7b0d2d697f7b006e4b007996bcbaae1' - IGNORING [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] The skin does not exist: Unable to determine the release version This just started happening in multiple environments for our project. Maven 2.0.9 is in use. Any idea what's happening? We are using Artifactory as the company repo server. Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: maven.repo.local, again
Does Maven provide a property with the path to the local repo? I think the answer is 'no'. I define a real property in my settings.xml, redundantly with localRepository. localRepositoryc:/m2/repository/localRepository profile idmy-profile/id activation activeByDefaulttrue/activeByDefault /activation properties local.repositoryc:/m2/repository/local.repository /properties ... localRepository tells Maven where the repo is, but it is NOT a property. You can access it like a property with ${localRepository}, but this does not resolve to the value you expect. Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640 -Original Message- From: Beelen, M. - SPLXL [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 06, 2008 3:42 AM To: Maven Users List Subject: RE: maven.repo.local, again -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, May 05, 2008 6:59 PM To: users@maven.apache.org Subject: maven.repo.local, again Is there any property set by maven that tells me where the local build repository is? I.e., once it resolves where it is going to build, will it tell me? I think the answer is just plain no, but I want to re-confirm. tia, -Russ - Hello Russ, You local repository is in %USER_HOME%\.m2\repository unless your specified otherwise in your settings.xml (located in %USER_HOME%\.m2) or your maven config (settings.xml in %MAVEN_HOME%\conf) When I run mvn install near the end the output shows: [INFO] [jar:jar] [INFO] Building jar: %PROJECT_HOME%\target\${artifactId}-${pom-version}.jar [INFO] [install:install] [INFO] Installing %PROJECT_HOME%\target\${artifactId}-${pom-version}.jar to %LOCAL_M2_REPO%\${groupId}\${artifactId}\${pom-version}\${artifactId}-${ pom-version}.jar [INFO] [INFO] BUILD SUCCESSFUL It doesn't set any environment settings, which is a good thing IMHO. With regards, Marco ** For information, services and offers, please visit our web site: http://www.klm.com. This e-mail and any attachment may contain confidential and privileged material intended for the addressee only. If you are not the addressee, you are notified that no part of the e-mail or any attachment may be disclosed, copied or distributed, and that any other action related to this e-mail or attachment is strictly prohibited, and may be unlawful. If you have received this e-mail by error, please notify the sender immediately by return e-mail, and delete this message. Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its employees shall not be liable for the incorrect or incomplete transmission of this e-mail or any attachments, nor responsible for any delay in receipt. Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch Airlines) is registered in Amstelveen, The Netherlands, with registered number 33014286 ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I use a plugin SNAPSHOT version?
Thanks for the replies. I was able to configure a pluginRepository for the codehaus snapshots and then Maven installed the jboss-maven-plugin snapshot. However, I needed to give a specific version number: 1.3.2-20080125.002731-6 to get it. Now, if the jboss-maven-plugin worked, I would be happier. It can't start JBoss. But that's not a topic here. Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640 -Original Message- From: Dennis Lundberg [mailto:[EMAIL PROTECTED] Sent: Friday, April 11, 2008 10:43 AM To: Maven Users List Subject: Re: How can I use a plugin SNAPSHOT version? General instructions for using snapshot plugins can be found here: http://maven.apache.org/guides/development/guide-testing-development-plu gins.html In your case you would need to replace the url of the repo to http://snapshots.repository.codehaus.org/ because the plugin you want is not in the Apache snapshot repo. That will get the plugin into your local repository. I can't help you with getting it to your repo server though. Brewster, Richard wrote: I want to use the latest version of this plugin: http://snapshots.repository.codehaus.org/org/codehaus/mojo/jboss-maven -p lugin/1.3.2-SNAPSHOT/ What's the procedure for getting this into my local repository, and then into my company's Artifiactory? Thanks, Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640 -- Dennis Lundberg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How can I use a plugin SNAPSHOT version?
I want to use the latest version of this plugin: http://snapshots.repository.codehaus.org/org/codehaus/mojo/jboss-maven-p lugin/1.3.2-SNAPSHOT/ What's the procedure for getting this into my local repository, and then into my company's Artifiactory? Thanks, Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640
RE: maven properties seem not to work in profile activation feature
I am not sure what you mean by maven property. localRepository is NOT a property. I found that while you can reference it like a property with ${localRepository}, you do not get back the value given in the XML element, but something different. Perhaps my remark about using the local.repository property in profile activation was confusing. I don't use that property to activate a profile; I just use it to locate artifacts in the repo. Activating profiles with properties works just fine. As: profile idintegration-test/id activation property name!maven.test.skip/name /property /activation Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640 -Original Message- From: Arnd Kleinbeck [mailto:[EMAIL PROTECTED] Sent: Thursday, February 28, 2008 5:57 AM To: Maven Users List Cc: Brewster, Richard Subject: Re: maven properties seem not to work in profile activation feature Hi Richard, does this really work for you? I cannot manage to use a maven property value for profile activation, neither if i declare the property in the pom nor in settings.xml. As far as i understand, maven property usage for activating profiles is not supported. The only solution - as far as i know - would be the implementation of a custom profile activator. Does this work for maven 2.0.8? Has anybody experiences with that? BR Arnd ||| Arnd Kleinbeck ||| ||| innoQ Deutschland GmbH, Halskestr. 17, D-40880 Ratingen, Germany ||| phone: +49 2102 77162-100, mobile: +49 163 8780130, fax: +49 2102 77160-1 ||| e-mail: [EMAIL PROTECTED], web: http://www.innoq.com Am 16.01.2008 um 18:54 schrieb Brewster, Richard: I ran into this before. The localRepository element is *NOT* a property. Although it can be referenced like one, it does not behave as expected. localRepository/m2/repository/localRepository I defined my own local.repository property that duplicates the path, so I could reference it. In the properties element in settings.xml: properties local.repository/m2/repository/local.repository .. other properties /properties Now you can write ${local.repository} in your pom.xml and use that in profile activation conditions. Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640 -Original Message- From: Patrizio Munzi [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 9:00 AM To: users@maven.apache.org Subject: maven properties seem not to work in profile activation feature Hi all, I'm trying to manage profiles activations/deactivations by using the activation tag among with the file tag. What I would like to do is to activate a particular profile only if a specified folder is present into the local repository. The profile configuration I'm using is the following: profiles profile idapache/id activation activeByDefaultfalse/activeByDefault file missing${settings.localRepository}/org/apache/maven/plugins/maven- jar- plugin/2.2-SNAPSHOT/missing /file /activation repositories [...] /repositories pluginRepositories [...] /pluginRepositories /profile /profiles Now, if I use the explicit path of the local repository everything works well, instead if I use the property ${settings.localRepository} id doesn't work. It seems that maven isn't able to give a value to the property. I tried this profile configuration in both settings.xml and pom.xml files. Moreover I even tried to use different properties (e.g. ${user.dir}. ${usr.home}) but in all the case I had no successful results. Have I missed something...? Is there any problem in managing properties..? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: maven properties seem not to work in profile activation feature
I ran into this before. The localRepository element is *NOT* a property. Although it can be referenced like one, it does not behave as expected. localRepository/m2/repository/localRepository I defined my own local.repository property that duplicates the path, so I could reference it. In the properties element in settings.xml: properties local.repository/m2/repository/local.repository .. other properties /properties Now you can write ${local.repository} in your pom.xml and use that in profile activation conditions. Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640 -Original Message- From: Patrizio Munzi [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 9:00 AM To: users@maven.apache.org Subject: maven properties seem not to work in profile activation feature Hi all, I'm trying to manage profiles activations/deactivations by using the activation tag among with the file tag. What I would like to do is to activate a particular profile only if a specified folder is present into the local repository. The profile configuration I'm using is the following: profiles profile idapache/id activation activeByDefaultfalse/activeByDefault file missing${settings.localRepository}/org/apache/maven/plugins/maven-jar- plugin/2.2-SNAPSHOT/missing /file /activation repositories [...] /repositories pluginRepositories [...] /pluginRepositories /profile /profiles Now, if I use the explicit path of the local repository everything works well, instead if I use the property ${settings.localRepository} id doesn't work. It seems that maven isn't able to give a value to the property. I tried this profile configuration in both settings.xml and pom.xml files. Moreover I even tried to use different properties (e.g. ${user.dir}. ${usr.home}) but in all the case I had no successful results. Have I missed something...? Is there any problem in managing properties..? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Maven bypassing repository declarations?
We have set up Artifactory at our company and the only references in repositories refer to Artifactory. Yet Maven seems to go around Artificatory for some artifacts. When building up a clean, empty local repository, some artifacts are found that are not cached in Artifactory. How can this be happening? Some examples: Downloading: http://maven.openqa.org/bouncycastle/bcprov-jdk15/135/bcprov-jdk15-135.j ar Downloading: http://maven.openqa.org/bouncycastle/bcprov-jdk15/135/bcprov-jdk15-135.p om Downloading: http://maven.openqa.org/org/codehaus/mojo/mojo/15/mojo-15.pom Downloading: http://maven.openqa.org/org/openqa/selenium/core/selenium-core/0.8.3/sel enium-core-0.8.3.jar Downloading: http://maven.openqa.org/org/openqa/selenium/core/selenium-core/0.8.3/sel enium-core-0.8.3.pom Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640
RE: How to avoid transitive Dependencies getting packaged
Why do you want to exclude the transitive dependencies? Is it because these provided by your container (JBoss, Tomcat) and you wish to use those provided versions? How do you verify that the container's versions are compatible? Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640 -Original Message- From: Wayne Fay [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 08, 2008 9:51 AM To: Maven Users List Subject: Re: How to avoid transitive Dependencies getting packaged The way I do this (and there may be another or better way), I add explicitly add the transitive dependencies to my pom, and mark them as scope provided. Wayne On 1/8/08, amit kumar [EMAIL PROTECTED] wrote: Hi, I am building a WAR, but I see some jar files in the lib WEB-INF\lib folder in the build which are not mentioned in the pom.xml, and probably are transitive dependencies. How do I make sure the transitive dependencies are not put in the lib folder. I looked on maven-war-plugin FAQs but not any help. Could someone please guide on that. Regards, Amit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Coverage report of web application integration test with cobertura-maven-plugin
I want to produce a coverage report for the integration test phase of a web application (war packaging). My integration tests are run by the Cargo maven plugin launching JBoss 4.0.5. I've been using the 2.0 version of the cobertura-maven-plugin (and will try the upgrade to 2.2). I have a modular project with core and web modules. I get the expected coverage reports for my core module, but zero coverage for the web module. The instrumented classes are not packaged into the war, for one. According to the Cobertura FAQ, this sort of coverage testing can be done. http://cobertura.sourceforge.net/faq.html Has anyone done this? Any advice would be appreciated! Also, it would be great if integration test coverage could be documented here, too: http://mojo.codehaus.org/cobertura-maven-plugin/usage.html Thanks, Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Dependency question
Declare the dependency as test scope: dependency groupId${jdbc.groupId}/groupId artifactId${jdbc.artifactId}/artifactId version${jdbc.version}/version scopetest/scope /dependency Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640 -Original Message- From: Jason Porter [mailto:[EMAIL PROTECTED] Sent: Friday, December 07, 2007 2:12 PM To: users@maven.apache.org Subject: Dependency question Is there a way to specify a dependency to be available for compilation and test running, but not have it packaged up? We have a situation where some older code that has been converted to maven2 uses a library (SAP JCo if anyone is familiar with it) that must be there to compile and also to run. Some of the tests were written to communicate with SAP, which requires the jar to be in the classpath at runtime. When the application is deployed the jar is provided via the container, so we need it available to run the tests, but don't want it packaged up with the application. Jason Porter O.C. Tanner Information Services Technical Specialist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: localRepository property prepends backslash on Windows
I'll answer my own question. localRepository isn't a property. Although you can reference it like one, it does not return the value you set, but apparently modifies it. I solved this by creating a property local.repository. A bit redundant, but it got the job done. Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640 -Original Message- From: Brewster, Richard [mailto:[EMAIL PROTECTED] Sent: Friday, December 07, 2007 5:43 PM To: users@maven.apache.org Subject: localRepository property prepends backslash on Windows I am using the maven-antrun-plugin to execute a simple copy task that configures my JBoss instance prior to running integration-test with Cargo. I want to include the JDBC driver jar, which is installed into my local maven repository. I've relocated the repository in settings.xml as follows: localRepositoryC:/m2/repository/localRepository Here is the task element copy todir=${cargo.container.home}/server/default/lib fileset dir=${localRepository}/com/oracle/${jdbc.artifactId}/${jdbc.version} include name=*.jar/ /fileset /copy I get: [INFO] Error executing ant tasks Embedded error: C:\dev\af-modular\web\[local] - file:\C:\m2\repository\com\oracle\ojdbc14\10.2.0.3.0 not found. If I replace the localRepository property reference with the literal 'C:/m2/repository' all is well. It is the backslash before C: that's the trouble. Where is it coming from? Any suggestion to solve this, or a completely different approach, would be welcome. TIA, Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
localRepository property prepends backslash on Windows
I am using the maven-antrun-plugin to execute a simple copy task that configures my JBoss instance prior to running integration-test with Cargo. I want to include the JDBC driver jar, which is installed into my local maven repository. I've relocated the repository in settings.xml as follows: localRepositoryC:/m2/repository/localRepository Here is the task element copy todir=${cargo.container.home}/server/default/lib fileset dir=${localRepository}/com/oracle/${jdbc.artifactId}/${jdbc.version} include name=*.jar/ /fileset /copy I get: [INFO] Error executing ant tasks Embedded error: C:\dev\af-modular\web\[local] - file:\C:\m2\repository\com\oracle\ojdbc14\10.2.0.3.0 not found. If I replace the localRepository property reference with the literal 'C:/m2/repository' all is well. It is the backslash before C: that's the trouble. Where is it coming from? Any suggestion to solve this, or a completely different approach, would be welcome. TIA, Richard Brewster Senior Associate Perrin Quarles Associates [EMAIL PROTECTED] (434) 817-2640