Re: mvn add test folders
Hi, I have tried moving them to src/test/resources, but I have found that if I have to create a file object of a file say abc.doc, present under src/test/resources, then new File("abc.doc").exists() returns false always, but the ClassLoader.getSystemResourceAsStream("abc.doc") != null returns true. I need access to the file object. Maria Odea Ching-5 wrote: > > You might need to write code in your unit tests for copying your test > resources from src/test/testdata to target/test-classes as I don't think > you > could set this in the plugin config. > The other alternative is to move your test resources to src/test/resources > so that it automatically gets copied in target/test-classes but you > mentioned changing the structure is not an option for you.. > > HTH, > Deng > > On Thu, May 8, 2008 at 2:24 PM, krishnan.1000 <[EMAIL PROTECTED]> > wrote: > >> >> Hi, >> >> I have a project that uses a set of sample data for unittesting on the >> project. Since there are many other developer on the project, this would >> help them simulate the same working environment. >> >> The test folders are in the project root- src/test/testdata/abc.doc and >> so >> on... This has been a standard practise in my company. >> >> However, when I run mvn test, I see that this folder is not copied under >> the >> target/test-classes folder. Is there a way to make sure that this folder >> is >> copied. Keeping the same folder structure. >> >> Thanks, >> >> Karthik Krishnan >> -- >> View this message in context: >> http://www.nabble.com/mvn-add-test-folders-tp17120968p17120968.html >> Sent from the Maven - Users mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > -- View this message in context: http://www.nabble.com/mvn-add-test-folders-tp17120968p17135234.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mvn add test folders
Hi, I have a project that uses a set of sample data for unittesting on the project. Since there are many other developer on the project, this would help them simulate the same working environment. The test folders are in the project root- src/test/testdata/abc.doc and so on... This has been a standard practise in my company. However, when I run mvn test, I see that this folder is not copied under the target/test-classes folder. Is there a way to make sure that this folder is copied. Keeping the same folder structure. Thanks, Karthik Krishnan -- View this message in context: http://www.nabble.com/mvn-add-test-folders-tp17120968p17120968.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tutorial for assembly configuation
Hi, I am using maven but I am trying to use maven assembly for the following use case Parent Module -- | A |B Depends On A |C Depends On B |D Depends On B I need to build an assembly jar of C and D from my parent, so that when i call assembly on C and D , it should package A or B in C and D. Is there such a tutorial available -- View this message in context: http://www.nabble.com/Tutorial-for-assembly-configuation-tp16765598s177p16765598.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Maven Assembly for MultiModule project
Hi Wayne, I can not help it. I just joined a project to replace a guy who left the project. So I am on an accelerated learning curve. Thanks, Karthik Wayne Fay wrote: > > It sounds like you're jumping in to complex builds with Maven2 without > really understanding how things work at a basic level. As an example > of this, you're running mvn install:install-file etc on what seems to > be a Maven project -- so you really only need to type "mvn install". > The same thing goes for your comment about "adding dependencies in all > the pom.xml even if they have been specified in the parent." So I > think you've skipped some important steps in your learning process. > > I would go back to the beginning and work your way through Better > Builds With Maven (free pdf book from devzuz.com) and Maven: The > Definitive Guide (from sonatype.com). The books are organized such > that you start out learning how Maven works internally (generally), > and then they lead through some basic examples and finally take you > through much more involved examples. > > You should be able to do this in just 1 or 2 days, and I think you > really need to invest this time now rather than attempting to hack > your poms and assemblies just to make it work. > > Wayne > > On 3/7/08, krishnan.1000 <[EMAIL PROTECTED]> wrote: >> >> >> >> >>maven-compiler-plugin >>2.1-20080129.223043-7 >> >> 1.5 >> 1.5 >> >> >> >> >>org.apache.maven.plugins >>maven-surefire-plugin >>2.4 >> >> >>testng.xml >> >> >> >> >>maven-assembly-plugin >> >> >>jar-with-dependencies >> >> >> >> true >> com.jbe.core.Foo >> >> >> >> >> >> >> >> >>../pom.xml >>0.1 >>foo-foo >>foo >> >> >> I also find that I have to include foo-b in my foo's pom.xml in order to >> compile even though, foo-a is dependent on foo-b and therefore must >> compile >> foo-b before foo-a. >> >> >> foo >> foo-a >> ${project.version} >> compile >> >> >> foo >> foo-b >> ${project.version} >> compile >> >> /dependencies> >> >> In addition, I have to add dependencies in all the pom.xml even if they >> have >> been specified in the parent pom.xml. >> >> Thanks, >> >> Karthik Krishnan >> >> >> >> krishnan.1000 wrote: >> > >> > Hi Wayne, >> > >> > I am sorry Wayne. I should have been more specific on the post. To >> answer >> > your first comment, and I do not wish to sound rude, but if I knew >> what I >> > was doing wrong, I would not have posted in the first place. >> > >> > 2. I am trying to assemble a jar of module Foo and Bar . I wish that I >> > create an executable jar with a defined main class and a classpath >> added >> > to MANIFEST.MF. So basically i want the to create foo.jar and bar.jar >> > containing all the dependencies. >> > >> > 3. I find that if i make the changes in Foo-A or FooB java classes, >> and >> > if i execute a mvn assembly:assembly, it does not build the FOO-A or >> FOO-B >> > in the .m2 repository before building Foo and Bar successfully again I >> > have to get around that by doing the following >> > >> > mvn install:install-file >> > -Dfile=/home/krishnan/project/foo-a/target/foo-a-0.1.jar >> -DgroupId=project >> > -DartifactId=foo-a -Dversion=0.1 -Dpackaging=jar -DgeneratePOM=true, >> the >> > solution I found by doing a search on one of the posts. >> > >> > and again for foo-b. I would like to avoid that and just have mvn >> > assembly:assembly do all this before creating foo.jar and bar.jar. >> > >> > >> > >> > Wayne Fay wrote: >> >> >> >> This list really works better if you post what you've done and then >> >> tell us why its not working the way you wanted, or an error message >> >> you got, etc. Looking at what you sent, I have no idea if it is >> >> working how you expect or
Re: Maven Assembly for MultiModule project
maven-compiler-plugin 2.1-20080129.223043-7 1.5 1.5 org.apache.maven.plugins maven-surefire-plugin 2.4 testng.xml maven-assembly-plugin jar-with-dependencies true com.jbe.core.Foo ../pom.xml 0.1 foo-foo foo I also find that I have to include foo-b in my foo's pom.xml in order to compile even though, foo-a is dependent on foo-b and therefore must compile foo-b before foo-a. foo foo-a ${project.version} compile foo foo-b ${project.version} compile /dependencies> In addition, I have to add dependencies in all the pom.xml even if they have been specified in the parent pom.xml. Thanks, Karthik Krishnan krishnan.1000 wrote: > > Hi Wayne, > > I am sorry Wayne. I should have been more specific on the post. To answer > your first comment, and I do not wish to sound rude, but if I knew what I > was doing wrong, I would not have posted in the first place. > > 2. I am trying to assemble a jar of module Foo and Bar . I wish that I > create an executable jar with a defined main class and a classpath added > to MANIFEST.MF. So basically i want the to create foo.jar and bar.jar > containing all the dependencies. > > 3. I find that if i make the changes in Foo-A or FooB java classes, and > if i execute a mvn assembly:assembly, it does not build the FOO-A or FOO-B > in the .m2 repository before building Foo and Bar successfully again I > have to get around that by doing the following > > mvn install:install-file > -Dfile=/home/krishnan/project/foo-a/target/foo-a-0.1.jar -DgroupId=project > -DartifactId=foo-a -Dversion=0.1 -Dpackaging=jar -DgeneratePOM=true, the > solution I found by doing a search on one of the posts. > > and again for foo-b. I would like to avoid that and just have mvn > assembly:assembly do all this before creating foo.jar and bar.jar. > > > > Wayne Fay wrote: >> >> This list really works better if you post what you've done and then >> tell us why its not working the way you wanted, or an error message >> you got, etc. Looking at what you sent, I have no idea if it is >> working how you expect or not. >> >> Sending your pom and assembly.xml file is probably not going to give >> you the results you are hoping for. So, send a reply and be more clear >> about what you've got vs what you want etc. >> >> Wayne >> >> On 3/6/08, krishnan.1000 <[EMAIL PROTECTED]> wrote: >>> >>> Hi, >>> >>> I am a Maven newbie and I hope this is not a stupid question. I am >>> trying >>> to create two Maven assembly jars for modules Foo and Bar. My project -- >>> | >>> |--- Bar >>> |--- Foo >>> |Foo-A >>> |--- Foo-B >>> >>> >>> This is my project structure. In this project, FOO-A is dependent on >>> Foo-B >>> and Bar ,Foo are dependent upon FOO-A. I am trying to build assembly >>> jars >>> for both the for both Foo and Bar modules. Can you please help me? >>> >>> My project pom is as follows. >>> >>> >>>Bar >>>Foo >>>Foo-A >>>Foo-B >>> >>> >>> >>> >>> log4j >>> log4j >>> 1.2.13 >>> compile >>> >>> >>>.. >>> >>> >>> >>> >>> >>>maven-assembly-plugin >>> >>> >>>assembly.xml >>> >>> gnu >>> >>> >>> >>> >>> >>> >>> apache.snapshots >>> http://people.apache.org/repo/m2-snapshot-repository/ >>> >>> >>> >>> My assembly.xml >>> >>> >>> jar-with-dependencies >>> >>>jar >>> >>> false >>> >>> >>> target/classes >>> / >>> >>> >>> >>> >>> / >>> false >>> runtime >>> >>> >>> >>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Maven-Assembly-for-MultiModule-project-tp15885942s177p15885942.html >>> Sent from the Maven - Users mailing list archive at Nabble.com. >>> >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- View this message in context: http://www.nabble.com/Maven-Assembly-for-MultiModule-project-tp15885942s177p15890673.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Maven Assembly for MultiModule project
Hi Wayne, I am sorry Wayne. I should have been more specific on the post. To answer your first comment, and I do not wish to sound rude, but if I knew what I was doing wrong, I would not have posted in the first place. 2. I am trying to assemble a jar of module Foo and Bar . I wish that I create an executable jar with a defined main class and a classpath added to MANIFEST.MF. So basically i want the to create foo.jar and bar.jar containing all the dependencies. 3. I find that if i make the changes in Foo-A or FooB java classes, and if i execute a mvn assembly:assembly, it does not build the FOO-A or FOO-B in the .m2 repository before building Foo and Bar successfully again I have to get around that by doing the following mvn install:install-file -Dfile=/home/krishnan/project/foo-a/target/foo-a-0.1.jar -DgroupId=project -DartifactId=foo-a -Dversion=0.1 -Dpackaging=jar -DgeneratePOM=true, the solution I found by doing a search on one of the posts. and again for foo-b. I would like to avoid that and just have mvn assembly:assembly do all this before creating foo.jar and bar.jar. Wayne Fay wrote: > > This list really works better if you post what you've done and then > tell us why its not working the way you wanted, or an error message > you got, etc. Looking at what you sent, I have no idea if it is > working how you expect or not. > > Sending your pom and assembly.xml file is probably not going to give > you the results you are hoping for. So, send a reply and be more clear > about what you've got vs what you want etc. > > Wayne > > On 3/6/08, krishnan.1000 <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> I am a Maven newbie and I hope this is not a stupid question. I am >> trying >> to create two Maven assembly jars for modules Foo and Bar. My project -- >> | >> |--- Bar >> |--- Foo >> |Foo-A >> |--- Foo-B >> >> >> This is my project structure. In this project, FOO-A is dependent on >> Foo-B >> and Bar ,Foo are dependent upon FOO-A. I am trying to build assembly jars >> for both the for both Foo and Bar modules. Can you please help me? >> >> My project pom is as follows. >> >> >>Bar >>Foo >>Foo-A >>Foo-B >> >> >> >> >> log4j >> log4j >> 1.2.13 >> compile >> >> >>.. >> >> >> >> >> >>maven-assembly-plugin >> >> >>assembly.xml >> >> gnu >> >> >> >> >> >> >> apache.snapshots >> http://people.apache.org/repo/m2-snapshot-repository/ >> >> >> >> My assembly.xml >> >> >> jar-with-dependencies >> >>jar >> >> false >> >> >> target/classes >> / >> >> >> >> >> / >> false >> runtime >> >> >> >> >> >> -- >> View this message in context: >> http://www.nabble.com/Maven-Assembly-for-MultiModule-project-tp15885942s177p15885942.html >> Sent from the Maven - Users mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Maven-Assembly-for-MultiModule-project-tp15885942s177p15890574.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Maven Assembly for MultiModule project
Hi, I am a Maven newbie and I hope this is not a stupid question. I am trying to create two Maven assembly jars for modules Foo and Bar. My project -- | |--- Bar |--- Foo |Foo-A |--- Foo-B This is my project structure. In this project, FOO-A is dependent on Foo-B and Bar ,Foo are dependent upon FOO-A. I am trying to build assembly jars for both the for both Foo and Bar modules. Can you please help me? My project pom is as follows. Bar Foo Foo-A Foo-B log4j log4j 1.2.13 compile .. maven-assembly-plugin assembly.xml gnu apache.snapshots http://people.apache.org/repo/m2-snapshot-repository/ My assembly.xml jar-with-dependencies jar false target/classes / / false runtime -- View this message in context: http://www.nabble.com/Maven-Assembly-for-MultiModule-project-tp15885942s177p15885942.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie Question. Handling the module dependencies
Hi Wayne, Suppose, I have a situation where foo-utils is a dependency on some other project not under the foo directory. What can I do to add the dependency in the pom.xml Thanks, Karthik Wayne Fay wrote: > > If you want to have both modules built when you change code in one, > you must build from the parent (which in your case seems to be foo). > > foo > --foo-utils > --foo-core > > There is no other option. > > Wayne > > On 3/5/08, krishnan.1000 <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> I am working on a project which has two modules on the same hierarchy >> level >> foo-utils and foo-core. The foo-core has a dependency on foo-util. If I >> try >> to change something in foo-util, I have to build foo-util before I build >> foo-core. I would like to avoid that by having foo-util built before >> foo-core is when mvn compile is executed in foo-core directory. I have >> seen >> posts where the dependent modules >> >> Is there a better way to handle dependencies. In my foo-core pom.xml, >> this >> is what I have. >> >> >> >> >> foo >> foo-utils >> ${project.version} >> compile >> >> >> >> Is there anything else that I can do otherwise? >> >> Thanks, >> >> Karthik >> -- >> View this message in context: >> http://www.nabble.com/Newbie-Question.-Handling-the-module-dependencies-tp15855637s177p15855637.html >> Sent from the Maven - Users mailing list archive at Nabble.com. >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Newbie-Question.-Handling-the-module-dependencies-tp15855637s177p15860640.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie Question. Handling the module dependencies
Hi, I am working on a project which has two modules on the same hierarchy level foo-utils and foo-core. The foo-core has a dependency on foo-util. If I try to change something in foo-util, I have to build foo-util before I build foo-core. I would like to avoid that by having foo-util built before foo-core is when mvn compile is executed in foo-core directory. I have seen posts where the dependent modules Is there a better way to handle dependencies. In my foo-core pom.xml, this is what I have. foo foo-utils ${project.version} compile Is there anything else that I can do otherwise? Thanks, Karthik -- View this message in context: http://www.nabble.com/Newbie-Question.-Handling-the-module-dependencies-tp15855637s177p15855637.html Sent from the Maven - Users mailing list archive at Nabble.com.
Re: Create one jar including all dependencies
Hi, Thanks for all your help. I used maven assembly plugin for my needs. I wanted to know if there is a way to add time stamp to the package that is generated. Thanks, Karthik Krishnan krishnan.1000 wrote: > > Thanks for the help. We used the maven assembly plugin to create a > executable jar. Is it possible to create two executable jars for the same > package. I could have have another plugin node for maven assembly > > krishnan.1000 wrote: >> >> Hi, >> >> I am a Maven newbie. So please forgive my ignorance. I am using Maven 2x >> for project and dependency management. I am creating a jar package. My >> project requires that the jar be deployed on a remote server. I can >> create a jar of all the classes. I would like to create a mega jar with >> all the expanded dependent jars in the generated jars. Is there a command >> for this or do I have to create a customized goal for this? >> >> Thanks, >> >> Karthik >> > > -- View this message in context: http://www.nabble.com/Create-one-jar-including-all-dependencies-tp15622033s177p15772003.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Create one jar including all dependencies
Thanks for the help. We used the maven assembly plugin to create a executable jar. Is it possible to create two executable jars for the same package. I could have have another plugin node for maven assembly krishnan.1000 wrote: > > Hi, > > I am a Maven newbie. So please forgive my ignorance. I am using Maven 2x > for project and dependency management. I am creating a jar package. My > project requires that the jar be deployed on a remote server. I can create > a jar of all the classes. I would like to create a mega jar with all the > expanded dependent jars in the generated jars. Is there a command for this > or do I have to create a customized goal for this? > > Thanks, > > Karthik > -- View this message in context: http://www.nabble.com/Create-one-jar-including-all-dependencies-tp15622033s177p15723152.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Create one jar including all dependencies
Hi, I am a Maven newbie. So please forgive my ignorance. I am using Maven 2x for project and dependency management. I am creating a jar package. My project requires that the jar be deployed on a remote server. I can create a jar of all the classes. I would like to create a mega jar with all the expanded dependent jars in the generated jars. Is there a command for this or do I have to create a customized goal for this? Thanks, Karthik -- View this message in context: http://www.nabble.com/Create-one-jar-including-all-dependencies-tp15622033s177p15622033.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Maven does not compile:org.codehaus.plexus:plexus-compiler-javac:jar:1.6-SNAPSHOT
Hi , I am a rookie using Maven. I have got this error. I have created this pom and I dont know what is causing this error. I looked at the forum but I did not understand what was being discussed%-O Please help me. Thanks, Karthik 1) org.codehaus.plexus:plexus-compiler-javac:jar:1.6-SNAPSHOT Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.codehaus.plexus -DartifactId=plexus-compiler-javac -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.codehaus.plexus -DartifactId=plexus-compiler-javac -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) org.apache.maven.plugins:maven-compiler-plugin:maven-plugin:2.1-SNAPSHOT 2) org.codehaus.plexus:plexus-compiler-javac:jar:1.6-SNAPSHOT 2) org.codehaus.plexus:plexus-compiler-api:jar:1.6-SNAPSHOT Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.codehaus.plexus -DartifactId=plexus-compiler-api -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.codehaus.plexus -DartifactId=plexus-compiler-api -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) org.apache.maven.plugins:maven-compiler-plugin:maven-plugin:2.1-SNAPSHOT 2) org.codehaus.plexus:plexus-compiler-api:jar:1.6-SNAPSHOT 3) org.codehaus.plexus:plexus-compiler-manager:jar:1.6-SNAPSHOT Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.codehaus.plexus -DartifactId=plexus-compiler-manager -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.codehaus.plexus -DartifactId=plexus-compiler-manager -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) org.apache.maven.plugins:maven-compiler-plugin:maven-plugin:2.1-SNAPSHOT 2) org.codehaus.plexus:plexus-compiler-manager:jar:1.6-SNAPSHOT -- View this message in context: http://www.nabble.com/Maven-does-not-compile%3Aorg.codehaus.plexus%3Aplexus-compiler-javac%3Ajar%3A1.6-SNAPSHOT-tp15447362s177p15447362.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]