profile activation
Hello, I like to activate profiles from within a profile. (Or is there an other way to achieve my goal ?) For example I have multiple profiles which are activated in different circumstances. Sometimes none of them are activated and sometimes more are activated: - integration-test-tomcat-profile - integration-test-jetty-profile - my-personal-special-profile - company-special-profile - exotic-verry-unknown-profile - buildserver-profile Our buildserver manager doesn't know any details about these profiles, he just knows our buildserver-profile should be trigger when the buildserver builds the project. Normally I would use a property to activate the profile, but these profile already have property activation. When I add a second property I have to set both of them (or can I use OR somehow?), but my buildadmin only knows about one. I don't wan't hem to know about the other properties. It is up to the developer of the project to correctly configure the 'buildserver-profile'. This is why would like to configure (add) active profiles from the 'buildserver-profile'. I tried something like (in MyMojo): public void execute() throws MojoExecutionException { ... Profile p = getProfile(allProfiles, profileId); p.setActivation(new AlwaysOnActivation()); project.setActiveProfiles(updatedActiveProfiles); But the added profiles aren't executed. I don't feel this is the way to go, but I can't think of an alternative. Any tips please ? Best regards, Raymond -- View this message in context: http://maven.40175.n5.nabble.com/profile-activation-tp4315068p4315068.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: Missing dependencies if building from parent directory (maven 2.0.5)
I think it's a "feature" for the reactor build which tries to use the same version of an artifact if the referenced artifact itself is part of the source tree in the same build. Thanks, Raymond - Original Message - From: "Luciano Resende" <[EMAIL PROTECTED]> To: "Wayne Fay" <[EMAIL PROTECTED]> Cc: "Maven Users List" ; <[EMAIL PROTECTED]> Sent: Tuesday, April 17, 2007 11:38 AM Subject: Re: Missing dependencies if building from parent directory (maven 2.0.5) I have found the solution for this issue, looks like there were some artifacts using different element, and this was causing the problem. Having all artifacts with same solved the build issues. Is this a BUG ? On 4/11/07, Luciano Resende <[EMAIL PROTECTED]> wrote: Even if I explicitly add the version node for tuscany-das-rdb, I get the same problem. Any ideas on how I could debug and try to find what's causing the problem ? On 4/10/07, Wayne Fay <[EMAIL PROTECTED]> wrote: > > I haven't pulled the code and built etc yet, but I noticed the pom.xml > for tuscany-das-rdb is missing a > node. This may be related to your issues... > > Wayne > > On 4/9/07, Luciano Resende <[EMAIL PROTECTED]> wrote: > > Hi maven gurus > > > >We are having a strange dependency issue in our build at Apache > Tuscany > > project. Starting from a clean m2 repo, if one tries the top-level > build > > (/java), he will face some dependencies issues like the one attached > below, > > but the issue actually goes away if you actually build from actual > child > > project (java/das). Simmilar missing dependencies issues are being > reported > > on the sca child project while trying to build from root (/java), and > then > > it goes away if you actually build from the child directory > (java/sca). Our > > svn code is available at [1] for reference. Any thoughts ? > > > > [1] https://svn.apache.org/repos/asf/incubator/tuscany/java/ > > > > Missing: > > -- > > 1) org.apache.tuscany.das:tuscany-das-rdb:jar:1.0-incubator-SNAPSHOT > > > > Try downloading the file manually from the project website. > > > > Then, install it using the command: > > mvn install:install-file > > -DgroupId=org.apache.tuscany.das-DartifactId=tuscany-das-rdb \ > > -Dversion=1.0-incubator-SNAPSHOT -Dpackaging=jar > > -Dfile=/path/to/file > > > > Path to dependency: > > 1) > > > org.apache.tuscany.das.samples:sample-companyweb:war:1.0-incubator-SNAPSHOT > > 2) > org.apache.tuscany.das:tuscany-das-rdb:jar:1.0-incubator-SNAPSHOT > > > > -- > > 1 required artifact is missing. > > > > for artifact: > > > > > org.apache.tuscany.das.samples:sample-companyweb:war:1.0-incubator-SNAPSHOT > > > > from the specified remote repositories: > > central ( http://repo1.maven.org/maven2), > > apache.incubator ( > http://people.apache.org/repo/m2-incubating-repository/ > > ), > > apache.ws.m1.snapshots ( http://ws.zones.apache.org/repository), > > apache.snapshots > > (http://people.apache.org/repo/m2-snapshot-repository > ) > > > > > > -- > > Luciano Resende > > http://people.apache.org/~lresende<http://people.apache.org/%7Elresende> > > > -- Luciano Resende http://people.apache.org/~lresende <http://people.apache.org/%7Elresende> -- Luciano Resende http://people.apache.org/~lresende - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
New Maven 2 repos for Eclipse and SUN jars?
Hi, When I browse the http://repo1.maven.org today, I found there are two repos: http://repo1.maven.org/eclipse (Containing eclipse jars) http://repo1.maven.org/maven-java.net/ (Containing javax and com.ibm.sun jars) Are these new repos that we can reference for Eclipse and Sun artifacts? Does anybody have more information? Thanks, Raymond
Is there a way to control the order of repositories?
Hi, We use multiple maven repos in the build. Is there a way to control the order of the repositories to be searched for artifacts? In some cases, an arifact is published to both maven1 and maven2 repos and we prefer to use the one from the maven2 repo. Thanks, Raymond
Any maven repo mirrors in China?
Hi, Do we have any maven repo mirrors in China? Our (Apache Tuscany project) Chinese users always complain that their connections to repo1.maven.org are very slow and it takes hours to run a build. Most of the time it fails in the middle due to download issues. Thanks, Raymond - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
How to prevent a plugin from being invoked for the pom project?
Hi, I have the following project structure: P1 (packaging="pom", w/ modules: P1 and P2) --- P11 (parent=P1, jar) --- P12 (parent=P1, jar) Now I would like to configure the pom.xml for P1 to declare the maven-war-plugin (please see the pom.xml below) under the webapp profile so that we can produce the war for web deployment. This way, this plugin will be inherited by P11 and P12. But during the reactor build, the maven-war-plugin is also invoked for P1 and it will fail since P1 is not a regular jar/war module. webapp false org.apache.maven.plugins maven-jar-plugin 2.2 junit test test-jar org.apache.maven.plugins maven-war-plugin 2.0.2 ${project.build.directory} *-tests.jar WEB-INF/test-lib package war How do we prevent the plugin from being invoked if the packaging is "pom"? Is it the responsibility of the individual plugin? Thanks, Raymond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Schemagen NullPointerException
Hello, I'm having some issues with the schemagen of the maven plugin. The error says it's a NullPointerException and gives instructions on how to find out more information about the error. So I follow the instructions to cd to the directory and run a command to see the full -error. Which I run and the results of that are "error: package javax.persistence does not exist" and so on. Which seems like it's not finding the compiled classes at all. It compiles and runs just fine with the schemagen part removed. Any help would be appreciated, I'm processing a single class that links to a few other classes. I also can produce xml based on the class just fine. Maven 3.6 jaxb2-maven-plugin 2.4 JDK 1.8.0_192 StackTrace below --- jaxb2-maven-plugin:2.4:schemagen (schemagen) @ Project --- Created EpisodePath [C:\Users\jraymond\Documents\NetBeansProjects\Project\target\generated-resources\schemagen\META-INF\JAXB]: true Created EpisodePath [C:\Users\jraymond\Documents\NetBeansProjects\Project\target\generated-resources\schemagen\META-INF\JAXB]: true Execution failed. [Exception]: java.lang.NullPointerException [Message]: null com.sun.tools.javac.model.JavacTypes.getDeclaredType(JavacTypes.java:218) com.sun.tools.jxc.model.nav.ApNavigator.use(ApNavigator.java:221) com.sun.tools.jxc.model.nav.ApNavigator.use(ApNavigator.java:82) com.sun.xml.bind.v2.model.impl.TypeInfoSetImpl.getClassInfo(TypeInfoSetImpl.java:265) com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:237) com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:227) com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:375) com.sun.xml.bind.v2.model.impl.TypeRefImpl.calcRef(TypeRefImpl.java:96) com.sun.xml.bind.v2.model.impl.TypeRefImpl.getTarget(TypeRefImpl.java:73) com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:78) com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:76) java.util.AbstractList$Itr.next(AbstractList.java:358) com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:275) com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:227) com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:375) com.sun.xml.bind.v2.model.impl.TypeRefImpl.calcRef(TypeRefImpl.java:96) com.sun.xml.bind.v2.model.impl.TypeRefImpl.getTarget(TypeRefImpl.java:73) com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:78) com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:76) java.util.AbstractList$Itr.next(AbstractList.java:358) com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:275) com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:227) com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:375) com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:390) com.sun.tools.jxc.api.impl.j2s.JavaCompilerImpl.bind(JavaCompilerImpl.java:95) com.sun.tools.jxc.ap.SchemaGenerator.process(SchemaGenerator.java:110) com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794) com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705) com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91) com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035) com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176) com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170) com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856) com.sun.tools.javac.main.Main.compile(Main.java:523) com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129) com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138) com.sun.tools.jxc.SchemaGenerator$Runner.compile(SchemaGenerator.java:266) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) com.sun.tools.jxc.SchemaGenerator.run(SchemaGenerator.java:166) org.codehaus.mojo.jaxb2.schemageneration.AbstractXsdGeneratorMojo.performExecution(AbstractXsdGeneratorMojo.java:405) org.codehaus.mojo.jaxb2.AbstractJaxbMojo.execute(AbstractJaxbMojo.java:315) org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoEx
How to resolve right dependency which enabled and built/install with profile?
Hi I have a project with module A that will be built with or without profile say -Pnewlib , thus I can have it build with different version of library dependency let's say by default use libjar-1.0 and when -Pnewlib will use libjar-2.0. Then, I have a module B to depends on module A. The issue is that how can I get the right dependency in module B for libjar? I want to assemble a fat jar so I need to figure out which version of libjar to include. In my test, it seems to me that when mvn -Pnewlib install module A, though it will build with libjar-2.0. but the installed pom do not reflect this. Thus when module B resolve the dependency, it will resolve the dependency as libjar-1.0 ( though when building module B, -Pnewlib is also passed in, But I think this will not pass to the dependent package when resolve the dependency). I don't want to have module B know anything about the libjar-1.0 and libjar-2.0. it should handle by module A, and module B just simply call into module A. Actually, I think this apply the same if A and B are not modules in one project, but standalone projects. In which case B will not define profile at all. So how can I achieve this goal? say, A take care of lib dependency when build and install. B who depends on A, when assembly can retrive the right lib dependency. Best Regards, Raymond Liu - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: How to resolve right dependency which enabled and built/install with profile?
Thanks Stephen I see your solution is let B manage the libjar version. While this is against my wish, I wish B to know nothing about A's internal implementation. In the future, A might depends on a v3.0 libjar, I do wish to just repackage B to make it work not revise B's code or assembly rules. And sometime A might be buried deep in the dependent tree, Those project might not even aware it depends on A, they just wish it works on whatever current A's binary jar, which then need the right libjar dependency when assembly. And I know it seems hard to use profiles to manipulate dependencies. While by theory, I think this is a reasonable requirement that a project do not need to take care of its dependencies' internal implementation of what it depends on, It just wish it works. E.g. if the POM file is installed in a way that when it build with profile, the corresponding dependencies and any other modifying is fill in the final POM file. ( since the profile is not used anyway when resolve dependencies, why keep it there? For source jar? ) Then those project depend on it won't worry about A's profile, it's already the correct one which been used on building A with this installed or downloaded binary jar. So , using profile might not be the right solution, While if there isn't an automatic way to meet this requirement, can I take it as a feature missing? Best Regards, Raymond Liu -Original Message- From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] Sent: Tuesday, December 10, 2013 6:57 PM To: Maven Users List Subject: Re: How to resolve right dependency which enabled and built/install with profile? Using profiles to manipulate dependencies is a route to madness. An modules dependencies should be a constant... It was a mistake to allow within . The correct solution is to create additional modules that aggregate in the corresponding lib versions (this is also a bad plan, but less worse than your current plan by quite some margin). The additional modules would depend on A and the respective version of libjar and bundle the two together. Then B can depend if the corresponding internmediate... Now at this point you will start to see the madness returning... That is if you need two versions of B. The better solution is to just let B depend in A and then do the fatjar as the final later after B and *override* the transitive dep on libjar in the two fatjar building modules On Tuesday, 10 December 2013, Liu, Raymond wrote: > Hi > > I have a project with module A that will be built with or without > profile say -Pnewlib , thus I can have it build with different version > of library dependency let's say by default use libjar-1.0 and when > -Pnewlib will use libjar-2.0. > > Then, I have a module B to depends on module A. The issue is that how > can I get the right dependency in module B for libjar? I want to > assemble a fat jar so I need to figure out which version of libjar to include. > > In my test, it seems to me that when mvn -Pnewlib install module A, > though it will build with libjar-2.0. but the installed pom do not reflect > this. > Thus when module B resolve the dependency, it will resolve the > dependency as libjar-1.0 ( though when building module B, -Pnewlib is > also passed in, But I think this will not pass to the dependent > package when resolve the dependency). > > I don't want to have module B know anything about the libjar-1.0 and > libjar-2.0. it should handle by module A, and module B just simply > call into module A. > > Actually, I think this apply the same if A and B are not modules in > one project, but standalone projects. In which case B will not define > profile at all. > > So how can I achieve this goal? say, A take care of lib dependency > when build and install. B who depends on A, when assembly can retrive > the right lib dependency. > > Best Regards, > Raymond Liu > > > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: > users-h...@maven.apache.org > > -- Sent from my phone - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: How to resolve right dependency which enabled and built/install with profile?
Well. The reason for using different version of libjar is that it's a client API, and working with different version of server counter part code. They are not compatible, instead, A is a shim layer that hook into different libjar API and provide a common interface for B to use. So that to hide the API changes across version. And in my case B need to be assembled into a fat jar for easy usage. So switching C in runtime won't be possible. Otherwise, not need an extra C, just switching libjar is ok. Best Regards, Raymond Liu -Original Message- From: Ron Wheeler [mailto:rwhee...@artifact-software.com] Sent: Wednesday, December 11, 2013 12:24 PM To: users@maven.apache.org Subject: Re: How to resolve right dependency which enabled and built/install with profile? B depends on A A depends on C C depends on libjar x.0 "provided" C has no code and is only a pom not a jar. You can then swap in any compatible version of libjar by providing it at run-time. Still not sure why you can not just use the latest version of libjar if any version will work at run-time. On 10/12/2013 7:52 PM, Liu, Raymond wrote: > Thanks Stephen > > I see your solution is let B manage the libjar version. While this is > against my wish, I wish B to know nothing about A's internal implementation. > In the future, A might depends on a v3.0 libjar, I do wish to just repackage > B to make it work not revise B's code or assembly rules. And sometime A might > be buried deep in the dependent tree, Those project might not even aware it > depends on A, they just wish it works on whatever current A's binary jar, > which then need the right libjar dependency when assembly. > > And I know it seems hard to use profiles to manipulate dependencies. > While by theory, I think this is a reasonable requirement that a project do > not need to take care of its dependencies' internal implementation of what it > depends on, It just wish it works. E.g. if the POM file is installed in a way > that when it build with profile, the corresponding dependencies and any other > modifying is fill in the final POM file. ( since the profile is not used > anyway when resolve dependencies, why keep it there? For source jar? ) Then > those project depend on it won't worry about A's profile, it's already the > correct one which been used on building A with this installed or downloaded > binary jar. > > So , using profile might not be the right solution, While if there > isn't an automatic way to meet this requirement, can I take it as a feature > missing? > > Best Regards, > Raymond Liu > > -Original Message- > From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] > Sent: Tuesday, December 10, 2013 6:57 PM > To: Maven Users List > Subject: Re: How to resolve right dependency which enabled and built/install > with profile? > > Using profiles to manipulate dependencies is a route to madness. > > An modules dependencies should be a constant... It was a mistake to allow > within . > > The correct solution is to create additional modules that aggregate in the > corresponding lib versions (this is also a bad plan, but less worse than your > current plan by quite some margin). The additional modules would depend on A > and the respective version of libjar and bundle the two together. > > Then B can depend if the corresponding internmediate... Now at this point you > will start to see the madness returning... That is if you need two versions > of B. > > The better solution is to just let B depend in A and then do the > fatjar as the final later after B and *override* the transitive dep on > libjar in the two fatjar building modules > > On Tuesday, 10 December 2013, Liu, Raymond wrote: > >> Hi >> >> I have a project with module A that will be built with or without >> profile say -Pnewlib , thus I can have it build with different >> version of library dependency let's say by default use libjar-1.0 and >> when -Pnewlib will use libjar-2.0. >> >> Then, I have a module B to depends on module A. The issue is that how >> can I get the right dependency in module B for libjar? I want to >> assemble a fat jar so I need to figure out which version of libjar to >> include. >> >> In my test, it seems to me that when mvn -Pnewlib install module A, >> though it will build with libjar-2.0. but the installed pom do not reflect >> this. >> Thus when module B resolve the dependency, it will resolve the >> dependency as libjar-1.0 ( though when building module B, -Pnewlib is >> also passed in, But I think this will not pass to the dependent >> package when resolve the d
RE: How to resolve right dependency which enabled and built/install with profile?
Actually, I think it is possible, though probably could not be done by current Maven implementation. As long as B can know which libjar the shim A is built upon. I am saying that it is possible is because that I can achieve the goal with SBT, when sbt do publish local, it will fill the profile info ( actually not profile in sbt, but some compile time config ) into A's final pom, then when assemble B, the installed A actually do not have any profile info in A's pom. B then assemble with the right libjar which A is built upon. Best Regards, Raymond Liu -Original Message- From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] Sent: Wednesday, December 11, 2013 6:47 PM To: Maven Users List Subject: Re: How to resolve right dependency which enabled and built/install with profile? You are looking for the impossible. You want A to work with any version of libjar You want B to use A but not know which version of libjar the A it is using depends on... actually to be independent of the version of libjar that A depends on... but also to bundle the specific one... Rethink what you are asking and you will see that you are asking an impossible request... you are asking somebody to hop on one leg and mandating that the one leg be both their left and right leg. When you are asking an impossibility, that is usually a sign that you are going at things the wrong way. If A is going to become part of a fatjar at some point, you need to make a decision *at the point of creating the fatjar* as to which libjar will be included within A. Or else perhaps, you include all versions of libjar and provide a means for A to decide which version it wants... there are many ways to achieve this... * use the service provider pattern to introduce another shim layer and then use the shade plugin to put all the shim impl libjar deps into independent package namespaces * use a custom classloader and package libjar as resources, so that A's entry point loads the correct libjar at runtime * etc. With the above you would be including *all* versions of libjar within A and the whole thing becomes moot anyway... -Stephen On 11 December 2013 00:52, Liu, Raymond wrote: > Thanks Stephen > > I see your solution is let B manage the libjar version. While > this is against my wish, I wish B to know nothing about A's internal > implementation. In the future, A might depends on a v3.0 libjar, I do > wish to just repackage B to make it work not revise B's code or assembly > rules. > And sometime A might be buried deep in the dependent tree, Those > project might not even aware it depends on A, they just wish it works > on whatever current A's binary jar, which then need the right libjar > dependency when assembly. > > And I know it seems hard to use profiles to manipulate > dependencies. While by theory, I think this is a reasonable > requirement that a project do not need to take care of its > dependencies' internal implementation of what it depends on, It just > wish it works. E.g. if the POM file is installed in a way that when it > build with profile, the corresponding dependencies and any other > modifying is fill in the final POM file. ( since the profile is not > used anyway when resolve dependencies, why keep it there? For source > jar? ) Then those project depend on it won't worry about A's profile, > it's already the correct one which been used on building A with this > installed or downloaded binary jar. > > So , using profile might not be the right solution, While if > there isn't an automatic way to meet this requirement, can I take it > as a feature missing? > > Best Regards, > Raymond Liu > > -Original Message- > From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] > Sent: Tuesday, December 10, 2013 6:57 PM > To: Maven Users List > Subject: Re: How to resolve right dependency which enabled and > built/install with profile? > > Using profiles to manipulate dependencies is a route to madness. > > An modules dependencies should be a constant... It was a mistake to > allow within . > > The correct solution is to create additional modules that aggregate in > the corresponding lib versions (this is also a bad plan, but less > worse than your current plan by quite some margin). The additional > modules would depend on A and the respective version of libjar and > bundle the two together. > > Then B can depend if the corresponding internmediate... Now at this > point you will start to see the madness returning... That is if you > need two versions of B. > > The better solution is to just let B depend in A and then do the > fatjar as the final later after B and *override* the transitive dep on > libjar in the
How to put a Jar in my War
Hello all, Can any one please explain to me how I can add my Jar file to my War file... it seems such an easy thing to do... So currently I have an assembly which create a jar file (I like this) I also can create a second assembly creating a zip file (looks good) But if I change the format of this second assembly from zip to war I get an error: [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Error creating assembly Embedded error: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) [INFO] One thing I notice that inside my zip file it says web-inf/web.xml and not WEB-INF/web.xml Any way to solve this problem ? thnx, raymond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: How to put a Jar in my War
Hello Mang Jun Lau, Thank you for responsing, but it still isn't working :( Currently I have this in my pom.xml: maven-war-plugin web spg web/WEB-INF/web.xml I also tried: maven-war-plugin web/WEB-INF/web.xml I even upgraded from maven 2.0.2 to 2.0.3 But I still get this error: Embedded error: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) NOTE Some time ago we used this configuration to create a valid war file using: mvn package But we need to move the stuff in WEB-INF/classes to WEB-INF/lib/spg.jar That is why we are looking in to assembly's. Can you think of anything else that might solve this problem ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to put a Jar in my War
Hello Mang Jun Lau, Thank you for responsing, but it still isn't working :( Currently I have this in my pom.xml: maven-war-plugin web spg web/WEB-INF/web.xml I also tried: maven-war-plugin web/WEB-INF/web.xml I even upgraded from maven 2.0.2 to 2.0.3 But I still get this error: Embedded error: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) NOTE Some time ago we used this configuration to create a valid war file using: mvn package But we need to move the stuff in WEB-INF/classes to WEB-INF/lib/spg.jar That is why we are looking in to assembly's. Can you think of anything else that might solve this problem ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to put a Jar in my War
Hi Piéroni Raphaël, Thank you for responding, it might be a solution... So if I understand you correctly I don't need to change my dir structure to do this, currently we have one large project which should remain this way for now. in /pom.xml (root pom) I will use jar this will be the spg.jar And in /subdir/of/root/pom.xml I will use war this will create my war, and by setting my parent in this pom it will include my jar from the parent pom. Did I understand this correclty, or do I also need to add dependencies to this pom ? Because I'm new to maven I still find it hard to use the dependency mechanishm. It's not completely clear to me if dependencies always need to be in a mvnrepository before they can be used, or if (this is what we need) the spg.jar just build can be used when packaging my war file without first releasing it in a mvnrepository. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to put a Jar in my War
thank you for clearing this out. It is indeed confusing. Documentation is mentioning webXml, but error refers to webxml. I tried both, camel case and lowercase. On Thu, 6 Apr 2006 10:46:47 +0200, hermod.opstvedt wrote > Hi > > I noted that the error states: webxml attribute is required , while > you have a parameter webXml (note the uppercase X) > > Hermod > > -Original Message- > From: Piéroni Raphaël [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 06, 2006 10:25 AM > To: Maven Users List > Subject: Re: How to put a Jar in my War > > Hello Raymond, > > Inline answer > > 2006/4/6, Raymond Domingo <[EMAIL PROTECTED]>: > > > > > > > > Hello Mang Jun Lau, > > > > Thank you for responsing, but it still isn't working :( > > > > Currently I have this in my pom.xml: > > > >maven-war-plugin > > > >web > > spg > >web/WEB-INF/web.xml > > > > > > > > I also tried: > > > >maven-war-plugin > > > >web/WEB-INF/web.xml > > > > > > > > I even upgraded from maven 2.0.2 to 2.0.3 > > > > But I still get this error: > > > > Embedded error: webxml attribute is required (or pre-existing > > WEB-INF/web.xml > > if executing in update mode) > > > > NOTE > > Some time ago we used this configuration to create a valid war file using: > > mvn package > > > > But we need to move the stuff in WEB-INF/classes to WEB-INF/lib/spg.jar > > Why don't you create an spg project with the jar packaging on which > your war project depends ? > > If you want some sample, checkout the axis-archetype code at mojo. > http://mojo.codehaus.org/ (it is in the sandbox) > > Hope this helps. > > Raphaël > > That is why we are looking in to assembly's. > > > > Can you think of anything else that might solve this problem ? > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * * * * > > This email with attachments is solely for the use of the individual > or entity to whom it is addressed. Please also be aware that the > DnB NOR Group cannot accept any payment orders or other legally > binding correspondence with customers as a part of an email. > > This email message has been virus checked by the virus programs used > in the DnB NOR Group. > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to put a Jar in my War
thank you for clearing this out. It is indeed confusing. Documentation is mentioning webXml, but error refers to webxml. I tried both, camel case and lowercase. On Thu, 6 Apr 2006 10:46:47 +0200, hermod.opstvedt wrote > Hi > > I noted that the error states: webxml attribute is required , while > you have a parameter webXml (note the uppercase X) > > Hermod > > -Original Message- > From: Piéroni Raphaël [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 06, 2006 10:25 AM > To: Maven Users List > Subject: Re: How to put a Jar in my War > > Hello Raymond, > > Inline answer > > 2006/4/6, Raymond Domingo <[EMAIL PROTECTED]>: > > > > > > > > Hello Mang Jun Lau, > > > > Thank you for responsing, but it still isn't working :( > > > > Currently I have this in my pom.xml: > > > >maven-war-plugin > > > >web > > spg > >web/WEB-INF/web.xml > > > > > > > > I also tried: > > > >maven-war-plugin > > > >web/WEB-INF/web.xml > > > > > > > > I even upgraded from maven 2.0.2 to 2.0.3 > > > > But I still get this error: > > > > Embedded error: webxml attribute is required (or pre-existing > > WEB-INF/web.xml > > if executing in update mode) > > > > NOTE > > Some time ago we used this configuration to create a valid war file using: > > mvn package > > > > But we need to move the stuff in WEB-INF/classes to WEB-INF/lib/spg.jar > > Why don't you create an spg project with the jar packaging on which > your war project depends ? > > If you want some sample, checkout the axis-archetype code at mojo. > http://mojo.codehaus.org/ (it is in the sandbox) > > Hope this helps. > > Raphaël > > That is why we are looking in to assembly's. > > > > Can you think of anything else that might solve this problem ? > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * * * * > > This email with attachments is solely for the use of the individual > or entity to whom it is addressed. Please also be aware that the > DnB NOR Group cannot accept any payment orders or other legally > binding correspondence with customers as a part of an email. > > This email message has been virus checked by the virus programs used > in the DnB NOR Group. > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Trying to understand maven readonly parameters
Hello, Can anyone explain why maven-compiler-plugin setting compileSourceRoots is readonly ? Isn't it a pain in the as you have to use the build-helper-maven-plugin to work around this problem or am I missing something ? raymond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
repo down?
Hey all, is http://repo1.maven.org <http://repo1.maven.org/> down unexpectedly? If this is a scheduled outage, where can I get information on planned downtime in the future? Regards, Raymond Ritz
mvn deploy:deploy error
All, When attempting to use mvn deploy:deploy or even if I try mvn deploy:deploy-file I am getting an error that reads "The packaging for this project did not assign a file to the build artifact" . I am trying to use the deploy command to release a jar into our local repository. I have done this with other projects successfully, but have not been able to figure out why this project is different (other than this is child pom). Here is the pom from the project (The actual paths to the repos have been omitted), and the repositories are configured in my local maven settings file. Any thoughts are appreciated. http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";> gov.nashville.jis ojies 1.0-SNAPSHOT 4.0.0 gov.nashville.jis commons jar commons 1.0-SNAPSHOT org.apache.maven.plugins maven-compiler-plugin 1.5 1.5 jis-repository file:///maven2 jis-repository file:///maven2 jis-repository http://xxx/maven2 true commons-beanutils commons-beanutils 1.7.0 commons-lang commons-lang 2.1 Raymond Ritz
mvn deploy:deploy problem
All, When attempting to use mvn deploy:deploy or even if I try mvn deploy:deploy-file I am getting an error that reads "The packaging for this project did not assign a file to the build artifact" . I am trying to use the deploy command to release a jar into our local repository. I have done this with other projects successfully, but have not been able to figure out why this project is different (other than this is child pom). Here is the pom from the project (The actual paths to the repos have been omitted), and the repositories are configured in my local maven settings file. Any thoughts are appreciated. http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";> gov.nashville.jis ojies 1.0-SNAPSHOT 4.0.0 gov.nashville.jis commons jar commons 1.0-SNAPSHOT org.apache.maven.plugins maven-compiler-plugin 1.5 1.5 jis-repository file:///maven2 jis-repository file:///maven2 jis-repository http://xxx/maven2 true commons-beanutils commons-beanutils 1.7.0 commons-lang commons-lang 2.1 Raymond Ritz
maven-war-plugin how to exclude jar files from WEB-INF/lib
Hello All, I just starting to use maven, but even after spending hours of browsing documentation I'm still not able to create the war file that fits my needs. Currently I do generate a war file, but I need to filter my jboss-j2ee-4.0.2.jar file from the WEB-INF/lib directory. After reading some of the previous posts it seemd to me I needed the snapshot beta3 of the plugin. So I spended lots of time getting this snapshot up and running, but even wen finaly using the snapshot filtering didn't work. It filters all files from war, or none at all. But I'm not able to specify the file I would like to filter. I tried configuration as below: [attempt1] org.apache.maven.plugins maven-war-plugin 2.0-beta-3-20060301.182656-4 web **/jboss-j2ee-*.jar [attempt2] org.apache.maven.plugins maven-war-plugin 2.0-beta-3-20060301.182656-4 web **/jboss-j2ee-*.jar Anyone out there who nows how to filter jar files from a war ? Best regards, raymond domingo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: maven-war-plugin how to exclude jar files from WEB-INF/lib
YES, This worked for me. Thanks raymond On Tue, 28 Mar 2006 00:49:37 -0600, Wayne Fay wrote > Use provided for this dependency to keep it out of the > lib directory. > > Wayne > > On 3/28/06, Raymond Domingo <[EMAIL PROTECTED]> wrote: > > Hello All, > > > > I just starting to use maven, but even after spending hours of browsing > > documentation I'm still not able to create the war file that fits my needs. > > > > Currently I do generate a war file, but I need to filter my > > jboss-j2ee-4.0.2.jar file from the WEB-INF/lib directory. > > > > After reading some of the previous posts it seemd to me I needed the > > snapshot > > beta3 of the plugin. So I spended lots of time getting this snapshot up and > > running, but even wen finaly using the snapshot filtering didn't work. > > > > It filters all files from war, or none at all. But I'm not able to specify > > the > > file I would like to filter. I tried configuration as below: > > [attempt1] > > > >org.apache.maven.plugins > >maven-war-plugin > >2.0-beta-3-20060301.182656-4 > > > >web > >**/jboss-j2ee-*.jar > > > > > > [attempt2] > > > >org.apache.maven.plugins > >maven-war-plugin > >2.0-beta-3-20060301.182656-4 > > > >web > > > > **/jboss-j2ee-*.jar > > > > > > > > > > Anyone out there who nows how to filter jar files from a war ? > > > > Best regards, > > raymond domingo > > > > - > > 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]
maven-war-plugin howto add files to WEB-INF
Hello, I'm almost finished setting up the war file for my project. Just finishing the last details... Can anyone explain to me how I can add a file (forexample) [projectroot]/zoo/foo.xml to the WEB-INF (in my war). I tried: WEB-INF zoo But this create a WEB-INF/classes/WEB-INF in my war. Best regards, raymond domingo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
maven-war-plugin howto add files to WEB-INF
Hello, I'm almost finished setting up the war file for my project. Just finishing the last details... Can anyone explain to me how I can add a file (forexample) [projectroot]/zoo/foo.xml to the WEB-INF (in my war). I tried: WEB-INF zoo But this create a WEB-INF/classes/WEB-INF in my war. Best regards, raymond domingo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
maven-war-plugin howto add files to WEB-INF
Hello, I'm almost finished setting up the war file for my project. Just finishing the last details... Can anyone explain to me how I can add a file (forexample) [projectroot]/zoo/foo.xml to the WEB-INF (in my war). I tried: WEB-INF zoo But this create a WEB-INF/classes/WEB-INF in my war. Best regards, raymond domingo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: maven-war-plugin howto add files to WEB-INF
Thanks for your response. Yes, of course that is one way to solve it. But I need to prevent modifications of file structure, because there are some dependencies on this file structure. So this isn't an option at this time. We might refactor the file structure later on... Any other hints... ? On Tue, 28 Mar 2006 14:19:38 +0530, Krishnan A S wrote > Place under webapp/WEB-INF/zoo/foo.xml in ur build structure > > Thanks & Regards, > A.S.KRISHNAN, > AZTEC, BANGALORE. > > -Original Message- > From: Raymond Domingo [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 28, 2006 2:14 PM > To: users@maven.apache.org > Subject: maven-war-plugin howto add files to WEB-INF > > Hello, > > I'm almost finished setting up the war file for my project. Just > finishing the > last details... > > Can anyone explain to me how I can add a file (forexample) > [projectroot]/zoo/foo.xml to the WEB-INF (in my war). > > I tried: > > WEB-INF > zoo > > > But this create a WEB-INF/classes/WEB-INF in my war. > > Best regards, > raymond domingo > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > ** > > The information contained in, or attached to, this e-mail, contains > confidential information and is intended solely for the use of the > individual or entity to whom they are addressed and is subject to > legal privilege. If you have received this e-mail in error you > should notify the sender immediately by reply e-mail, delete the > message from your system and notify your system manager. Please do > not copy it for any purpose, or disclose its contents to any other > person. The views or opinions presented in this e-mail are solely > those of the author and do not necessarily represent those of the > company. The recipient should check this e-mail and any attachments > for the presence of viruses. The company accepts no liability for > any damage caused, directly or indirectly, by any virus transmitted > in this email > > > > - > 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-war-plugin howto add files to WEB-INF
Thanks for your response. Yes, of course that is one way to solve it. But I need to prevent modifications of file structure, because there are some dependencies on this file structure. So this isn't an option at this time. We might refactor the file structure later on... Any other hints... ? On Tue, 28 Mar 2006 14:19:38 +0530, Krishnan A S wrote > Place under webapp/WEB-INF/zoo/foo.xml in ur build structure > > Thanks & Regards, > A.S.KRISHNAN, > AZTEC, BANGALORE. > > -Original Message- > From: Raymond Domingo [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 28, 2006 2:14 PM > To: users@maven.apache.org > Subject: maven-war-plugin howto add files to WEB-INF > > Hello, > > I'm almost finished setting up the war file for my project. Just > finishing the > last details... > > Can anyone explain to me how I can add a file (forexample) > [projectroot]/zoo/foo.xml to the WEB-INF (in my war). > > I tried: > > WEB-INF > zoo > > > But this create a WEB-INF/classes/WEB-INF in my war. > > Best regards, > raymond domingo > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > ** > > The information contained in, or attached to, this e-mail, contains > confidential information and is intended solely for the use of the > individual or entity to whom they are addressed and is subject to > legal privilege. If you have received this e-mail in error you > should notify the sender immediately by reply e-mail, delete the > message from your system and notify your system manager. Please do > not copy it for any purpose, or disclose its contents to any other > person. The views or opinions presented in this e-mail are solely > those of the author and do not necessarily represent those of the > company. The recipient should check this e-mail and any attachments > for the presence of viruses. The company accepts no liability for > any damage caused, directly or indirectly, by any virus transmitted > in this email > > > > - > 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-war-plugin howto add files to WEB-INF
Thanks for your response. Yes, of course that is one way to solve it. But I need to prevent modifications of file structure, because there are some dependencies on this file structure. So this isn't an option at this time. We might refactor the file structure later on... Any other hints... ? On Tue, 28 Mar 2006 14:19:38 +0530, Krishnan A S wrote > Place under webapp/WEB-INF/zoo/foo.xml in ur build structure > > Thanks & Regards, > A.S.KRISHNAN, > AZTEC, BANGALORE. > > -Original Message- > From: Raymond Domingo [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 28, 2006 2:14 PM > To: users@maven.apache.org > Subject: maven-war-plugin howto add files to WEB-INF > > Hello, > > I'm almost finished setting up the war file for my project. Just > finishing the > last details... > > Can anyone explain to me how I can add a file (forexample) > [projectroot]/zoo/foo.xml to the WEB-INF (in my war). > > I tried: > > WEB-INF > zoo > > > But this create a WEB-INF/classes/WEB-INF in my war. > > Best regards, > raymond domingo > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > ** > > The information contained in, or attached to, this e-mail, contains > confidential information and is intended solely for the use of the > individual or entity to whom they are addressed and is subject to > legal privilege. If you have received this e-mail in error you > should notify the sender immediately by reply e-mail, delete the > message from your system and notify your system manager. Please do > not copy it for any purpose, or disclose its contents to any other > person. The views or opinions presented in this e-mail are solely > those of the author and do not necessarily represent those of the > company. The recipient should check this e-mail and any attachments > for the presence of viruses. The company accepts no liability for > any damage caused, directly or indirectly, by any virus transmitted > in this email > > > > - > 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]
mvn deploy:deploy problem
All, When attempting to use mvn deploy:deploy or even if I try mvn deploy:deploy-file I am getting an error that reads "The packaging for this project did not assign a file to the build artifact" . I am trying to use the deploy command to release a jar into our local repository. I have done this with other projects successfully, but have not been able to figure out why this project is different (other than this is child pom). Here is the pom from the project (The actual paths to the repos have been omitted), and the repositories are configured in my local maven settings file. Any thoughts are appreciated. http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";> gov.nashville.jis ojies 1.0-SNAPSHOT 4.0.0 gov.nashville.jis commons jar commons 1.0-SNAPSHOT org.apache.maven.plugins maven-compiler-plugin 1.5 1.5 jis-repository file:///maven2 jis-repository file:///maven2 jis-repository http://xxx/maven2 true commons-beanutils commons-beanutils 1.7.0 commons-lang commons-lang 2.1 Raymond Ritz
Running a single test?
Is there a way to run a single junit test case in maven 2? Raymond Ritz
RE: Re: Running a single test?
Thanks Chris. This works. I have previously tried the mvn test -dtest=xxx.yyy.classname . do you know why this approach was chosen? This seems strange to me, but I may not know why this was done. Thanks Ray -Original Message- From: Chris Berry [mailto:[EMAIL PROTECTED] Sent: Friday, December 23, 2005 1:39 PM To: Maven Users List; [EMAIL PROTECTED] Subject: Re: Running a single test? mvn -Dtest=MyTest test Note: MyTest is your java test class. Note: Use it "unqualified" -- without its package name (e.g. without " com.myco.") otherwise, this confuses m2 On 12/23/05, Raymond N. Ritz <[EMAIL PROTECTED]> wrote: > > Is there a way to run a single junit test case in maven 2? > > > > Raymond Ritz > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] Referencing system properties in pom?
All, I would like to be able to reference my operating systems configured user.home variable inside of pom.xml to allow my maven 2 builds to reference a filters configuration file that exists in user.home. Regards, Raymond Ritz