Properties handling
Hello, We have developed a Maven plugin with some MOJOs and have two questions: Q1 In the pom.xml the user can specify two properties properties prop1SomeValue1/prop1 prop2SomeValue1/prop2 /properties prop1 is mandatory but prop2 is optional. In the plugin I have a validate MOJO and there I want to check those properties and if prop2 isn't set I want to set it to a value and to be globally available within the Maven process. - Is that possible and how? Q2 The pom.xml have some configurations such: MyElement${the.conf.value}/MyElement - Can I set/override that value in a MOJO and how? Thanks! -- Regards Joacim
Re: Simple question on packaging a Java Application
On Thursday 04 June 2009 Horton, Anne B wrote: Say you have a Java application (j2Se) and it has some dependent modules. Easy - right??? How do I get the Java application packaged as a jar when in my packaging clause in the Java application pom.xml is pom? Why do you use packaging pom for a java application? This way your java files wouldn't even get compiled (without extra configuration). You could use the Appassembler maven plugin [0], but I don't know how well it works with packaging pom. hth, - martin [0] http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/ signature.asc Description: This is a digitally signed message part.
Re: Need to convince my manager to switch to maven
Most questions got already answered, just one more comment about finding third party dependencies. On Thursday 04 June 2009 scabbage wrote: - Your pom.xml only shows those dependencies your project is directed dependent upon. Fine. But what about all other dependencies that your dependencies depend upon? Know who they, get them and put in CVS!! Use the maven-dependency-plugin's [0] goal dependency:tree to get a list of all dependencies with their dependencies listed. hth, - martin [0] http://maven.apache.org/plugins/maven-dependency-plugin/ signature.asc Description: This is a digitally signed message part.
package - should be simple but it ain't
Hello, I'm trying to package a library we created, which has compile-time dependencies on a few packages [spring and so forth], and it works fine but...we don't want the dependencies in the final jar. We have declared all dependencies to be either all provided or all compile, either way they end up in the final jar when we issue mvn package. What's the secret? -- View this message in context: http://www.nabble.com/package---should-be-simple-but-it-ain%27t-tp23883890p23883890.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: How to get an alert if a property value is missing
I'm having a problem with the enforcer plugin, it works well with the settings.xml, but if I require to check a property that has been set in a properties file placed in the resources, it always fails, saying that the property is null, but if I check in the generated config file...the value has been written correctly. filters filtersrc/main/resources/filter.properties/filter /filters resources resource directorysrc/main/resources/directory filteringtrue/filtering /resource /resources any idea why? -- View this message in context: http://www.nabble.com/How-to-get-an-alert-if-a-property-value-is-missing-tp23870644p23884445.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
Enforcer plugin doesn't read external properties files
Now that I found (it was told to me :)) what plugin could help me out I, maybe, found a problem in it. In my pom I want to check that several properties are set, everything works fine if the properties are set in the .m2/settings.xml file. Now I need these properties to be in a property file, in my case src/main/filters/filter.properties: # filter.properties filter.file.value=src/main/filters/filter.properties in my pom I added: filters filtersrc/main/filters/filter.properties/filter /filters and in the enforcer tags: requireProperty propertyfilter.file.value/property messagevalue set to: ${filter.file.value}/message /requireProperty if I run mvn i get the following: [WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireProperty failed with message: value set to: null if I check in the output file though i see: jndi:value type=java.lang.Stringsrc/main/filters/filter.properties/jndi:value why is that? shouldn't enforcer be able to read properties set in external property files? rgds -- View this message in context: http://www.nabble.com/Enforcer-plugin-doesn%27t-read-external-properties-files-tp23884939p23884939.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
plugin search?
Hi all, Is there a plugin that anoyone knows that can analyse dependencies in a multi module project and then warn if you have a depenendency on the same artifact with a set version (ie not using dependencyManagement) in more than one project? ie + root pom.xml |-- project A | \ pom.xml (depenedency on foo:bar:1.0.0 , bar:bar:1.0.0) | |-- project B | \pom.xml (depnedency on foo:bar 1.0.0, joe:blogs:1.3.2) | |-- project C | \pom.xml (dependency on joe:blogs:1.3.2, bob:dillon:4.3.2) that is when run would on the root module would 1) warn about A and B both declaring foo:bar:1.0.0 (should be in dependencyManagement of A) 2) warn very loudly about B and C both declaring joe:blogs but with different versions (need to standardise on a version and use dependencyManagement). Regards, /James ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 **
Re: plugin search?
Hi! On Friday 05 June 2009 Nord, James wrote: Is there a plugin that anoyone knows that can analyse dependencies in a multi module project and then warn if you have a depenendency on the same artifact with a set version (ie not using dependencyManagement) in more than one project? Sounds like a job for the versions-maven-plugin [0]. I think the plugin already warns you if dependencyManagement is not used. Not sure about different versions. If it doesn't support you use case file an enhancement request in JIRA. Maybe Stephen Connolly can provide some more details. hth, - martin [0] http://mojo.codehaus.org/versions-maven-plugin/ signature.asc Description: This is a digitally signed message part.
Re: plugin search?
I think the enforcer plugin has rules to help. 2009/6/5 Martin Höller mar...@xss.co.at Hi! On Friday 05 June 2009 Nord, James wrote: Is there a plugin that anoyone knows that can analyse dependencies in a multi module project and then warn if you have a depenendency on the same artifact with a set version (ie not using dependencyManagement) in more than one project? Sounds like a job for the versions-maven-plugin [0]. I think the plugin already warns you if dependencyManagement is not used. Not sure about different versions. If it doesn't support you use case file an enhancement request in JIRA. Maybe Stephen Connolly can provide some more details. hth, - martin [0] http://mojo.codehaus.org/versions-maven-plugin/
Assembling assemblies with exclude/include patterns
Hello, I'm kind of new to the assembly plugin but I'm starting to get some stuff out of it. However there is one trick I couldn't get to work so far, so I'm looking for some help on this. Here is my situation: I have a bunch of projects which all produce a jar file (without any resources, just classes) and a zip file containing all the resources (no classes, no jars). This works smoothly and I'm very happy of the output they each produce. On addition to that, I have four projects that are various combination of the projects mentionned above. What I would like to do is to have them produce a zip file with the following structure: all the resources (located in the zip previously created) of the projects they depend of at the top of the zip file, and within a lib directory, all the jars they depend of. To do this, I have added 2 dependecy sets: one to include all jars and place them in a lib directory, and one to unpack all my zips. I think I'm really close to a solution, but I have one problem, which is that all my classes are also included along the resources. It seems that the exclusion patterns donnot work with the second dependency set. Is there a way to get to what I would like, or is this simply not possible? Many thanks in advance Guillaume Polet My assembly descriptor for those four projects look like this: assembly idpackaging/id formats formatzip/format /formats includeBaseDirectoryfalse/includeBaseDirectory dependencySets dependencySet includes include*.jar/include /includes excludes exclude*.zip/exclude /excludes outputDirectorylib/outputDirectory /dependencySet dependencySet unpacktrue/unpack outputDirectory/outputDirectory includes include*.zip/include /includes excludes exclude*.jar/exclude /excludes unpackOptions excludes exclude*.class/exclude exclude**/*.class/exclude excludeMETA-INF/exclude /excludes /unpackOptions /dependencySet /dependencySets /assembly - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Assembling assemblies with exclude/include patterns
Ok, well, worry that I have bothered you because I found my issues since. Two stuffs were actually causing my problems: 1) My repository was somehow corrupted and there were two shared jars containing the same descriptor. The plugin was using an old one instead of the ones I was updating while trying to find a solution 2) the include/exclude patterns were incorrect and replacing *.jar by *:jar:* and *.zip by *:zip:* did the trick. This is a little bit confusing because the include/exclude patterns in the dependency sets are not the same as in filesets (which by the way is logical but the documentation does not really specify that they are different) I am just posting this so that if anyone run into the same issue, he can read the solution I have found. Guillaume Polet Guillaume Polet a écrit : Hello, I'm kind of new to the assembly plugin but I'm starting to get some stuff out of it. However there is one trick I couldn't get to work so far, so I'm looking for some help on this. Here is my situation: I have a bunch of projects which all produce a jar file (without any resources, just classes) and a zip file containing all the resources (no classes, no jars). This works smoothly and I'm very happy of the output they each produce. On addition to that, I have four projects that are various combination of the projects mentionned above. What I would like to do is to have them produce a zip file with the following structure: all the resources (located in the zip previously created) of the projects they depend of at the top of the zip file, and within a lib directory, all the jars they depend of. To do this, I have added 2 dependecy sets: one to include all jars and place them in a lib directory, and one to unpack all my zips. I think I'm really close to a solution, but I have one problem, which is that all my classes are also included along the resources. It seems that the exclusion patterns donnot work with the second dependency set. Is there a way to get to what I would like, or is this simply not possible? Many thanks in advance Guillaume Polet My assembly descriptor for those four projects look like this: assembly idpackaging/id formats formatzip/format /formats includeBaseDirectoryfalse/includeBaseDirectory dependencySets dependencySet includes include*.jar/include /includes excludes exclude*.zip/exclude /excludes outputDirectorylib/outputDirectory /dependencySet dependencySet unpacktrue/unpack outputDirectory/outputDirectory includes include*.zip/include /includes excludes exclude*.jar/exclude /excludes unpackOptions excludes exclude*.class/exclude exclude**/*.class/exclude excludeMETA-INF/exclude /excludes /unpackOptions /dependencySet /dependencySets /assembly - 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: plugin search?
Hi Stephen, I didn't see any rules that would help for this situation (http://maven.apache.org/enforcer/enforcer-rules/index.html). (without writing a custom rule) If some custom code needs to be written I would I think it would fit better with the versions-maven-plugin? /James -Original Message- From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] Sent: 05 June 2009 11:41 To: Maven Users List Subject: Re: plugin search? I think the enforcer plugin has rules to help. 2009/6/5 Martin Höller mar...@xss.co.at Hi! On Friday 05 June 2009 Nord, James wrote: Is there a plugin that anoyone knows that can analyse dependencies in a multi module project and then warn if you have a depenendency on the same artifact with a set version (ie not using dependencyManagement) in more than one project? Sounds like a job for the versions-maven-plugin [0]. I think the plugin already warns you if dependencyManagement is not used. Not sure about different versions. If it doesn't support you use case file an enhancement request in JIRA. Maybe Stephen Connolly can provide some more details. hth, - martin [0] http://mojo.codehaus.org/versions-maven-plugin/ ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Exception during Dependencies report.
I'm really confused as to why maven is all of a sudden looking at a jar and complaining it's not a pom - any suggestions anyone? [INFO] Generating Source Repository report. [INFO] Generating Issue Tracking report. [INFO] Generating Project Summary report. [INFO] Generating Project Plugins report. [INFO] Generating Dependencies report. [ERROR] ProjectBuildingException error : [WARNING] Unable to create Maven project from repository. org.apache.maven.project.InvalidProjectModelException: Not a v4.0.0 POM. for project package at E:\work\m2Repo\packagename\1.0.0.1\modulename-1.0.0.1.jar at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMav enProjectBuilder.java:1581) at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMav enProjectBuilder.java:1553) at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromReposit ory(DefaultMavenProjectBuilder.java:560) at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository( DefaultMavenProjectBuilder.java:249) at org.apache.maven.report.projectinfo.dependencies.RepositoryUtils.getMave nProjectFromRepository(RepositoryUtils.java:316) at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRe nderer.renderSectionDependencyRepositoryLocations(DependenciesRenderer.j ava:623) at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRe nderer.renderBody(DependenciesRenderer.java:274) at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMa venReportRenderer.java:65) at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(Dep endenciesReport.java:239) at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenRep ort.java:90) at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(Repo rtDocumentRenderer.java:139) at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(Def aultSiteRenderer.java:269) at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSi teRenderer.java:101) at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:129) at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:96) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa nager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default LifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec ycle(DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL ifecycleExecutor.java:478) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle Failures(DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments( DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec ycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Re: plugin search?
My answer is always that if you want to enforce something... use the enforcer. Once I get 1.0 out the door I will be splitting out one or two versions-api and versions-impl which will probably be added as dependencies of the enforcer-rules-impl so that we can share common code. In that respect I am not opposed to adding version-reporting stuff to the versions plugin... but perhaps this is a use case for the dependency plugin to have a report... We should socialize where such a mojo should live. I don't want the versions-maven-plugin to have too big a scope at the end of the day. -Stephen P.S. I suspect it will be somthing like versions-query-api and versions-change-api To allow enforcer to only depend on the querying code 2009/6/5 Nord, James jn...@nds.com Hi Stephen, I didn't see any rules that would help for this situation ( http://maven.apache.org/enforcer/enforcer-rules/index.html). (without writing a custom rule) If some custom code needs to be written I would I think it would fit better with the versions-maven-plugin? /James -Original Message- From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] Sent: 05 June 2009 11:41 To: Maven Users List Subject: Re: plugin search? I think the enforcer plugin has rules to help. 2009/6/5 Martin Höller mar...@xss.co.at Hi! On Friday 05 June 2009 Nord, James wrote: Is there a plugin that anoyone knows that can analyse dependencies in a multi module project and then warn if you have a depenendency on the same artifact with a set version (ie not using dependencyManagement) in more than one project? Sounds like a job for the versions-maven-plugin [0]. I think the plugin already warns you if dependencyManagement is not used. Not sure about different versions. If it doesn't support you use case file an enhancement request in JIRA. Maybe Stephen Connolly can provide some more details. hth, - martin [0] http://mojo.codehaus.org/versions-maven-plugin/ ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: package - should be simple but it ain't
We have declared all dependencies to be either all provided or all compile, either way they end up in the final jar when we issue mvn package. mvn clean package to clean up target which is polluted with deps from previous runs. In all likelihood, that will fix your issues. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: plugin search?
I didn't want to enforce it just be able to run mvn baddeps:analyze and have it tell me in a more obvious way than I can see at the Moment (and I'm talkin about non transitive dependencies). e.g mvn baddeps:analyze Project B,Project C both declare a dependency on com.foo.bar:bax:1.0.1 consider using dependecyManagement. *** Project D,Project E use incosistent versions of com.foo.bar:whizbang (1.0.1, 1.0.4) *** And if there was mvn baddeps:fix_it then all the better - but the first part is more important to me (being able to see it obviously) Anyway - at least my question is answered - doesn't seem like there is anything that can do this at the moment. /James My answer is always that if you want to enforce something... use the enforcer. Once I get 1.0 out the door I will be splitting out one or two versions-api and versions-impl which will probably be added as dependencies of the enforcer-rules-impl so that we can share common code. In that respect I am not opposed to adding version-reporting stuff to the versions plugin... but perhaps this is a use case for the dependency plugin to have a report... We should socialize where such a mojo should live. I don't want the versions-maven-plugin to have too big a scope at the end of the day. -Stephen P.S. I suspect it will be somthing like versions-query-api and versions-change-api To allow enforcer to only depend on the querying code 2009/6/5 Nord, James jn...@nds.com Hi Stephen, I didn't see any rules that would help for this situation ( http://maven.apache.org/enforcer/enforcer-rules/index.html). (without writing a custom rule) If some custom code needs to be written I would I think it would fit better with the versions-maven-plugin? /James -Original Message- From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] Sent: 05 June 2009 11:41 To: Maven Users List Subject: Re: plugin search? I think the enforcer plugin has rules to help. 2009/6/5 Martin Höller mar...@xss.co.at Hi! On Friday 05 June 2009 Nord, James wrote: Is there a plugin that anoyone knows that can analyse dependencies in a multi module project and then warn if you have a depenendency on the same artifact with a set version (ie not using dependencyManagement) in more than one project? Sounds like a job for the versions-maven-plugin [0]. I think the plugin already warns you if dependencyManagement is not used. Not sure about different versions. If it doesn't support you use case file an enhancement request in JIRA. Maybe Stephen Connolly can provide some more details. hth, - martin [0] http://mojo.codehaus.org/versions-maven-plugin/ ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: plugin search?
sounds like dependency:analyze should have some more heuristics 2009/6/5 Nord, James jn...@nds.com I didn't want to enforce it just be able to run mvn baddeps:analyze and have it tell me in a more obvious way than I can see at the Moment (and I'm talkin about non transitive dependencies). e.g mvn baddeps:analyze Project B,Project C both declare a dependency on com.foo.bar:bax:1.0.1 consider using dependecyManagement. *** Project D,Project E use incosistent versions of com.foo.bar:whizbang (1.0.1, 1.0.4) *** And if there was mvn baddeps:fix_it then all the better - but the first part is more important to me (being able to see it obviously) Anyway - at least my question is answered - doesn't seem like there is anything that can do this at the moment. /James My answer is always that if you want to enforce something... use the enforcer. Once I get 1.0 out the door I will be splitting out one or two versions-api and versions-impl which will probably be added as dependencies of the enforcer-rules-impl so that we can share common code. In that respect I am not opposed to adding version-reporting stuff to the versions plugin... but perhaps this is a use case for the dependency plugin to have a report... We should socialize where such a mojo should live. I don't want the versions-maven-plugin to have too big a scope at the end of the day. -Stephen P.S. I suspect it will be somthing like versions-query-api and versions-change-api To allow enforcer to only depend on the querying code 2009/6/5 Nord, James jn...@nds.com Hi Stephen, I didn't see any rules that would help for this situation ( http://maven.apache.org/enforcer/enforcer-rules/index.html). (without writing a custom rule) If some custom code needs to be written I would I think it would fit better with the versions-maven-plugin? /James -Original Message- From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] Sent: 05 June 2009 11:41 To: Maven Users List Subject: Re: plugin search? I think the enforcer plugin has rules to help. 2009/6/5 Martin Höller mar...@xss.co.at Hi! On Friday 05 June 2009 Nord, James wrote: Is there a plugin that anoyone knows that can analyse dependencies in a multi module project and then warn if you have a depenendency on the same artifact with a set version (ie not using dependencyManagement) in more than one project? Sounds like a job for the versions-maven-plugin [0]. I think the plugin already warns you if dependencyManagement is not used. Not sure about different versions. If it doesn't support you use case file an enhancement request in JIRA. Maybe Stephen Connolly can provide some more details. hth, - martin [0] http://mojo.codehaus.org/versions-maven-plugin/ ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Novice Q: Why Does My App Look in the Wrong Repository?
I set up a Maven environment as outlined here: http://docs.codehaus.org/display/MAVENUSER/Creating+the+repositories My problem is that mvn is trying to find dependencies in the repositories I created instead of in the central Maven repository. When I run mvn package on my app, I get this: Downloading: http://wicketstuff.org/maven/repository/org/apache/wicket/wicket-ex tensions/1.3.6/wicket-extensions-1.3.6.pom Downloading: http://{MY_REPO_SERVER}/maven2_repositories/inhouse/org /apache/wicket/wicket-extensions/1.3.6/wicket-extensions-1.3.6.pom 516b downloaded [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '688870b891 b8c1ecaafc4d50cd95a9ccb0e53921'; remote = '!DOCTYPE' - RETRYING Why is Maven looking for wicket-extensions-1.3.6.pom inside my server? Should it have found it over at http://wicketstuff.org/maven/repository/org/apache/wicket/wicket-ex tensions, which is where it lives? -- View this message in context: http://www.nabble.com/Novice-Q%3A-Why-Does-My-App-Look-in-the-Wrong-Repository--tp23892009p23892009.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: Exception during Dependencies report.
I tried upgrading to: groupIdorg.apache.maven.plugins/groupId artifactIdmaven-project-info-reports-plugin/artifactId version2.1.1/version But that's even worse - I can see it just scanning the repositories over and over and over - endlessly. Any suggestions? -Original Message- From: EJ Ciramella [mailto:ecirame...@upromise.com] Sent: Friday, June 05, 2009 10:36 AM To: users@maven.apache.org Subject: Exception during Dependencies report. I'm really confused as to why maven is all of a sudden looking at a jar and complaining it's not a pom - any suggestions anyone? [INFO] Generating Source Repository report. [INFO] Generating Issue Tracking report. [INFO] Generating Project Summary report. [INFO] Generating Project Plugins report. [INFO] Generating Dependencies report. [ERROR] ProjectBuildingException error : [WARNING] Unable to create Maven project from repository. org.apache.maven.project.InvalidProjectModelException: Not a v4.0.0 POM. for project package at E:\work\m2Repo\packagename\1.0.0.1\modulename-1.0.0.1.jar at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMav enProjectBuilder.java:1581) at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMav enProjectBuilder.java:1553) at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromReposit ory(DefaultMavenProjectBuilder.java:560) at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository( DefaultMavenProjectBuilder.java:249) at org.apache.maven.report.projectinfo.dependencies.RepositoryUtils.getMave nProjectFromRepository(RepositoryUtils.java:316) at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRe nderer.renderSectionDependencyRepositoryLocations(DependenciesRenderer.j ava:623) at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRe nderer.renderBody(DependenciesRenderer.java:274) at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMa venReportRenderer.java:65) at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(Dep endenciesReport.java:239) at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenRep ort.java:90) at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(Repo rtDocumentRenderer.java:139) at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(Def aultSiteRenderer.java:269) at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSi teRenderer.java:101) at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:129) at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:96) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa nager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default LifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec ycle(DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL ifecycleExecutor.java:478) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle Failures(DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments( DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec ycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: Does reactor spawn a subprocess for each submodule?
This sounds promising, but I can't seem to locate it. I found the snapshots repository for the versions plugin at http://snapshots.repository.codehaus.org/org/codehaus/mojo/versions-mave n-plugin/, but there are no beta snapshots listed. The codehaus mojo page for the versions plugin does not mention set. Where can I take a look at versions:set? Thanks ~ Tracy -Original Message- From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] Sent: Wednesday, June 03, 2009 12:47 PM To: Maven Users List Cc: Maven Users List Subject: Re: Does reactor spawn a subprocess for each submodule? have a look at versions:set in the latest 1.0-beta-1-SNAPSHOT Sent from my [rhymes with myPod] ;-) On 3 Jun 2009, at 18:51, Tracy Hartford tra...@zillow.com wrote: I explained the overall goal, in case there are alternative ways to get there that might be preferable to a forked execution. However, I can also explain why we are exploring a forked execution at this point. We are currently setting the version like this: version${env.MY_BUILD_VARIABLE}/version. Prior to building, we call a script that sets up the build environment, including assigning a value to MY_BUILD_VARIABLE, which gets its value from the top Perforce changenum. Because this variable is set once, the version of every POM in the multi-module system is set to this value. This does not allow us to distinguish whether a given module has had any changes (and thus needs to be rebuilt), so it results in a complete rebuild of the system. We are trying to make the build system more agile, such that we can skip building modules that have not had any changes since the last build. So, the sub-problem is how to assign a module-specific version to the POM via an environment variable? We are considering two approaches. The first is to create a unique environment variable for each submodule, set it prior to beginning the build, and set the POM version to pull from its specific environment variable. The second is to set one variable, but reassign its value prior to executing each submodule. This requires forked execution. We would prefer to use Maven to get the correct version. We have failed to identify a way to do so. One reason is that only text or variables are accepted inside a version/, not commands. Another reason is that you can't dynamically set the version because the values of POM properties are solidified prior to any plugins running, though it is not clear exactly when and how the solidification happens (Parsing? Validation phase?). If not for the properties solidifying, we could use a plugin to gather the version number, such as antrun. We can't use SCM:perforce or release to set the version, because the perforce implementation is buggy. Therefore, unless we want to manually hardcode every POM (which we don't), we concluded that we need to pull it from an environment variable. With forking, we would be able to update the value of the variable in a new process, and the goal would be invoked on the POM in the new process. -Original Message- From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] Sent: Tuesday, June 02, 2009 10:45 PM To: Maven Users List Subject: Re: Does reactor spawn a subprocess for each submodule? We are all still wondering _why_ you feel you need to do this forking? 2009/6/3 Tracy Hartford tra...@zillow.com I have spent some time looking into the invoker plugin, and according to the specs, it is primarily used for integration testing. My original question was whether it was possible, when invoking a maven goal on a parent POM, to force the reactor to spawn a new process for each of the submodule executions of that goal. How can I use the invoker to force the executions to fork? Assuming the invoker could be used to cause forked execution of the goal on the subprocesses, if I were to use a preBuildHookScript, would the execution of the script occur in the same process as the goal invocation, or would it be executed in its own process, then return to the parent process to proceed with the goal execution? Thanks ~ Tracy -Original Message- From: Brian Fox [mailto:bri...@infinity.nu] Sent: Sunday, May 24, 2009 5:51 AM To: Maven Users List Subject: Re: Does reactor spawn a subprocess for each submodule? It runs inside the same process. You can use the invoker to fork a maven process, but this is not usually done as you describe. Why do you want to fork a new process for each module? On Fri, May 22, 2009 at 6:43 PM, Tracy Hartford tra...@zillow.com wrote: I am working on a large multi-module project, and I need to know how the reactor works when I invoke a maven goal on the parent POM. I know that Maven adds all the submodule POMs into the Reactor, which analyzes the dependencies between them, and determines the build order. I understand that the Reactor then
Re: Does reactor spawn a subprocess for each submodule?
compile from source 2009/6/5 Tracy Hartford tra...@zillow.com This sounds promising, but I can't seem to locate it. I found the snapshots repository for the versions plugin at http://snapshots.repository.codehaus.org/org/codehaus/mojo/versions-mave n-plugin/http://snapshots.repository.codehaus.org/org/codehaus/mojo/versions-mave%0An-plugin/, but there are no beta snapshots listed. The codehaus mojo page for the versions plugin does not mention set. Where can I take a look at versions:set? Thanks ~ Tracy -Original Message- From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] Sent: Wednesday, June 03, 2009 12:47 PM To: Maven Users List Cc: Maven Users List Subject: Re: Does reactor spawn a subprocess for each submodule? have a look at versions:set in the latest 1.0-beta-1-SNAPSHOT Sent from my [rhymes with myPod] ;-) On 3 Jun 2009, at 18:51, Tracy Hartford tra...@zillow.com wrote: I explained the overall goal, in case there are alternative ways to get there that might be preferable to a forked execution. However, I can also explain why we are exploring a forked execution at this point. We are currently setting the version like this: version${env.MY_BUILD_VARIABLE}/version. Prior to building, we call a script that sets up the build environment, including assigning a value to MY_BUILD_VARIABLE, which gets its value from the top Perforce changenum. Because this variable is set once, the version of every POM in the multi-module system is set to this value. This does not allow us to distinguish whether a given module has had any changes (and thus needs to be rebuilt), so it results in a complete rebuild of the system. We are trying to make the build system more agile, such that we can skip building modules that have not had any changes since the last build. So, the sub-problem is how to assign a module-specific version to the POM via an environment variable? We are considering two approaches. The first is to create a unique environment variable for each submodule, set it prior to beginning the build, and set the POM version to pull from its specific environment variable. The second is to set one variable, but reassign its value prior to executing each submodule. This requires forked execution. We would prefer to use Maven to get the correct version. We have failed to identify a way to do so. One reason is that only text or variables are accepted inside a version/, not commands. Another reason is that you can't dynamically set the version because the values of POM properties are solidified prior to any plugins running, though it is not clear exactly when and how the solidification happens (Parsing? Validation phase?). If not for the properties solidifying, we could use a plugin to gather the version number, such as antrun. We can't use SCM:perforce or release to set the version, because the perforce implementation is buggy. Therefore, unless we want to manually hardcode every POM (which we don't), we concluded that we need to pull it from an environment variable. With forking, we would be able to update the value of the variable in a new process, and the goal would be invoked on the POM in the new process. -Original Message- From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] Sent: Tuesday, June 02, 2009 10:45 PM To: Maven Users List Subject: Re: Does reactor spawn a subprocess for each submodule? We are all still wondering _why_ you feel you need to do this forking? 2009/6/3 Tracy Hartford tra...@zillow.com I have spent some time looking into the invoker plugin, and according to the specs, it is primarily used for integration testing. My original question was whether it was possible, when invoking a maven goal on a parent POM, to force the reactor to spawn a new process for each of the submodule executions of that goal. How can I use the invoker to force the executions to fork? Assuming the invoker could be used to cause forked execution of the goal on the subprocesses, if I were to use a preBuildHookScript, would the execution of the script occur in the same process as the goal invocation, or would it be executed in its own process, then return to the parent process to proceed with the goal execution? Thanks ~ Tracy -Original Message- From: Brian Fox [mailto:bri...@infinity.nu] Sent: Sunday, May 24, 2009 5:51 AM To: Maven Users List Subject: Re: Does reactor spawn a subprocess for each submodule? It runs inside the same process. You can use the invoker to fork a maven process, but this is not usually done as you describe. Why do you want to fork a new process for each module? On Fri, May 22, 2009 at 6:43 PM, Tracy Hartford tra...@zillow.com wrote: I am working on a large multi-module project, and I need to know how the reactor
Super pom properties in child pom
Say I've got a super pom with a defined SCM section like so: scm connectionscm:git:git://server/repos/${artifactId}.git/connection /scm Well in the child pom, it's taking the super pom's name and appending / child pom's name. Like so: scm connectionscm:git:git://server/repos/Super/Child.git/connection /scm That's not what I wanted it to do, I need it to just have Child.git without the super/ stuff How do I ensure that happens? Thanks, David - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Super pom properties in child pom
On Fri, 05 Jun 2009 14:12:50 -0500, dkowis dko...@shlrm.org wrote: Say I've got a super pom with a defined SCM section like so: scm connectionscm:git:git://server/repos/${artifactId}.git/connection /scm Well in the child pom, it's taking the super pom's name and appending / child pom's name. Like so: scm connectionscm:git:git://server/repos/Super/Child.git/connection /scm That's not what I wanted it to do, I need it to just have Child.git without the super/ stuff How do I ensure that happens? Actually it's still stranger than that: I have a configured url in the scm section urlhttp://server/gitweb/gitweb.cgi/repos/${artifactId}/url This should show up in the generated site (when running mvn site) as: http://server/gitweb/gitweb.cgi/repos/Child But it's showing up as: http://server/gitweb/gitweb.cgi/repos/Child/Super/Child What is going on? I didn't specify anything else after the URL, why is appending things for me? Thanks, David - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
[ANN] Maven Assembly Plugin 2.2-beta-4 released
The Maven team is pleased to announce the release of the Maven Assembly Plugin, version 2.2-beta-4. This plugin is useful in creating project artifacts that custom layouts. It also includes a set of predefined standard custom artifact types you can choose to create. For more information, see: http://maven.apache.org/plugins/maven-assembly-plugin/ You should specify the version in your project's plugin configuration: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-assembly-plugin/artifactId version2.2-beta-4/version /plugin Release Notes - Maven 2.x Assembly Plugin - Version 2.2-beta-4 ** Bug * [MASSEMBLY-238] - Assembly plugin removes file permissions * [MASSEMBLY-379] - Follow-up: file permissions are removed when creating tar.gz assembly * [MASSEMBLY-413] - Assembly plugin uses absolute paths from project instance after interpolation * [MASSEMBLY-414] - Allow regular expressions in include/exclude patterns for filesets * [MASSEMBLY-416] - outputDirectory default value in fileSet seems changed; now seems to use directory name of fileSet sourcedir * [MASSEMBLY-417] - regex in/exclusion patterns can fail on Windows due to file-separator replacement. * [MASSEMBLY-418] - Broken link to assembly-1.1.0-SNAPSHOT.xsd * [MASSEMBLY-419] - All module directories are included with complete system path ** Improvement * [MASSEMBLY-421] - Maven repository layout like directory structure using dependencySet Enjoy, -The Maven team - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
[ANN] Maven Assembly Plugin 2.2-beta-4 released
The Maven team is pleased to announce the release of the Maven Assembly Plugin, version 2.2-beta-4. This plugin is useful in creating project artifacts that custom layouts. It also includes a set of predefined standard custom artifact types you can choose to create. For more information, see: http://maven.apache.org/plugins/maven-assembly-plugin/ You should specify the version in your project's plugin configuration: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-assembly-plugin/artifactId version2.2-beta-4/version /plugin Release Notes - Maven 2.x Assembly Plugin - Version 2.2-beta-4 ** Bug * [MASSEMBLY-238] - Assembly plugin removes file permissions * [MASSEMBLY-379] - Follow-up: file permissions are removed when creating tar.gz assembly * [MASSEMBLY-413] - Assembly plugin uses absolute paths from project instance after interpolation * [MASSEMBLY-414] - Allow regular expressions in include/exclude patterns for filesets * [MASSEMBLY-416] - outputDirectory default value in fileSet seems changed; now seems to use directory name of fileSet sourcedir * [MASSEMBLY-417] - regex in/exclusion patterns can fail on Windows due to file-separator replacement. * [MASSEMBLY-418] - Broken link to assembly-1.1.0-SNAPSHOT.xsd * [MASSEMBLY-419] - All module directories are included with complete system path ** Improvement * [MASSEMBLY-421] - Maven repository layout like directory structure using dependencySet Enjoy, -The Maven team -- John Casey Developer, PMC Member - Apache Maven (http://maven.apache.org) Blog: http://www.ejlife.net/blogs/buildchimp/ - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Just shoot me now and get it over with
I am working in a sort of bastardized Eclipse-maven world for months now. I have had for months a M2_REPO variable in Eclipse pointing to a local Maven repository. I know this is not the approved Maven way, but it has worked for me for months without difficulty. Now, without having made any upgrades to Maven, Eclipse, or anything else, my M2_REPO variable has disappeared and NOTHING I do allows me to put it back. Eclipse appears to allow me to add this variable, point it at the proper location, and apparently save it without complaint, yet when I look at my Eclipse variables immediately thereafter, the variable is gone. Without the variable present building my war does not include everything it needs, because it can't find all the jars it needs. What could possibly have happened to put me in this state? (Eclipse = Ganymede and I do have the M2Eclipse plugin installed). - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Just shoot me now and get it over with
Never mind - sort of. I exit Eclipse, start it back up and lo and behold there the variable is, working as it ever did. Bizarre Steve Cohen wrote: I am working in a sort of bastardized Eclipse-maven world for months now. I have had for months a M2_REPO variable in Eclipse pointing to a local Maven repository. I know this is not the approved Maven way, but it has worked for me for months without difficulty. Now, without having made any upgrades to Maven, Eclipse, or anything else, my M2_REPO variable has disappeared and NOTHING I do allows me to put it back. Eclipse appears to allow me to add this variable, point it at the proper location, and apparently save it without complaint, yet when I look at my Eclipse variables immediately thereafter, the variable is gone. Without the variable present building my war does not include everything it needs, because it can't find all the jars it needs. What could possibly have happened to put me in this state? (Eclipse = Ganymede and I do have the M2Eclipse plugin installed). - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
strange err during release:prepare
Hello All We are having trouble running mvn release:prepare on a multimodule projects The end result is maven aborting the release with its usually helpful error message about a missing artifact. The -DdryRun=true option passes of course. This module is set up like all of the others which have no problems from what I can tell. The one thing that I did notice is a slight difference in the maven output as shown below. Notice there is no ignoring artifact version message for the module with the problem, so my question is what would cause this slight difference to appear in the output.We are using maven 2.0.9. [INFO] Updating FeeManagementContainer to 4.15.1 [INFO] Ignoring artifact version update for expression: ${project.version} [INFO] Updating CloseAccountWorkflow to 4.15.1 [INFO] Ignoring artifact version update for expression: ${project.version} [INFO] Updating WorkflowUIContainer to 4.15.1 [INFO] Updating CancelWithholdFeesContainer to 4.15.1 [INFO] Ignoring artifact version update for expression: ${project.version} Any/all help appreciated as this has us stumped. Regards, Gord - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org