Create jar from ear project or create 2 jars from jar project
Hi, we need to create a jar that only contains 2 xml files but nothing more. Because we have just those 2 files, we don't want to create a new project for that (especially since Eclipse can't display projects hierarchically). So the question is: Is it possible to create a JAR containing those 2 files from either an EAR-Module or a JAR-Module? I tried both, using the maven-jar-plugin, but wasn't yet successful. The problem is that normal EAR or JAR creation should not be affected, however in the EAR project the artifact was deployed/installed using the EAR's artifact id. Is there a way to create two artifacts from one EAR project? Or is there a way to create two distinct jars from one JAR project in one run, e.g. not having to start multiple runs with different profiles/properties ? Thanks in advance.
Re: Create jar from ear project or create 2 jars from jar project
Hi, one project = one artifact. You'll get hurt (to various degrees) if you try to fight that principle. Here are a few hints to explore though : - build-helper-plugin to attach additional artifacts to your build - dependency-plugin to copy/unpack resources from other artifacts Vincent 2010/11/25 Thomas Göttlich guo.tu...@googlemail.com Hi, we need to create a jar that only contains 2 xml files but nothing more. Because we have just those 2 files, we don't want to create a new project for that (especially since Eclipse can't display projects hierarchically). So the question is: Is it possible to create a JAR containing those 2 files from either an EAR-Module or a JAR-Module? I tried both, using the maven-jar-plugin, but wasn't yet successful. The problem is that normal EAR or JAR creation should not be affected, however in the EAR project the artifact was deployed/installed using the EAR's artifact id. Is there a way to create two artifacts from one EAR project? Or is there a way to create two distinct jars from one JAR project in one run, e.g. not having to start multiple runs with different profiles/properties ? Thanks in advance.
Re: Create 2 jars for a project
Sure it is, but not wihout some extra jelly code. Do it with the Ant Jar tag in your maven.xml or you can make one project as a subproject of the other using the reactor component. But be aware that if you do, you will loose the maven.artifact. The artifact of a maven project is, by default, unique. A single jar. We have a project here that builds over 30 jars and its not really an issue. The product we build is not a simple artifact anyway so nowhere in our build is the unique artifact refered. Hope it helps. Eric. Adrian Tarau wrote: Hi, It is possible to create 2 jars in the same maven project? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Create 2 jars for a project
I can use the ant:jar but I want to use the code behind the jar:jar goal which add to Manifest.MF a lots o useful information extracted from POM. One solution it will be to add it also in maven.xml but is not so beautiful. Do you know if I can make a postGoal fro jar:jar, change the jar plugin properties, call again jar:jar goal but skiping the postGoal the second time?. Can be a pre or post goal skipped programmatic? -Original Message- From: Eric Giguere [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 3:56 PM To: Maven Users List Subject: Re: Create 2 jars for a project Sure it is, but not wihout some extra jelly code. Do it with the Ant Jar tag in your maven.xml or you can make one project as a subproject of the other using the reactor component. But be aware that if you do, you will loose the maven.artifact. The artifact of a maven project is, by default, unique. A single jar. We have a project here that builds over 30 jars and its not really an issue. The product we build is not a simple artifact anyway so nowhere in our build is the unique artifact refered. Hope it helps. Eric. Adrian Tarau wrote: Hi, It is possible to create 2 jars in the same maven project? Thanks. - 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: Create 2 jars for a project
Yes, I gues it can be done if you program this accordingly with a flag. But instead of doing this and having to cope with some maybe unwanted behavior from calling jar:jar twice and trying to fool the plugin, you could take the jelly code in the jar plugin and use it directly in your project? You know what, maybe my approach I took with the legacy project could fit you more. Create a master project that is responsible for compiling all you sources. Then, pass control to 2 sub-projects that will take care of producing the jars on the classes build by the master project. It involves setting this in the sub-projects: parent.base.dir=${basedir}/../..-- depends on where you put you sub-project # # maven default source directory override to get parent's instead # maven.build.dir=${parent.base.dir}/target maven.src.dir=${parent.base.dir}/src/java With this, all projects will use the same sources and same classes. So your master compiles, sub-projects jar using all maven built in mechanism. What do you think? Eric. Adrian Tarau wrote: I can use the ant:jar but I want to use the code behind the jar:jar goal which add to Manifest.MF a lots o useful information extracted from POM. One solution it will be to add it also in maven.xml but is not so beautiful. Do you know if I can make a postGoal fro jar:jar, change the jar plugin properties, call again jar:jar goal but skiping the postGoal the second time?. Can be a pre or post goal skipped programmatic? -Original Message- From: Eric Giguere [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 3:56 PM To: Maven Users List Subject: Re: Create 2 jars for a project Sure it is, but not wihout some extra jelly code. Do it with the Ant Jar tag in your maven.xml or you can make one project as a subproject of the other using the reactor component. But be aware that if you do, you will loose the maven.artifact. The artifact of a maven project is, by default, unique. A single jar. We have a project here that builds over 30 jars and its not really an issue. The product we build is not a simple artifact anyway so nowhere in our build is the unique artifact refered. Hope it helps. Eric. Adrian Tarau wrote: Hi, It is possible to create 2 jars in the same maven project? Thanks. - 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: Create 2 jars for a project
Thanks for the tips; I think the first one with the flag is better. First of all, I will be synchronized with all the updates made to the JAR plugin and second the project is already included into a multiproject and the multiproject solution is not so good. -Original Message- From: Eric Giguere [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 4:14 PM To: Maven Users List Subject: Re: Create 2 jars for a project Yes, I gues it can be done if you program this accordingly with a flag. But instead of doing this and having to cope with some maybe unwanted behavior from calling jar:jar twice and trying to fool the plugin, you could take the jelly code in the jar plugin and use it directly in your project? You know what, maybe my approach I took with the legacy project could fit you more. Create a master project that is responsible for compiling all you sources. Then, pass control to 2 sub-projects that will take care of producing the jars on the classes build by the master project. It involves setting this in the sub-projects: parent.base.dir=${basedir}/../..-- depends on where you put you sub-project # # maven default source directory override to get parent's instead # maven.build.dir=${parent.base.dir}/target maven.src.dir=${parent.base.dir}/src/java With this, all projects will use the same sources and same classes. So your master compiles, sub-projects jar using all maven built in mechanism. What do you think? Eric. Adrian Tarau wrote: I can use the ant:jar but I want to use the code behind the jar:jar goal which add to Manifest.MF a lots o useful information extracted from POM. One solution it will be to add it also in maven.xml but is not so beautiful. Do you know if I can make a postGoal fro jar:jar, change the jar plugin properties, call again jar:jar goal but skiping the postGoal the second time?. Can be a pre or post goal skipped programmatic? -Original Message- From: Eric Giguere [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 3:56 PM To: Maven Users List Subject: Re: Create 2 jars for a project Sure it is, but not wihout some extra jelly code. Do it with the Ant Jar tag in your maven.xml or you can make one project as a subproject of the other using the reactor component. But be aware that if you do, you will loose the maven.artifact. The artifact of a maven project is, by default, unique. A single jar. We have a project here that builds over 30 jars and its not really an issue. The product we build is not a simple artifact anyway so nowhere in our build is the unique artifact refered. Hope it helps. Eric. Adrian Tarau wrote: Hi, It is possible to create 2 jars in the same maven project? Thanks. - 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]