How to NOT include test resources in jar
Hi everybody, I'm trying to package my projects and everything works fine except that test resources are systematically included in the jar. No matter where I put them or what I declare in testResources they always end up in the jar. This can me problematic as some of the test can be very extensive as they can include test databases of very big test files. Since their only uses is for unit and specification testing there is absolutely no reason to include them in the final release. The project is arranged as follows : com.mypackage.pack.specific/ | \-src |--main | \-java | \-- My source tree \--test \--java |-- My test source tree \--resources |--unitTest \--SpecTest My problem is that the source tree from src/test is not included in the jar... actually this is fine but the content of resources is included at the root of the jar.. The end result in the jar is the following : specific-1.0.jar |--META-INF |\-- ... pom and properties |--com.mypackage.pack | \--My source tree compiled |--unitTest -- Why is this here ??? \--SpecTest --Why is this here too ??? want them removed here is the effective POM from my latest attempt : ?xml version=1.0?project parent artifactIdbase/artifactId groupIdcom.mypackage/groupId version1.0/version /parent modelVersion4.0.0/modelVersion groupIdcom.mypackage.pack/groupId artifactIdspecific/artifactId namespecific/name version1.0/version urlhttp://maven.apache.org/url inceptionYear2007/inceptionYear developers developer ideric/id namemyself/name /developer /developers build sourceDirectoryD:\workspace\com.mypackage.pack.specific\src\main\java/sourceDirectory scriptSourceDirectorysrc/main/scripts/scriptSourceDirectory testSourceDirectoryD:\workspace\com.mypackage.pack.specific\src\test\java/testSourceDirectory outputDirectoryD:\workspace\com.mypackage.pack.specific\target\classes/outputDirectory testOutputDirectoryD:\workspace\com.mypackage.pack.specific\target\test-classes/testOutputDirectory resources resource directoryD:\workspace\com.mypackage.pack.specific\src\main\config/directory /resource /resources testResources testResource directory/src/test/java/resources/directory /testResource /testResources directoryD:\workspace\com.mypackage.pack.specific\target/directory finalNamespecific-1.0/finalName plugins plugin artifactIdmaven-compiler-plugin/artifactId configuration source1.6/source target1.6/target /configuration /plugin plugin artifactIdmaven-help-plugin/artifactId version2.0.1/version /plugin /plugins /build repositories repository snapshots enabledfalse/enabled /snapshots idcentral/id nameMaven Repository Switchboard/name urlhttp://repo1.maven.org/maven2/url /repository /repositories pluginRepositories pluginRepository releases updatePolicynever/updatePolicy /releases snapshots enabledfalse/enabled /snapshots idcentral/id nameMaven Plugin Repository/name urlhttp://repo1.maven.org/maven2/url /pluginRepository /pluginRepositories dependencies dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.1/version scopetest/scope /dependency dependency groupIdcom.mypackage/groupId artifactIdpack/artifactId version1.0/version /dependency /dependencies reporting outputDirectorytarget/site/outputDirectory /reporting /project Thanks, Éric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to NOT include test resources in jar
Classic case... Blinded by the very light I was looking for :-) Thanks Peter, still few small problems updating the repository but I should manage... Hayes, Peter wrote: Just a shot in the dark but did you try an mvn clean package? Maybe the test resources had at some point made it into the target\classes directory... Pete -Original Message- From: Eric Daigneault [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 10, 2007 11:32 AM To: Maven Users List Subject: How to NOT include test resources in jar Hi everybody, I'm trying to package my projects and everything works fine except that test resources are systematically included in the jar. No matter where I put them or what I declare in testResources they always end up in the jar. This can me problematic as some of the test can be very extensive as they can include test databases of very big test files. Since their only uses is for unit and specification testing there is absolutely no reason to include them in the final release. The project is arranged as follows : com.mypackage.pack.specific/ | \-src |--main | \-java | \-- My source tree \--test \--java |-- My test source tree \--resources |--unitTest \--SpecTest My problem is that the source tree from src/test is not included in the jar... actually this is fine but the content of resources is included at the root of the jar.. The end result in the jar is the following : specific-1.0.jar |--META-INF |\-- ... pom and properties |--com.mypackage.pack | \--My source tree compiled |--unitTest -- Why is this here ??? \--SpecTest --Why is this here too ??? want them removed here is the effective POM from my latest attempt : ?xml version=1.0?project parent artifactIdbase/artifactId groupIdcom.mypackage/groupId version1.0/version /parent modelVersion4.0.0/modelVersion groupIdcom.mypackage.pack/groupId artifactIdspecific/artifactId namespecific/name version1.0/version urlhttp://maven.apache.org/url inceptionYear2007/inceptionYear developers developer ideric/id namemyself/name /developer /developers build sourceDirectoryD:\workspace\com.mypackage.pack.specific\src\main\java/sourceDirectory scriptSourceDirectorysrc/main/scripts/scriptSourceDirectory testSourceDirectoryD:\workspace\com.mypackage.pack.specific\src\test\java/testSourceDirectory outputDirectoryD:\workspace\com.mypackage.pack.specific\target\classes/outputDirectory testOutputDirectoryD:\workspace\com.mypackage.pack.specific\target\test-classes/testOutputDirectory resources resource directoryD:\workspace\com.mypackage.pack.specific\src\main\config/directory /resource /resources testResources testResource directory/src/test/java/resources/directory /testResource /testResources directoryD:\workspace\com.mypackage.pack.specific\target/directory finalNamespecific-1.0/finalName plugins plugin artifactIdmaven-compiler-plugin/artifactId configuration source1.6/source target1.6/target /configuration /plugin plugin artifactIdmaven-help-plugin/artifactId version2.0.1/version /plugin /plugins /build repositories repository snapshots enabledfalse/enabled /snapshots idcentral/id nameMaven Repository Switchboard/name urlhttp://repo1.maven.org/maven2/url /repository /repositories pluginRepositories pluginRepository releases updatePolicynever/updatePolicy /releases snapshots enabledfalse/enabled /snapshots idcentral/id nameMaven Plugin Repository/name urlhttp://repo1.maven.org/maven2/url /pluginRepository /pluginRepositories dependencies dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.1/version scopetest/scope /dependency dependency groupIdcom.mypackage/groupId artifactIdpack/artifactId version1.0/version /dependency /dependencies reporting outputDirectorytarget/site/outputDirectory /reporting /project Thanks, Éric - 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: Getting frustrated with maven2
Peter L. Berghold wrote: On Fri, 2007-04-06 at 11:10 -0700, Carlos Sanchez wrote: for what you say your frustrations come from the xdoclet plugin, not maven itself True enough. your config doesn't look like the docs http://mojo.codehaus.org/xdoclet-maven-plugin/usage.html OK.. I tried pasting that into my pom.xml, and this is where my understanding is no doubt flawed. Where in the pom.xml does it fit in? I tried a few different things with pretty much the same result. Maven complained about plugin being an unknown tag. Yeah.. having similar problems with creating a new archetype from instructions on the web... anyhow... This is usually because it fits inside another tag. have a look at this page, it should help you figure out where to plug the snippet in your POM. good luck Éric :D. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Howto link with unpublished jars
Excellent ... Thanks you two, provided a good solution + good reading Added the jar to the Maven repo (local)... it is quite easy to do actually once you know what the command line is.. in that regard got another question, i'll start another thread with it ÉD Wayne Fay wrote: Arguably, the second point is already handled on the same page (though its perhaps not obvious): http://maven.apache.org/general.html#tools-jar-dependency This is also discussed in detail on the Introduction to the Dependency Mechanism page: http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html Wayne On 3/28/07, Subhash Chandran [EMAIL PROTECTED] wrote: To expand the first point of Wayne, go here: http://maven.apache.org/general.html#importing-jars Probably the second point needs to be updated in this FAQ entry. Subhash. On 3/29/07, Wayne Fay [EMAIL PROTECTED] wrote: You essentially have two options: 1. Install the jar in your repo using mvn install:install-file This is the suggested route to take. 2. Declare the dependency using scopesystem/scope and provide the path to the dependency in your project (ie /lib/my.jar). For various reasons, this is not suggested. Wayne On 3/28/07, Eric Daigneault [EMAIL PROTECTED] wrote: Hi, I just started out with Maven, tho I am fairly famliar with ant and I have been looking at Maven for a while now I never had time to really get my hands dirty. Anyhow the problem I have is as follows. I have a project that uses a jar (for which I do not have source code, just jar, docs and some other support files) that is not published in any Maven repository. In the good ol days of Ant I would have put the whole thing either in a folder on server or better yet in SVN so I can tag it along the rest of the resources for building the whole app. Now with maven I am at a loss on how to get my application (a new one, not ant scripts or anything, just maven) to link with this rebel jar. All the dependencies rely on the jar to be present in a repository, either local or remote. Did I miss some plugin that would allow me to deal with what would seem to be an exception to the normal Maven way. Thanks, Éric Daigneaut - 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] -- Regards, Subhash Chandran S http://wizcrypt.wiztools.org/ - 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]
How to get online help on plugins and commands
Hi, Been using maven for a short while, and thought I really appreciate it`s advantages I find it hard to find information on what it can actually do. I noticed there is help available onilne and on the command line but I find it hard to browse. Since Maven is extremely modular, fragmented and decentralized i gather it becomes really hard to have a web site describing all available plugins and their capabilities. I have read the Maven book, maven articles, tons of maven information but have yet to find a definitive reference about maven, something akin to the JDK API for capabilities of the Java libraries... Is there a way to dynamically querry the repositories for plugins ? Is there a site dynamically created from repository content ? Is there such a project underway, knowing maven can produce information sites for a perticular project it should be possible to do this for a whole repository (POM based information about the projects, and, more specifically here about plugins, their goals and a likn to the maven generated site) ? if not is there a centralized place to discover available plugins and commands for Maven2 ? What is the general howto get information about Maven available plugins ? thanks Éric D - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to get online help on plugins and commands
Thank you Jörg, So basically there is no magic bullet here... guess I will roll up my sleeves and keep reading/googling/POMing and hacking at what others have done already. Thanks for the links also, some of them I had already, others I did not and although the quantity and depth of the information is still a bit frustrating at least knowing the plugin exist and having it's name gives a starting point. I also had a quick look at your project (great stuff btw, I started something of the likes at home but the reality of life and it's time crunches quickly caught up with me, I may get a closer look at mmm when I can) , our structure differs somewhat but still, it will help. As far as the super übersite of maven know it all I have a hunch that this is within the realm of the possible, to create a dynamic site from the content of a repository containing the plugins and components within the repository and give information about what it is and where to get more info on it. This information should be readily available in the POMs (provided developers actually fill them in :-). The eclipse plugin provides a dependencies interface that is not a bad first step in that regard. Ha.. .if we had armies of coding monkeys neurally interfaced to the ideas of the readers of this list the world would look a lot different... On this I will get back to being the good little monkey I was hired for ;-). Thankfully yours Éric :D. Joerg Hohwiller wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Eric Daigneault schrieb: Hi, Hi Eric, Been using maven for a short while, and thought I really appreciate it`s advantages I find it hard to find information on what it can actually do. I agree with you. I noticed there is help available onilne and on the command line but I find it hard to browse. Since Maven is extremely modular, fragmented and decentralized i gather it becomes really hard to have a web site describing all available plugins and their capabilities. That is the problem. I have read the Maven book, maven articles, tons of maven information but have yet to find a definitive reference about maven, something akin to the JDK API for capabilities of the Java libraries... Is there a way to dynamically querry the repositories for plugins ? Is there a site dynamically created from repository content ? Is there such a project underway, knowing maven can produce information sites for a perticular project it should be possible to do this for a whole repository (POM based information about the projects, and, more specifically here about plugins, their goals and a likn to the maven generated site) ? if not is there a centralized place to discover available plugins and commands for Maven2 ? What is the general howto get information about Maven available plugins ? Well I do not think there is THE ULTIMATE DOCUMENTATION FOR EVERYTHING ABOUT MAVEN and it will also never exist in future. But here are some hints for you to get startet: 1. There are official plugins for maven that can be found here: http://maven.apache.org/plugins/index.html 2. There are plugins not yet as official that can be found here: http://mojo.codehaus.org/ or if the links are broken - ;) - here: https://svn.codehaus.org/mojo/trunk/mojo/ 3. After reading into the available documentations the best way to learn more about maven2 ist simply by looking at all the open-source projects that use it. Watch their sites and dig in their pom.xml files how they do it. E.g. you could have a look at my project what is very modular: http://m-m-m.sourceforge.net/maven/index.html One approach to do find more of such projects is by searching for link:maven.apache.org in google. 4. If you have a specific problem you want to solve with maven, simply ask on this list if someone has a solution for it. thanks Éric D You are welcome Jörg -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGDByhmPuec2Dcv/8RAiC0AJsEGWUlPFtKYMv467+uL2L74tVyFACfUAwE NtJQG+6j2aVuZJZoyShJiHk= =S22T -END PGP SIGNATURE- - 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 link with unpublished jars
Hi, I just started out with Maven, tho I am fairly famliar with ant and I have been looking at Maven for a while now I never had time to really get my hands dirty. Anyhow the problem I have is as follows. I have a project that uses a jar (for which I do not have source code, just jar, docs and some other support files) that is not published in any Maven repository. In the good ol days of Ant I would have put the whole thing either in a folder on server or better yet in SVN so I can tag it along the rest of the resources for building the whole app. Now with maven I am at a loss on how to get my application (a new one, not ant scripts or anything, just maven) to link with this rebel jar. All the dependencies rely on the jar to be present in a repository, either local or remote. Did I miss some plugin that would allow me to deal with what would seem to be an exception to the normal Maven way. Thanks, Éric Daigneaut - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]