Re: Parent POM, properties and scm problem
I'm also experiencing this problem. As discussed here (under Inheritance v. Aggregation): http://www.propellors.net/maven/site/pom.html#POM%20Relationships it appears to make sense in what is called the aggregation use case, but not in the inheritance use case. I'm wondering if there's some way to simply disable this functionality (maybe setting a property? don't know...) to get these url elements to inherit as one would expect - as is. If this functionality isn't currently available, and somebody could point me to the appropriate code, I would be happy to try and write a patch for it... Thanks, Jared Oscar Picasso Thu, 02 Aug 2007 06:31:58 -0700 That's exactly what I am doing. And it works fine except for the problem that I mention in this thread of the project artifactId being added to some urls like the scmConnection. On 8/1/07, Bryan Loofbourrow [EMAIL PROTECTED] wrote: I'm wondering if the following would work: - Make your organizational pom project. Don't define any module entries in it. - Have all of your projects depend on it as a parent - Build and install your organizational pom to a central repository accessible to all of your projects. I'm thinking that you can then independently build and deploy your organizational pom by itself, and have your projects use it, from the repository, as a parent for definition purposes, though not build purposes. I'd be interested to know whether this works. It seems useful. -- Bryan -Original Message- From: Oscar Picasso [EMAIL PROTECTED] Sent: Wednesday, August 01, 2007 10:31 AM To: Maven Users List Subject: Re: Parent POM, properties and scm problem The current Maven behaviour is fine for multimodule projects. However I am trying to write a organizational POM that all my projets would inherited and wanted to avoid duplication of the scm section. So in case of independent projects it does not make sense to put all them inside the same trunk. I guess currently I cannot avoid this duplication. On 7/31/07, Eric Redmond [EMAIL PROTECTED] wrote: Maven does this so that child module's scm can be defined once in the parent. scm connectionscm:svn:https://url/project/trunk /scm modules moduleChild Then the Child module's scm url is automatically set as: scm connectionscm:svn:https://url/project/trunk/Child /scm Which is the convention for a multi-module project. If your Child project has to be seperate, with it's own trunk, etc. I would suggest (if svn) using svn:externals to access the child under the parent project. Since it ownly appends the name on a multi-module project, I'm trying to figure out how you locally check out your project... perhaps create a trunks-style setup in your version control would be best? Eric On 7/30/07, Oscar Picasso [EMAIL PROTECTED] wrote: I have also noticed the same behavior with the project url, the sit url and the scm url even if in the effective the corresponding properties are correct (without the artifactId appended). On 7/30/07, Oscar Picasso [EMAIL PROTECTED] wrote: Hi, In the parent POM I have the following: [...] properties scmConnection http://localhost/repos/repo/${groupId}/${artifactId}/trunk http://localhost/repos/repo/$%7BgroupId%7D/$%7BartifactId%7D/trunk http://localhost/repos/repo/$%7BgroupId%7D/$%7BartifactId%7D/trunk /scmConnection /properties scm connection${scmConnection}/connection developerConnection${scmConnection}/developerConnection /scm [...] The child POM has nothing expect mandatory elements and the reference to the parent POM. Both the child and the parent are snapshots. The parent POM has been deployed to the remote repository. When I run mvn help:effective-pom on the child project, I get: [...] scm connection http://localhost/repos/repo/com.opicasso/Child/trunk/Child /connection developerConnection http://localhost/repos/repo/com.opicasso/Child/trunk/Child /developerConnection /scm [..] I would have expected: [...] scm connectionhttp://localhost/repos/repo/com.opicasso/Child/trunk /connection developerConnection http://localhost/repos/repo/com.opicasso/Child/trunk /developerConnection /scm [..] Why does maven happen the child artifactId to the connections? Does maven merge the parent scm connections with the children ones ? But in the current case the child has no scm connections defined in its pom. How to get rid of this extra artifactId? Thanks Oscar -- Eric Redmond http://blog.propellors.net
Re: How to set custom Plugin Parameters?
Sounds like the phase thing might point at the problem - say you had two executions defined. This is useful if you want to define the same goal (or different goals) to be run in different phases. But, just running it from the command line, how would maven know which one to use? Following this logic, it would make sense that only the base plugin configuration, not the configuration of individual executions, would apply when running the goal directly from the command line. Maybe somebody with a bit more knowledge could confirm whether this makes sense, or I'm way off base? On 9/1/06, Alexis Midon [EMAIL PROTECTED] wrote: thanks all for your answers, actually the problem as not due to 'protected' modifier nor to 'expression' attribute. Something was wrong with my pom. The command I use is: mvn mygroupId:foobar:copyfile Configuration was not taken into account when I write: plugin groupIdmygroupId/groupId artifactIdmaven-foobar-plugin/artifactId executions execution idcopy:file/id goals goalcopyfile/goal /goals configuration sourceDirectorytarget/sourceDirectory outputDirectory${project.build.directory }/toto/outputDirectory includes include*.jar/include /includes excludes exclude**/exclude /excludes /configuration /execution /executions /plugin But everything works fine if we remove the executions tag and move upward configuration like: plugin groupIdmurex.maven.plugins/groupId artifactIdmaven-production-plugin/artifactId configuration sourceDirectorytarget/sourceDirectory outputDirectory${project.build.directory }/toto/outputDirectory includes include*.jar/include /includes excludes exclude**/exclude /excludes /configuration /plugin I do not really understand what's wrong, is it the lake of phase tag (the plugin does not set a default phase)? Explanations would be very appreciate. Thanks all, Alexis On 8/31/06, Jared Bunting [EMAIL PROTECTED] wrote: Another thought - the guide here talks about using private fields for mojo configuration - i noticed that yours is protected. It specifically mentions that setters can be used in place of private fields, but makes no mention of protected fields. Now, while it would make sense to me that the protected field should work, it might be something worth trying... On 8/31/06, Ovidio Mallo [EMAIL PROTECTED] wrote: Hi Alexis, you may try with @parameter expression=${excludes} in the annotation of your array. I can't test it right now, but I guess this should work. Regards, Ovidio Alexis Midon wrote: Hi all, I'm currently writting a custom plugin, but I've got a problem with the parameter settings. Here is it: My plugin declares a String array as follow: /** * The collection of exclude patterns to be applied on the sourceDirectory * * @parameter */ protected String[] excludes; In the pom file I add the following tag: execution ... configuration ... excludes exclude*.jar/exclude exclude**/.foo/exclude /excludes /configuration /execution Unfortunately the String array remains null :( Where's the hell is the bug please?! Thanks a lot for your help, Alexis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: mvn2: war packaging
I might be missing what you're trying to do here, and it seems to me that creating a multi-module project, as suggested, would be the best way to go about this. However, what if you bound your source generation to the generate-sources phase. I'm not sure of how it would be done in ant, but I know that you can then add the generated sources to the list of files to compile in the compile phase and then they should be included in your WEB-INF/classes directory in the war file. They won't be in a jar, but they'll be in your war. (and you can DEFINITELY guarantee that they will be generated before the war is created - it seems that they are getting generated after the war because you are binding to the packaging phase, which is meant to actually package, and plugin order within a phase is undefined...) I found an article that mentions doing this with a hibernate ant task here: http://www.onjava.com/pub/a/onjava/2005/12/14/hibernate-class-generation-with-hbm2java.html?page=4 Maybe this will be helpful? On 8/31/06, chua [EMAIL PROTECTED] wrote: Hi! I had more or less the same problem as you. One of the solutions is to create a project based on modules. You just have to create a parent pom with: modules modulemodule_for_jar/module modulemodule_for_war/module /modules Then, you have to create two subfolders with the same name as the modules and with the m2 folder structure, each one with its own pom. Now you just have to have in one pom a jar packaging, and in the other a war packaging. The last thing to do is to include the dependency of the jar created in the jar module in the pom.xml of the war module. That´s one solution and it works to me. Be sure your jar module is declared first, and second, declare your war module. I hope I had helped you -- View this message in context: http://www.nabble.com/mvn2%3A-war-packaging-tf2186390.html#a6078489 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Specifying a pre-existing application.xml
The option I can see that seems to relate to my issue is the generateApplicationXml , which one can set to true, to turn off generation of the application.xml.Butthen how do I tell the plugin where the pre-existing application.xml file is located?I'm looking for something similar to Maven1's maven.ear.appxml=path-to-existing-application -xml-file http://maven.apache.org/plugins/maven-ear-plugin/ear-mojo.html The first parameter in there seems to answer this question... On 8/31/06, Jeff Mutonho [EMAIL PROTECTED] wrote: On 8/31/06, Alexandre Touret [EMAIL PROTECTED] wrote: Hello Jeff Mutonho wrote: Q1) How do I specify a pre-existing application.xml to the maven-ear-plugin ? Look at the official documentation of the ear plugin. It seems to have one property to set during the ear:generate-application.xml execution http://maven.apache.org/plugins/maven-ear-plugin/generate-application-xml-mojo.html The option I can see that seems to relate to my issue is the generateApplicationXml , which one can set to true, to turn off generation of the application.xml.Butthen how do I tell the plugin where the pre-existing application.xml file is located?I'm looking for something similar to Maven1's maven.ear.appxml= path-to-existing-application-xml-file If I have understood, I suppose you ll find the solution in the howto http://maven.apache.org/plugins/maven-ear-plugin/howto.html You're right, this can be done by customizing the name of the file being added to the ear file. Kind regards -- Jeff Mutonho GoogleTalk : ejbengine Skype: ejbengine Registered Linux user number 366042
Re: Packaging 'ear' is invalid. Aggregator projects require 'pom' as packaging
From what I've been able to tell in the past, it seems that the rule is if your project has the modules element, then it has to be of packaging type pom. It looks like you have an ear project that you want to include an ejbModule and a warModule - I have done this in the past by having a parent pom, and the ear file essentially being a sibling of my other modules. I can still specify the ejbModule and webModule configurations in the ear. That make sense? On 8/31/06, Jeff Mutonho [EMAIL PROTECTED] wrote: I'm getting the following error when I try to build an ear file. [INFO] Scanning for projects... [INFO] [ERROR] FATAL ERROR [INFO] [INFO] Error building POM (may not be this project's POM). Project ID: za.co.telkom.eportal:eportal-ear POM Location: D:\MAVEN-WORK\eportal-ear\pom.xml Validation Messages: [0] Packaging 'ear' is invalid. Aggregator projects require 'pom' as packag ing. Reason: Failed to validate POM [INFO] [DEBUG] Trace org.apache.maven.reactor.MavenExecutionException: Failed to validate POM at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java :365) -- The pom that causing this is shown below: project modelVersion4.0.0/modelVersion parent groupIdza.co.pragmaticus.eportal/groupId artifactIdpragmaticus-eportal/artifactId version1.0.0/version /parent artifactIdeportal-ear/artifactId namepragmaticus ePortal/name packagingear/packaging version1.0.0/version descriptionEportal Ear/description profiles profile ideportal-ejb/id activation activeByDefaulttrue/activeByDefault /activation modules moduleeportal-services/module moduleeportal-messaging/module moduleeportal-messaging-support/module moduleeportal-domain/module moduleeportal-exceptions/module /modules build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-ear-plugin/artifactId configuration displayNameEportal EJB Module/displayName descriptionEportal EJB Module/description version1.0.0/version modules ejbModule groupIdza.co.pragmaticus.eportal/groupId artifactIdeportal-messaging/artifactId /ejbModule /modules earNameeportal-messaging/earName /configuration /plugin /plugins /build /profile profile ideportal-war/id activation activeByDefaulttrue/activeByDefault property nameenableCiProfile/name valuetrue/value /property /activation modules moduleeportal-services/module moduleeportal-webservices/module moduleeportal-domain/module moduleeportal-exceptions/module moduleeportal/module /modules build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-ear-plugin/artifactId configuration displayNameEportal Web/displayName descriptionEportal Web/description version1.0.0/version modules webModule groupIdza.co.pragmaticus.eportal/groupId artifactIdeportal/artifactId contextRoot/eportal/contextRoot /webModule /modules /configuration /plugin /plugins /build /profile /profiles /project Jeff Mutonho GoogleTalk : ejbengine Skype: ejbengine Registered Linux user number 366042
Re: How to set custom Plugin Parameters?
Another thought - the guide here talks about using private fields for mojo configuration - i noticed that yours is protected. It specifically mentions that setters can be used in place of private fields, but makes no mention of protected fields. Now, while it would make sense to me that the protected field should work, it might be something worth trying... On 8/31/06, Ovidio Mallo [EMAIL PROTECTED] wrote: Hi Alexis, you may try with @parameter expression=${excludes} in the annotation of your array. I can't test it right now, but I guess this should work. Regards, Ovidio Alexis Midon wrote: Hi all, I'm currently writting a custom plugin, but I've got a problem with the parameter settings. Here is it: My plugin declares a String array as follow: /** * The collection of exclude patterns to be applied on the sourceDirectory * * @parameter */ protected String[] excludes; In the pom file I add the following tag: execution ... configuration ... excludes exclude*.jar/exclude exclude**/.foo/exclude /excludes /configuration /execution Unfortunately the String array remains null :( Where's the hell is the bug please?! Thanks a lot for your help, Alexis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Spring Framework Dependencies
I have attached a zip containing poms and checksums for 1.2.8 to the ticket you mention. What else do I need to do to get these uploaded to ibiblio? Thanks, Jared On 8/30/06, Carlos Sanchez [EMAIL PROTECTED] wrote: any questions about spring and their poms must be asked there, or you provide the poms to be uploaded to ibiblio. On 8/30/06, Pin Ngee Koh [EMAIL PROTECTED] wrote: Do I download repository from http://www.ibiblio.org/maven2 and unzip spring-pom-1.2.8.zip over it? Is there a reason why we are not keeping http://www.ibiblio.org/maven2 update to date? On 8/30/06, Carlos Sanchez [EMAIL PROTECTED] wrote: see http://opensource.atlassian.com/projects/spring/browse/SPR-1484 On 8/30/06, Pin Ngee Koh [EMAIL PROTECTED] wrote: I have many artifacts which dependent on spring. What's the best way to declare dependency on Spring - specifically 1.2.8? I can think of the following ways: (1) Declare a parent pom with the right dependencies to spring-core, spring-orm, ...etc. And have each project pom inherit it Issue: some pom does not have the right transtive dependency. E.g. http://www.ibiblio.org/maven2/org/springframework/spring-core/1.2.8/ does not have dependency declared for commons-logging. (2) Declare dependency on org.springframework:spring:1.2.8. But it does not include the right transitive dependencies Somehow, http://www.ibiblio.org/maven2 does not seems to have the complete dependencies defined. Am I missing something here? / c=-oo \ o - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- I could give you my word as a Spaniard. No good. I've known too many Spaniards. -- The Princess Bride - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- / c=-oo \ o - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- I could give you my word as a Spaniard. No good. I've known too many Spaniards. -- The Princess Bride - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]