Control transitive dependencies
Hi, We have a multi module project: parent - pom, dependencyManagement proj1 - jar proj2 - jar proj3 - war Although we use log4j 1.2.14, our proj3.war file contains log4j 1.2.12 which probably added by maven as transitive dependency of one of our dependencies (activemq-parent-4.1.1.pom or commons-logging-1.1.pom). How can I force maven to package only log4j 1.2.14? Thanks, Erez. -- View this message in context: http://www.nabble.com/Control-transitive-dependencies-tf4330206s177.html#a12332508 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Control transitive dependencies
There are a few ways. mvn -X will give you debug output On 8/25/07, EN [EMAIL PROTECTED] wrote: Hi, We have a multi module project: parent - pom, dependencyManagement proj1 - jar proj2 - jar proj3 - war Although we use log4j 1.2.14, our proj3.war file contains log4j 1.2.12 which probably added by maven as transitive dependency of one of our dependencies (activemq-parent-4.1.1.pom or commons-logging-1.1.pom). How can I force maven to package only log4j 1.2.14? Thanks, Erez. -- View this message in context: http://www.nabble.com/Control-transitive-dependencies-tf4330206s177.html#a12332508 Sent from the Maven - Users mailing list archive at Nabble.com. - 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: Control transitive dependencies
There are a few ways: mvn -X will give you the debug output and will show the transitive that are brought in by the main dependencies, though I found this to be a bit tricky to use...my preferred way is too find the jars in my project(s) that mvn bundles a pom.xml in...if you look ar the pom.xmls in these jars you will find the dependencies they are bringing inyou then need to declare the jar as a dependency in the pom.xml in the particular artifact you want this excluded in and add excludesexcludes...place only groupId and artifactId inside here.../exclude/excludes inside the dependency declaration or you can add the tag in the jar plugin config that excludes the pom.xml if you have control over the build...then you dont have to worry about this stuff On 8/25/07, Larry Suto [EMAIL PROTECTED] wrote: There are a few ways. mvn -X will give you debug output On 8/25/07, EN [EMAIL PROTECTED] wrote: Hi, We have a multi module project: parent - pom, dependencyManagement proj1 - jar proj2 - jar proj3 - war Although we use log4j 1.2.14, our proj3.war file contains log4j 1.2.12 which probably added by maven as transitive dependency of one of our dependencies (activemq-parent-4.1.1.pom or commons-logging-1.1.pom). How can I force maven to package only log4j 1.2.14? Thanks, Erez. -- View this message in context: http://www.nabble.com/Control-transitive-dependencies-tf4330206s177.html#a12332508 Sent from the Maven - Users mailing list archive at Nabble.com. - 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: Control transitive dependencies
Thanks Larry for the prompt and detailed reply. The strange thing is that maven debug info (and the dependencies reports) shows only the dependency on 1.2.14, it does not list who uses 1.2.12 (I figured it out by searching the poms in my local repository). Anyway, I'll give it a try. Thanks, Erez. BTW, this is on maven 2.0.7 Larry Suto wrote: There are a few ways: mvn -X will give you the debug output and will show the transitive that are brought in by the main dependencies, though I found this to be a bit tricky to use...my preferred way is too find the jars in my project(s) that mvn bundles a pom.xml in...if you look ar the pom.xmls in these jars you will find the dependencies they are bringing inyou then need to declare the jar as a dependency in the pom.xml in the particular artifact you want this excluded in and add excludesexcludes...place only groupId and artifactId inside here.../exclude/excludes inside the dependency declaration or you can add the tag in the jar plugin config that excludes the pom.xml if you have control over the build...then you dont have to worry about this stuff On 8/25/07, Larry Suto [EMAIL PROTECTED] wrote: There are a few ways. mvn -X will give you debug output On 8/25/07, EN [EMAIL PROTECTED] wrote: Hi, We have a multi module project: parent - pom, dependencyManagement proj1 - jar proj2 - jar proj3 - war Although we use log4j 1.2.14, our proj3.war file contains log4j 1.2.12 which probably added by maven as transitive dependency of one of our dependencies (activemq-parent-4.1.1.pom or commons-logging-1.1.pom). How can I force maven to package only log4j 1.2.14? Thanks, Erez. -- View this message in context: http://www.nabble.com/Control-transitive-dependencies-tf4330206s177.html#a12332508 Sent from the Maven - Users mailing list archive at Nabble.com. - 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: How to create a project having more than one module
Hi, Rashid Jilani wrote: Hi: Can some one tell from where to start in order to build a project with more than one module; I am sorry but Maven documentation is quite confusing at least for beginners. 1. Do I need to start with archetype; if this is true how to pass parameters to archetype to create more than one module project. There's no archetype to generate a general multi-module project. You can use the MyFaces archetype specifically to create a JSF component library project (multi-module). See http://wiki.apache.org/myfaces/MyFaces_Archetypes_for_Maven 2. Or should I go and hand code a pom.xml file and then create the directory structure manually? Or, you could try out what this guy did to setup a J2EE project, which also has multiple modules. http://scriptlandia.blogspot.com/2006/05/how-to-make-javaee-project-with-maven2.html Thanks, Rashid. HTH, Deng - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: release:prepare must be runned twice?
Ok. Thanks everybody. Now, I have two mor infos: 1) The guy responsible for release:prepare is not the same for release:perform. That's why I use to add those temp files to SCM. 2) The problem I mentioned before happens in my Mac OS X, but not in Ubuntu. A bug, maybe? thanks. On 8/21/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Why would you check in release.properties? AFAIK, it is a more common use case to let your SCM ignore the release.properties. I guess your release:prepare would run smooth. Hth, Nick Stolwijk -Original Message- From: Alexandre Gomes [mailto:[EMAIL PROTECTED] Sent: Tue 8/21/2007 1:53 PM To: users@maven.apache.org Subject: release:prepare must be runned twice? Hi everybody. Is that a must to run release:prepare twice to have a release prepared under CVS? Look the sequence below. With CVS, the problem in step 5 always happens but not in SVN. Well, I think release:prepare always changes the release.properties file. So, why isn't the plugin smart enough to know it and just commit by itself, without the error? 1) First, I commit everything: cvs commit 2) Then, I run mvn release:clean 3) Run mvn release:prepare 4) Inform release version, release tag and next development version: (...) [INFO] Checking dependencies and plugins for snapshots ... What is the release version for SEAUP? (br.com.seatecnologia:seaup) 2.0.18: : What is SCM release tag or label for SEAUP? (br.com.seatecnologia:seaup) seaup-2_0_18: : What is the new development version for SEAUP? (br.com.seatecnologia:seaup) 2.0.19-SNAPSHOT: : [INFO] Transforming 'SEAUP'... (...) 5) Then, I get an error: [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] Unable to tag SCM Provider message: The cvs tag command failed. Command output: cvs tag: release.properties is locally modified cvs [tag aborted]: correct the above errors first! 6) I re-commit everything cvs commit (release.properties is commited) 7) I re-run mvn release:prepare 8) Now, the release is prepared. thanks, Alexandre - 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]
Newbie question: including a jar in maven
Hello, I'm new to maven I wanted to include the hibernate jar so I can import classes like: import org.springframework.orm.hibernate3.HibernateCallback; I know I have to add something to the pom.xml files, but I'm not sure what. Is it the hibernate plugin for maven? Can someone point me in the right direction? -- View this message in context: http://www.nabble.com/Newbie-question%3A-including-a-jar-in-maven-tf4331215s177.html#a12335154 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie question: including a jar in maven
Arrowx7 wrote: Hello, I'm new to maven I wanted to include the hibernate jar so I can import classes like: import org.springframework.orm.hibernate3.HibernateCallback; I know I have to add something to the pom.xml files, but I'm not sure what. Is it the hibernate plugin for maven? Can someone point me in the right direction? You need to add a dependency on hibernate in your pom.xml. More info available here: http://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies -- Dennis Lundberg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Specifying the jar name in profiles
Thanks Tim, that does work when packaging the jar. Now I realize that I also need the name to stay when I am running install. Is this an option? -Ben Tim Kettler wrote: Hi, you can use build/finalName/ for this. -Tim drippy schrieb: I have two profiles that I am using. I'm trying to figure out if there is a way to make it so that when I package up a jar file I can specify the name of the jar file so that it is identifiable for that profile. TIA, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Specifying-the-jar-name-in-profiles-tf4325808s177.html#a12335958 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem when generating one-to-many associations wiht xd2 mvn2 plugin
hi all, i am using xd2 mvn2 plugin to generate xdoclet files... but it looks like it is falling short when i am using associations.. here is the class that is failing... code: package com.mm.backend.model; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; /** * @hibernate.class table=ENTRYTYPES * @hibernate.discriminator column=discriminator * */ public class AbstractEntryType { protected String description; protected Long id; protected String discriminator; protected Integer version; protected List entries = new ArrayList(); /** * @hibernate.property * @return entry type description */ public String getDescription() { // TODO Auto-generated method stub return description; } /** * @hibernate.property column=discriminator * insert=false * update=false */ public String getDiscriminator() { return discriminator; } /** * @hibernate.id column=id * generator-class=increment * unsaved-value=-1 */ public Long getId() { // TODO Auto-generated method stub return id; } /** * @hibernate.version * unsaved-value=null * @return */ public Integer getVersion() { return version; } public void setDescription(String description) { // TODO Auto-generated method stub this.description = description; } public void setDiscriminator(String discriminator) { this.discriminator = discriminator; } public void setId(Long id) { this.id = id; } public void setVersion(Integer version) { this.version = version; } /** * @hibernate.list cascade=save-update * @hibernate.collection-one-to-many class= com.mm.backend.model.AbstractBudgetEntry * @hibernate.collection-key column=FK_ENTRY_ID * @return */ public List getEntries() { return entries; } public void setEntries(List entries) { this.entries = entries; } /** common methods ***/ public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof AbstractEntryType)) return false; final AbstractEntryType item = (AbstractEntryType) o; if (! (id == item.getId()) ) return false; return true; } public int hashCode() { int result; result = 29 * description.hashCode() + id.intValue() + version.hashCode(); return result; } public String toString() { return id (' + getId() + '), + Desc: ' + getDescription(); } public int compareTo(Object o) { if (o instanceof AbstractEntryType) { // Don't compare Date objects! Use the time in milliseconds! return String.valueOf(id).compareTo( String.valueOf( ((AbstractEntryType)o).getId())); } return 0; } } and here's the hbm.xml file that gets generated hibernate-mapping − class table=ENTRYTYPES name=com.mm.backend.model.AbstractEntryType − id unsaved-value=-1 name=id column=id generator class=increment/ /id discriminator column=discriminator/ version unsaved-value=null name=version/ property name=description/ property name=discriminator column=discriminator update=false insert=false/ − list cascade=save-update name=entries key/ /list subclass name=com.mm.backend.model.ExpenseType discriminator-value=Expense/ subclass name=com.mm.backend.model.SavingsType discriminator-value=Savings/ /class /hibernate-mapping somehow the key is not getting populated... so in the output i got this : [INFO] XDoclet plugin failed: Line: 15 Column: 12 Message: The content of element type list is incomplete, it must match (me ta*,subselect?,cache?,synchronize*,comment?,key,(index|list-index),(element|one- to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-upda te?,sql-delete?,sql-delete-all?,filter*). [INFO] [DEBUG] Trace org.apache.maven.lifecycle.LifecycleExecutionException: XDoclet plugin failed: Line: 15 Column: 12 Message: The content of element type list is incomplete, it must match (me ta*,subselect?,cache?,synchronize*,comment?,key,(index|list-index),(element|one- to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-upda te?,sql-delete?,sql-delete-all?,filter*). at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:564) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle( DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
Re: Specifying the jar name in profiles
No, this is not possible (with the finalName/ tag). The repository is a structured storage for maven artifacts and the directory hierarchy and filename conventions are well defined. Every artifact in the repository has to adhere to this conventions else maven will not be able to retrieve the artifacts. However, there is a simple solution (and I don't know why I didn't thought at it in the first place): Maven has the concept of classifiers to discriminate between different flavours of the same artifact. This is used for things like providing artifacts for different JDK versions or installing the javadoc and source archives alongsite the main artifact. As classifiers are part of the identity of a dependency, they are preserved in the repository. To cut a long story short, this pom should do what you want: project modelVersion4.0.0/modelVersion groupIdmygroup/groupId artifactIdmyartifact/artifactId version0.1-SNAPSHOT/version profiles profile idprofileA/id build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-jar-plugin/artifactId configuration classifierprofilea/classifier /configuration /plugin /plugins /build /profile profile idprofileB/id build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-jar-plugin/artifactId configuration classifierprofileb/classifier /configuration /plugin /plugins /build /profile /profiles /project -Tim drippy schrieb: Thanks Tim, that does work when packaging the jar. Now I realize that I also need the name to stay when I am running install. Is this an option? -Ben Tim Kettler wrote: Hi, you can use build/finalName/ for this. -Tim drippy schrieb: I have two profiles that I am using. I'm trying to figure out if there is a way to make it so that when I package up a jar file I can specify the name of the jar file so that it is identifiable for that profile. TIA, Ben - 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: WTP, Eclipse, and Maven with APP-INF/lib
Josh Long on 24/08/07 09:36, wrote: Hello I have an ear which in turn has dependencies that need to be furnished to all sub projects (a few EJBs, a few WARs). The maven build itself is configured to do the right thing and, in the resulting .ear, yeilds an APP-INF/lib director with all non ejb/war/car dependencies. I can even run mvn eclipse:eclipse with the wtp support and get a pretty useful setup inside of eclipse. I also setup maven to not generate -SNAPSHOT-1.0.jar on the artifacts, which makes the application.xml something we can keep in source. This in turn makes eclipse happy because it can let us use the WTP facilities for an EAR. However, when we take the ear project and add it to a server (JBoss), and then publish that eclipse project, eclipse builds an ear (amazingly !) that works just like if mvn had built it EXCEPT for /APP-INF/lib/*jar at the root of the ear project. Apparently this has something to do with the EAR Libraries library, but I'm unsure of how to accomodate this. Plus, it ideally should be correctly configured by the mavne plugin. Does anyone have any way around this? A custom mojo I might bind to the eclipse:eclipse phase? Insight on how this would be configured in the low level eclipse .settings stufff? Anything at all would be appreciated. Hi Josh, have you checked out the eclipse newsgroups at http://www.eclipse.org/newsgroups/ ? Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Maven insist to fetch sibling module from repository
No, I sub-module and the parent module does have any assembly defined. Btw, I tried to create sample project with empty source, but just hold the parent + sub-module-a and sub-module-b, the problem still exists. If you can create a simple reproducable project then attach it as a JIRA issue and link it here. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Activating a Profile from another Profile
Thanks Tim, I hadn't considered activating a profile using multiple properties. If it were possible, then I think it might work. But activation property namedev/name nameprod/name /property /activation Is not valid syntax for the POM schema http://maven.apache.org/maven-v4_0_0.xsd William -Original Message- From: Tim Kettler [mailto:[EMAIL PROTECTED] Sent: Friday, 24 August 2007 3:24 PM To: Maven Users List Subject: [***POSSIBLE SPAM***] - Re: Activating a Profile from another Profile - Email has different SMTP TO: and MIME TO: fields in the email addresses Hi, No, this is currently not possible directly. However, what you can do is activate the set of profile via a system property you specify on the commandline ('mvn -Ddev ...'): profiles profile iddev/id activation property namedev/name /property /activation ... /profile profile idprod/id activation property nameprod/name /property /activation ... /profile profile idcommon/id activation property namedev/name nameprod/name /property /activation ... /profile /profiles -Tim William Ferguson schrieb: Is there any way to activatee a Profile from another Profile? We have some pieces of the build, specifcally build.resources definitions that vary depending on which Profile is targetted. But some of the resource definitions are identical for several of the Profiles. So I had hoped to extract the common resource definitions into their own Profile which was then activated by the target Profiles. Hopefully that makes sense :-) It seems this has been asked before without any +ve answer. http://mail-archives.apache.org/mod_mbox/maven-users/200702.mbox/%3Ce7 52 [EMAIL PROTECTED] But maybe the question was just overlooked. Then again, perhaps there is a better way to come at this, in which case I'm all ears. William - 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: Accessing POM properties in a filter
Ah, but the filters file *is* filtered. At least for Java System properties and for other filter tokens, and (because of the order that the filtering mechanism is implemented) also for values of simple POM elements (but not POM properties as they are complex). In order to allow replacement of POM porperties to filter files in the same way as the others are replaced I have rasied the following JIRA and supplied a patch. http://jira.codehaus.org/browse/MRESOURCES-47 Its true, I could insert the POM properties directly into the resource files. But many of the tokens are compounded from one or more POM properties to produce understandable tokens instead of fragments. So it would either require many more properties to be added to each profile in my POM with much duplication between each profile, or it would require the use of many non-intuitive tokens fragments in the resource files. William -Original Message- From: Tim Kettler [mailto:[EMAIL PROTECTED] Sent: Friday, 24 August 2007 3:17 PM To: Maven Users List Subject: [***POSSIBLE SPAM***] - Re: [***POSSIBLE SPAM***] - Re: Accessing POM properties in a filter - Email has different SMTP TO: and MIME TO: fields in the email addresses - Email has different SMTP TO: and MIME TO: fields in the email addresses Hi, The probem is that for this to work the filters file would need to be filtered too, which is not the case. Use your declared properties directly in the resource files you want filtered and don't do the extra indirection via the filters file. -Tim William Ferguson schrieb: ${myProp1} doesn't work either. With a POM declaring myProp1Somevalue/myprop1 A filter.file of some.token=${myProp1} And a resource file with Show.me.the.value.of.some.token=${some.token} The resource file resolves to : Show.me.the.value.of.some.token=${myProp1} Instead of Show.me.the.value.of.some.token=SomeValue William -Original Message- From: Eric Redmond [mailto:[EMAIL PROTECTED] Sent: Friday, 24 August 2007 12:36 PM To: Maven Users List Subject: [***POSSIBLE SPAM***] - Re: Accessing POM properties in a filter - Email has different SMTP TO: and MIME TO: fields in the email addresses Why can't you just use ${myProp1} ? Why go through the trouble of refering via project.properties? -- Eric Redmond http://blog.propellors.net On 8/23/07, William Ferguson [EMAIL PROTECTED] wrote: In a resource filter, I can specify tokens like: token1=${project.version} token2=${project.properties} Which when used in a resource file evaluates to: valueForToken1=1.0-SNAPSHOT valueForToken2={myProp1=value1, myProp2=value2} How do I specify a token in the resource filter that resolves to the value of myProp1? I've tried all variants (that I can think of) of ${project.properties.myProp1}. I'm sure there's a way, but I can't find documentation spelling out the syntax that is required. William - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Maven insist to fetch sibling module from repository
On 8/27/07, Barrie Treloar [EMAIL PROTECTED] wrote: No, I sub-module and the parent module does have any assembly defined. Btw, I tried to create sample project with empty source, but just hold the parent + sub-module-a and sub-module-b, the problem still exists. If you can create a simple reproducable project then attach it as a JIRA issue and link it here. http://jira.codehaus.org/browse/MNG-3166 Yes, re-producible project example attached. Best regards, Zarick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]