Re: enforcer plugin rules to prevent circular dependencies
Thanks for the detailed reply Philip, Comments inline On Sat, Mar 26, 2011 at 3:43 AM, Phillip Hellewell ssh...@gmail.com wrote: On Fri, Mar 25, 2011 at 8:45 AM, Wendy Smoak wsm...@gmail.com wrote: On Fri, Mar 25, 2011 at 5:55 AM, Caoilte O'Connor caoi...@gmail.com wrote: Hi, I've just discovered the enforcer plugin and would like to use it to reduce our dependency conflicts but a bigger problem for us when it does turn up are circular dependencies. The Dependency Tree plugin spots these, but does anyone have any rules for the enforcer plugin to fail the build if it occurs? I wrote a plugin to do it. It uses org.apache.maven.shared.dependency.tree.DependencyTreeBuilder to get the list of DependencyNode. Then it cycles through each one calling getArtifact() and compares it to see if it is the same as the main project's Artifact (same group id and artifact id). In other words, if any of my dependencies are myself, then it throws an exception. Were you able to release this anywhere or is it something I could re-develop easily enough with the DependencyTreeBuilder. In what situation does the build get far enough to use a plugin to detect this? I thought Maven would just stop with an error if it encountered a cycle. I have heard that it will catch a cycle in a reactor build, but otherwise no, it won't catch it. That's why I submitted this bug a couple months ago: http://jira.codehaus.org/browse/MNG-4999 I don't think it is really possible to introduce a cycle when using releases, but it is definitely possible with snapshots (just follow the steps in the bug). I think we were able to introduce this bug by having Version 2 of Project A depending on version 1 of Project B which depends on version 1 of Project A. Regards Caoilte
enforcer plugin rules to prevent circular dependencies
Hi, I've just discovered the enforcer plugin and would like to use it to reduce our dependency conflicts but a bigger problem for us when it does turn up are circular dependencies. The Dependency Tree plugin spots these, but does anyone have any rules for the enforcer plugin to fail the build if it occurs? Thanks Caoilte
Re: resources are not aggregated from parent to child pom
Hi Ron, That's a very noble sentiment. Thanks. I think it would help if Best Practices were codified. I'm quite prepared to believe that there is a cogent and reasoned position for why some parts of the pom are merged and others not but like Marshall I am not familiar with it. Regards Caoilte On Mon, Oct 4, 2010 at 1:03 PM, Ron Wheeler rwhee...@artifact-software.com wrote: Maven is almost always right. Figure out why your methodology is not following Best Practices and change the way that you work so that maven does it for you automatically. You can fight Maven as much as you want but it will always win. If you can identify why you are building an application that is so unusual that no one else has your workflow, then you may be able to get a solution. In most cases, the application is pretty normal, it is the newbee's workflow that is broken. If you are pioneering some new application platform, you may have a problem but I think that I have seen ejbs with dependent libraries being used in applications before. Mavenize your workflow. I hope that this helps. Ron On 04/10/2010 6:49 AM, Caoilte O'Connor wrote: It bites in quite a lot of places. I wanted to define one execution of the build-helper-maven-plugin in a parent pom and another in one of it's children then have the two merged together. However, Maven overrode the parent configuration in the child. Given that some sections of the pom (eg dependencies, properties) merge so seamlessly it is disappointing to discover sections which don't. Perhaps future versions of Maven will improve things. c On Sat, Oct 2, 2010 at 3:41 PM, Marshall Schorm...@schor.com wrote: On 10/2/2010 7:42 AM, Benjamin Bentmann wrote: Xavier D. wrote: My pom structure is: pom.xml has a parent: parent-pom.xml. Both have aresources section to include files. The (child) pom.xml is executed directly and has the effect of only copying the child's resources. Commenting out this resource section, results in the parent's resources being copied. This is expected behavior,resources given in a child POM are not merged withresources in the parent but completely override those. I'm curious as to why this design decision was taken, versus an approach which allows merging, or perhaps some kind of user (pom - specified) choice. I was bitten by this also. -Marshall Schor Benjamin - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: resources are not aggregated from parent to child pom
It bites in quite a lot of places. I wanted to define one execution of the build-helper-maven-plugin in a parent pom and another in one of it's children then have the two merged together. However, Maven overrode the parent configuration in the child. Given that some sections of the pom (eg dependencies, properties) merge so seamlessly it is disappointing to discover sections which don't. Perhaps future versions of Maven will improve things. c On Sat, Oct 2, 2010 at 3:41 PM, Marshall Schor m...@schor.com wrote: On 10/2/2010 7:42 AM, Benjamin Bentmann wrote: Xavier D. wrote: My pom structure is: pom.xml has a parent: parent-pom.xml. Both have aresources section to include files. The (child) pom.xml is executed directly and has the effect of only copying the child's resources. Commenting out this resource section, results in the parent's resources being copied. This is expected behavior, resources given in a child POM are not merged with resources in the parent but completely override those. I'm curious as to why this design decision was taken, versus an approach which allows merging, or perhaps some kind of user (pom - specified) choice. I was bitten by this also. -Marshall Schor Benjamin - 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 - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
maven plugin for jasperreports?
Hi, Does anyone know of a maven plugin for compiling jasperreports files? ie, foo.jrxml - foo.jasper I think it's something I'd like to incorporate into our build stage. c - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Has anyone got annotations (Hibernate3) to work?
I've been reading up on it from Carlos Sanchez's weblog http://www.jroller.com/page/carlossg/20050420 and I've got all the dependencies sorted but (and I've never used annotations before) when I try to compile with Maven it chokes on every annotation saying that it doesn't recognise the class @Entity or whatever (rather like I would have expected it to with jdk1.4). Has anyone got it to work? Could I be forgetting something fundamental? c - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problems with xdoc and xalan
Thanks. I will do that. c On Monday 21 March 2005 21:22, Arnaud HERITIER wrote: This is certainly the same bug as : http://jira.codehaus.org/browse/MPPDF-16 You must contact the scarab team to replace the ant:style task. They can use the diff attached to this issue to see what they should do. Cheers. Arnaud -Message d'origine- De : Kenney Westerhof [mailto:[EMAIL PROTECTED] Envoyé : lundi 21 mars 2005 17:48 À : Maven Users List Objet : Re: problems with xdoc and xalan On Mon, 21 Mar 2005, Caoilte O'Connor wrote: Argh, I need to learn how to read better :) I think the problem is that you're using jdl 1.5. I've had a lot of trouble myself getting my old projects (using xalan/xerces) to work using jdk 1.5. In jdk 1.4, xerces and xalan are embedded in the jdk. In jdk 1.5 too, but the packages are under com/sun (so com.sun.org.apache). The original TransformerFactoryImpl seems to have disappeared, but I could find this one: com.sun.org.apache.xalan.internal.xsltc.trax.Transforme rFactoryImpl Maybe that works using -D. I currently use jdk 1.4, and the -D option works there. But according to your log output (hence my 'argh!' above) the property was already set correctly. So I guess the only solution left is either hack the jelly script to use another transformer (if -D doesn't work) or go back to jdk 1.4. Greetings, Kenney Westerhof On Monday 21 March 2005 15:32, Kenney Westerhof wrote: You need to set the transformerfactory property before running ant:style. Execute the following jelly script before you call ant:style: ${systemScope.setProperty( 'javax.xml.transform.TransformerFactory', 'org.apache.xalan.processor.TransformerFactoryImpl' )} You can do this as a preGoal to xdoc:transform in maven.xml. Alternatively you can specify the property using -D on the commandline, but I wouldn't recommend that - where would you document it? Hi, It's not my project so I would rather just use the -D property and email the devs about your maven.xml suggest. How would I set the property correctly? I tried, maven xdoc:transform -Djavax.xml.transform.TransformerFactory=org.apache.xal an.processor.Tr ansformerFactoryImpl but obviously I'm not understanding something because that didn't work. c Hi, I'm just starting out with a mavenized project (scarab). I'm familiar with Maven and was just trying to generate documentation (xdoc:transform) but got a pretty nasty error straight off the bat. I'm thinking my JDK setup (Sun 1.5.0) is probably wrong (or possibly my debian/sid ant: 1.6.2) any pointers? I thing I need to replace a xalan.jar file somewhere, but I'm not sure where or how (shouldn't maven handle this?) c maven xdoc:transform generates :- xdoc:init: [style] Transforming into /home/caoilte/work/java/scarab/scarab/target/gene rated- xdocs [style] Processing /home/caoilte/work/java/scarab/scarab/xdocs/scara b_prop erties.xml to /home/caoilte/work/java/scarab/scarab/target/gene rated- xdocs/scarab_properties.xml [style] Loading stylesheet /home/caoilte/work/java/scarab/scarab/xdocs/prope rties. xsl BUILD FAILED File.. /home/caoilte/work/java/scarab/scarab/maven.xml Element... Line.. 573 Column 76 Provider org.apache.xalan.processor.TransformerFactoryImpl not found Total time: 5 seconds Finished at: Mon Mar 21 12:57:41 GMT 2005 - -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kenney Westerhof http://www.neonics.com GPG public key: http://www.gods.nl/~forge/kenneyw.key --- -- 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] -- Kenney Westerhof http://www.neonics.com GPG public key: http://www.gods.nl/~forge/kenneyw.key --- -- 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
Re: Inherit problems
Hi, The problem most likely is a bug in the plugin. I based a multi-project maven build on appfuse in the same fashion and my dependencies inherit fine, but I only use the standard maven build process to compile. It wouldn't surprise me if the ant plugin gets confused about the classpath in a multiproject scenario, that's a notoriously buggy part of maven. That said I'm not entirely sure what the advantage of using the ant plugin is anyway (for anything requring classpaths anyway). What are you trying to do? Perhaps there is a better, more Mavenized, way . c On Tuesday 22 March 2005 14:50, [EMAIL PROTECTED] wrote: Hi all, inspired by the maven magic tutorial i've started to integrate a simple multiproject in maven. My project has the following structure: root | --- project.xml (Master | definition Template) | -- MainProject | || || project.xml (MainProject Descriptor) || maven.xml || (Reactor) || || src | | _ SubProject 1 (Same | structure as MainProject) Both projects inhered in their descriptor-files the master definition template on top. All works fine, when i use the reactor the project is build like it should be. Now i try to inherid some dependencies from the master definition template, because this definition should be global for each project. But this fails... My ant-Plugin which uses one of these dependencies will not work, because the jar classes are not found ... When i set the same dependency in the descriptors of both projects explicit, all works fine... I've got the same problem by setting maven members in the template, i must reset it in every descriptor ... Is it inpossible to inherid dependencies by this way? I think it's not realy elegant to set the basic dependencies again and again ... Thanks for any help or hint, Christian BG-PHOENICS GMBH IT-EW / DS Thurnithistr.16 30519 Hannover Telefon: 0511-987-1248 mailto: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problems with xdoc and xalan
Hi, I'm just starting out with a mavenized project (scarab). I'm familiar with Maven and was just trying to generate documentation (xdoc:transform) but got a pretty nasty error straight off the bat. I'm thinking my JDK setup (Sun 1.5.0) is probably wrong (or possibly my debian/sid ant: 1.6.2) any pointers? I thing I need to replace a xalan.jar file somewhere, but I'm not sure where or how (shouldn't maven handle this?) c maven xdoc:transform generates :- xdoc:init: [style] Transforming into /home/caoilte/work/java/scarab/scarab/target/generated-xdocs [style] Processing /home/caoilte/work/java/scarab/scarab/xdocs/scarab_properties.xml to /home/caoilte/work/java/scarab/scarab/target/generated-xdocs/scarab_properties.xml [style] Loading stylesheet /home/caoilte/work/java/scarab/scarab/xdocs/properties.xsl BUILD FAILED File.. /home/caoilte/work/java/scarab/scarab/maven.xml Element... ant:style Line.. 573 Column 76 Provider org.apache.xalan.processor.TransformerFactoryImpl not found Total time: 5 seconds Finished at: Mon Mar 21 12:57:41 GMT 2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problems with xdoc and xalan
On Monday 21 March 2005 15:32, Kenney Westerhof wrote: You need to set the transformerfactory property before running ant:style. Execute the following jelly script before you call ant:style: ${systemScope.setProperty( 'javax.xml.transform.TransformerFactory', 'org.apache.xalan.processor.TransformerFactoryImpl' )} You can do this as a preGoal to xdoc:transform in maven.xml. Alternatively you can specify the property using -D on the commandline, but I wouldn't recommend that - where would you document it? Hi, It's not my project so I would rather just use the -D property and email the devs about your maven.xml suggest. How would I set the property correctly? I tried, maven xdoc:transform -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl but obviously I'm not understanding something because that didn't work. c Hi, I'm just starting out with a mavenized project (scarab). I'm familiar with Maven and was just trying to generate documentation (xdoc:transform) but got a pretty nasty error straight off the bat. I'm thinking my JDK setup (Sun 1.5.0) is probably wrong (or possibly my debian/sid ant: 1.6.2) any pointers? I thing I need to replace a xalan.jar file somewhere, but I'm not sure where or how (shouldn't maven handle this?) c maven xdoc:transform generates :- xdoc:init: [style] Transforming into /home/caoilte/work/java/scarab/scarab/target/generated- xdocs [style] Processing /home/caoilte/work/java/scarab/scarab/xdocs/scarab_prop erties.xml to /home/caoilte/work/java/scarab/scarab/target/generated- xdocs/scarab_properties.xml [style] Loading stylesheet /home/caoilte/work/java/scarab/scarab/xdocs/properties. xsl BUILD FAILED File.. /home/caoilte/work/java/scarab/scarab/maven.xml Element... ant:style Line.. 573 Column 76 Provider org.apache.xalan.processor.TransformerFactoryImpl not found Total time: 5 seconds Finished at: Mon Mar 21 12:57:41 GMT 2005 --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kenney Westerhof http://www.neonics.com GPG public key: http://www.gods.nl/~forge/kenneyw.key - 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]
howto parse a file, substituting variables?
Hi, I have defined all my maven used database properties by deriving them from variables in my project.properties file. Unfortunately I use hibernate and do not know of a way of inheriting the properties set in my project.properties file to my hibernate.properties file. It would make my life so much easier for deploying to different environments if I could. What I really want is a goal that will parse my hibernate.properties file with lines like, hibernate.connection.url=${biz.db.url}${biz.db.test.database} and replace the variables with the matching ones from my project.properties before copying the file as if it was a normal resources file. Is there any right way to do this? thanks, c - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: howto parse a file, substituting variables?
Thanks, With that and a little googling I was able to find my answer I also added, filteringtrue/filtering to my resource in the project.xml file and used filter. Works a treat. c On Friday 11 March 2005 16:36, Kenney Westerhof wrote: On Fri, 11 Mar 2005, Caoilte O'Connor wrote: Hi, A possible solution is using ant:filter/ and ant:copy filtering=true/ in maven.xml, using the following format in hibernate.properties: [EMAIL PROTECTED]@@biz.db.test.databas e@ Greetings, Kenney Hi, I have defined all my maven used database properties by deriving them from variables in my project.properties file. Unfortunately I use hibernate and do not know of a way of inheriting the properties set in my project.properties file to my hibernate.properties file. It would make my life so much easier for deploying to different environments if I could. What I really want is a goal that will parse my hibernate.properties file with lines like, hibernate.connection.url=${biz.db.url}${biz.db.test.dat abase} and replace the variables with the matching ones from my project.properties before copying the file as if it was a normal resources file. Is there any right way to do this? thanks, c --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kenney Westerhof http://www.neonics.com GPG public key: http://www.gods.nl/~forge/kenneyw.key - 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]