Maven Custom Parent property from Module
I cant access, from a Maven module, to a property defined in the properties section of the parent. As a matter of fact When I launch the build below the warName is the default one. This is the parent Pom modelVersion4.0.0/modelVersion groupIdcom.speed.pms/groupId artifactIdPMS-Main/artifactId version1.0.0/version packagingpom/packaging namePMS Main Build Project/name properties context-rootPMS-CUSTOM/context-root /properties modules module../PMS-WEB/module /modules And this is the module ... artifactIdPMS-WEB/artifactId packagingwar/packaging namePMS-WEB Webapp/name properties project.build.sourceEncodingUTF-8/project.build.sourceEncoding web.resource.dirsrc/main/webapp/web.resource.dir /properties build plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-war-plugin/artifactId version2.4/version configuration warName${context-root}/warName webResources resource directory${web.resource.dir}/directory /resource /webResources /configuration /plugin While I can use the ${project.parent.arctifactId} property. I try also ${project.parent.properties.context-root} but without success. It should be simple but I cant understand Which is my errror? Shouldn't be the properties inherited from the parent in a Module? Davide -- View this message in context: http://maven.40175.n5.nabble.com/Maven-Custom-Parent-property-from-Module-tp5776488.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Custom Parent property from Module
does your child project reference the parent using the parent element? in the correct version? Milos On Mon, Nov 25, 2013 at 9:57 AM, Panciz dav.pole...@gmail.com wrote: I cant access, from a Maven module, to a property defined in the properties section of the parent. As a matter of fact When I launch the build below the warName is the default one. This is the parent Pom modelVersion4.0.0/modelVersion groupIdcom.speed.pms/groupId artifactIdPMS-Main/artifactId version1.0.0/version packagingpom/packaging namePMS Main Build Project/name properties context-rootPMS-CUSTOM/context-root /properties modules module../PMS-WEB/module /modules And this is the module ... artifactIdPMS-WEB/artifactId packagingwar/packaging namePMS-WEB Webapp/name properties project.build.sourceEncodingUTF-8/project.build.sourceEncoding web.resource.dirsrc/main/webapp/web.resource.dir /properties build plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-war-plugin/artifactId version2.4/version configuration warName${context-root}/warName webResources resource directory${web.resource.dir}/directory /resource /webResources /configuration /plugin While I can use the ${project.parent.arctifactId} property. I try also ${project.parent.properties.context-root} but without success. It should be simple but I cant understand Which is my errror? Shouldn't be the properties inherited from the parent in a Module? Davide -- View this message in context: http://maven.40175.n5.nabble.com/Maven-Custom-Parent-property-from-Module-tp5776488.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Custom Parent property from Module
Yes I do . Actually in the previous post I omit the parent declaration the complete child header is: project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; modelVersion4.0.0/modelVersion parent groupIdcom.speed.pms/groupId artifactIdPMS-Main/artifactId version1.0.0/version /parent artifactIdPMS-WEB/artifactId packagingwar/packaging namePMS-WEB Maven Webapp/name dependencies /dependencies build finalNamePMS-WEB/finalName plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-war-plugin/artifactId version2.4/version configuration warName${context-root}/warName webResources resource directory${web.resource.dir}/directory /resource /webResources /configuration /plugin /plugins /build /project Davide -- View this message in context: http://maven.40175.n5.nabble.com/Maven-Custom-Parent-property-from-Module-tp5776488p5776490.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Custom Parent property from Module
It should work. Maybe it's something with the war plugin. What version av Maven are you on btw? /Anders On Mon, Nov 25, 2013 at 10:22 AM, Panciz dav.pole...@gmail.com wrote: Yes I do . Actually in the previous post I omit the parent declaration the complete child header is: project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; modelVersion4.0.0/modelVersion parent groupIdcom.speed.pms/groupId artifactIdPMS-Main/artifactId version1.0.0/version /parent artifactIdPMS-WEB/artifactId packagingwar/packaging namePMS-WEB Maven Webapp/name dependencies /dependencies build finalNamePMS-WEB/finalName plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-war-plugin/artifactId version2.4/version configuration warName${context-root}/warName webResources resource directory${web.resource.dir}/directory /resource /webResources /configuration /plugin /plugins /build /project Davide -- View this message in context: http://maven.40175.n5.nabble.com/Maven-Custom-Parent-property-from-Module-tp5776488p5776490.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Custom Parent property from Module
while your module../PMS-WEB/module section in parent pom references the child in the same directory, your parent/relativePath is undefined, therefore expecting the parent to be one level up, not on the same level. Please check documentation for maven model + see the effective pom to see if the property is actually defined. milos On Mon, Nov 25, 2013 at 10:22 AM, Panciz dav.pole...@gmail.com wrote: Yes I do . Actually in the previous post I omit the parent declaration the complete child header is: project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; modelVersion4.0.0/modelVersion parent groupIdcom.speed.pms/groupId artifactIdPMS-Main/artifactId version1.0.0/version /parent artifactIdPMS-WEB/artifactId packagingwar/packaging namePMS-WEB Maven Webapp/name dependencies /dependencies build finalNamePMS-WEB/finalName plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-war-plugin/artifactId version2.4/version configuration warName${context-root}/warName webResources resource directory${web.resource.dir}/directory /resource /webResources /configuration /plugin /plugins /build /project Davide -- View this message in context: http://maven.40175.n5.nabble.com/Maven-Custom-Parent-property-from-Module-tp5776488p5776490.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Custom Parent property from Module
Apache Maven 3.1.0 Java version: 1.7.0_40 -- View this message in context: http://maven.40175.n5.nabble.com/Maven-Custom-Parent-property-from-Module-tp5776488p5776493.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Custom Parent property from Module
Try Maven 3.0.4 instead and see if that works. If so, please try Maven 3.1.1 and verify that it still works. /Anders On Mon, Nov 25, 2013 at 10:49 AM, Panciz dav.pole...@gmail.com wrote: Apache Maven 3.1.0 Java version: 1.7.0_40 -- View this message in context: http://maven.40175.n5.nabble.com/Maven-Custom-Parent-property-from-Module-tp5776488p5776493.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Custom Parent property from Module
OK adding the relativePath../PMS-Main/relativePath to the child pom.xml everything works. Thanks for the quick reply. Davide -- View this message in context: http://maven.40175.n5.nabble.com/Maven-Custom-Parent-property-from-Module-tp5776488p5776499.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Custom Parent property from Module
Well you do know all bets are off if you are using non-SNAPSHOT versions for anything but a release build On 25 November 2013 10:19, Panciz dav.pole...@gmail.com wrote: OK adding the relativePath../PMS-Main/relativePath to the child pom.xml everything works. Thanks for the quick reply. Davide -- View this message in context: http://maven.40175.n5.nabble.com/Maven-Custom-Parent-property-from-Module-tp5776488p5776499.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
mvn test -Dtest=...TestClass shows the wrong error
If I try to run a single test class with: mvn test -Dtest=namespace1.TestClass But TestClass is really in namespace1.namespace2, then Maven reports: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.9:test (default-test) on project p1: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.) Which is misleading. In fact, there is no class namespace1.TestClass. Would be nice if the message for this edge case were changed to something like: No such class: namespace1.TestClass. The current error message had me scratching my head for a while--TestClass *does* have @Test methods!--before I realized I had forgotten to go one level deeper in my namespace. -- Cheers, Andrew Pennebaker apenneba...@42six.com
[ANN] FindBugs Maven Plugin version 2.5.3 Released
Hi, The Mojo team is pleased to announce the release of the FindBugs Maven Plugin version 2.5.3. FindBugs uses static analysis to inspect Java bytecode for occurrences of bug patterns. To get this update, simply specify the version in your project's plugin configuration: plugin groupIdorg.codehaus.mojo/groupId artifactIdfindbugs-maven-plugin/artifactId version2.5.3/version /plugin We solved the following issues:http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=11701version=18737 http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=11701version=17239 Release Notes - Mojo's FindBugs Maven Plugin - Version 2.5.3 ** Bug * [MFINDBUGS-174] - Incorrect exclude files used * [MFINDBUGS-176] - Update to plexus-resources 1.0-alpha-7 beacuse 1.0-alpha-4 causes ConcurrentModificationException in parallel builds * [MFINDBUGS-178] - Maven 2.2.1: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration executing findbugs during the build and site lifecycle * [MFINDBUGS-183] - Empty Report when using 2 includeFilterFiles ** Improvement * [MFINDBUGS-175] - Update to Findbugs version 2.0.2 * [MFINDBUGS-177] - Expose onlyAnalyze on the commandline. Enjoy, Garvin LeClaire garvin.lecla...@gmail.com
Re: mvn test -Dtest=...TestClass shows the wrong error
IIUC this has been fixed with version 2.12 by adding the failIfNoSpecifiedTests[1] Robert [1] http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#failIfNoSpecifiedTests Op Mon, 25 Nov 2013 16:07:53 +0100 schreef Andrew Pennebaker apenneba...@42six.com: If I try to run a single test class with: mvn test -Dtest=namespace1.TestClass But TestClass is really in namespace1.namespace2, then Maven reports: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.9:test (default-test) on project p1: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.) Which is misleading. In fact, there is no class namespace1.TestClass. Would be nice if the message for this edge case were changed to something like: No such class: namespace1.TestClass. The current error message had me scratching my head for a while--TestClass *does* have @Test methods!--before I realized I had forgotten to go one level deeper in my namespace. -- Cheers, Andrew Pennebaker apenneba...@42six.com - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
WAR plugin versus archiveClasses versus finalName
Folks, Environment: Maven 3.1.1, JDK 1.7.0_45 I'm having some challenges with the Maven WAR plugin (2.4), archiveClasses, and finalName. In addition, I am using the Freemarker preprocessor plugin (FMPP plugin) to generate some output. Here's what I've tried (without the FMPP plugin). 1. Default name (artifactId-version.extension) All resources and classes get placed into artifactId-version.JAR as expected. The WAR file is also named artifactId-version.WAR. 2. finalName as ${project.artifactId} No classes get placed into artifactId-version.JAR. Resources are added into artifactId-version.JAR. The WAR file is named artifactId.war 3. finalName as ${project.artifactId} with explicit outputFileMapping outputFileNameMapping @{artifactId}@-@{version}@.@{extension}@ /outputFileNameMapping No classes get placed into artifactId-version.JAR. Resources are added into artifactId-version.JAR. The WAR file is named artifactId.war 4. finalName as ${project.artifactId} with explicit outputFileMapping outputFileNameMapping @{artifactId}@.@{version}@.@{extension}@ /outputFileNameMapping Note the '.' instead of the dash between artifactId and version. All resources and classes are placed into artifactId.version.JAR. All other dependent JARs are also renamed. The WAR file is named artifactId.war To add confusion to the mix, I'm using the FMPP plugin. I've bound this to the compile phase (rather than the default generate-sources phase), and placed the output in target/classes. I'm doing this since I am preprocessing some files that should get included into the JAR. Now, if I rerun the above four scenarios, I get the following results. 1. The preprocessed file is not placed in the JAR file, even though it's in target/classes in the proper place. 2. Only the resources get placed into the JAR file (as before). 3. Only the resources get placed into the JAR file (as before). 4. All resources, preprocessed files, and classes get placed into the JAR file. In short, scenario 4 works with the downside that it renames all other dependent JARs to fit the outputFileNameMapping designation. I don't understand why 3 doesn't work. The desired end result is to have a version-less WAR file, and all of the project resources bundled up into the standard artifactId-version.extension naming format. The only way I've found to accomplish this is to make a module with the resources / source code and have the parent depend on this module. That certainly feels like a hack to get around a packaging problem. What is my vision problem (other than my requirements, which are sadly not subject to change at the moment)? Thanks, Mark /mde/ - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Is it possible to release a child module that isn't listed in the parent's list of modules?
Did you resolve your problem? If you did, could you reply with your resolutions so that they can be archived. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: maven 3.1.1 StackOverflowError
can't tell anymore which plugin executed before the error... the problem had to be fixes as fast as possible so a downgrade of maven was or solution and now it works. And switching back again would'nt be a good idea since the others would claim my head if I break anything on which they're working right now. -- View this message in context: http://maven.40175.n5.nabble.com/maven-3-1-1-StackOverflowError-tp5776099p5776559.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: WAR plugin versus archiveClasses versus finalName
The only way I've found to accomplish this is to make a module with the resources / source code and have the parent depend on this module. That certainly feels like a hack to get around a packaging problem. To me, this is not a hack. Maven does not really want you to have source code in WAR projects. The problems you are experiencing are related to that. You should move the source code to JAR projects and depend on them. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org