How to copy resource files to target/classes directory?
I have may XML files in src/main/java directory and its sub directory. When I run mvn compile, these XML files will not be copied to the target/classes directory. I know I can put these files in src/main/resources directory but it is really hard work for me. How can I let maven do this? -- View this message in context: http://www.nabble.com/How-to-copy-resource-files-to-target-classes-directory--tp3747p3747.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
Antwort: How to copy resource files to target/classes directory?
resources resource combine.children=append directory${project.build.sourceDirectory}/directory includes include**/*.xml/include /includes /resource /resources __ Diese E-Mail kann vertrauliche und geschuetzte Informationen enthalten. Wenn diese E-Mail nicht für Sie bestimmt ist, bitten wir Sie, uns unverzueglich zu informieren und sie zu loeschen. This e-mail message may contain information, which is confidential and protected. If you are not the intended recipient of this message, we ask you to inform us immediately and delete the message afterwards. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: How to copy resource files to target/classes directory?
Hello, On Thu, Feb 26, 2009 at 8:11 AM, youhaodeyi youhaod...@gmail.com wrote: I have may XML files in src/main/java directory and its sub directory. When I run mvn compile, these XML files will not be copied to the target/classes directory. I know I can put these files in src/main/resources directory but it is really hard work for me. How can I let maven do this? Maven seems like a bad choice for this. Why don't you just... bash$ tar --wildcards --exclude '*.java' --exclude '.svn' --create --directory src/main/java --file - . | tar --extract --directory src/main/resources --file - -jesse - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: How to copy resource files to target/classes directory?
You could over ride your resources directory in your pom.xml: resources !-- Log4j.xml etc -- resource directory${basedir}/src/main/java/directory /resource !-- Or you could use the following example: -- resource targetPathpath/to/destination//targetPath directory${basedir}/src/main/java/ /directory includes include**.xml/include /includes filteringfalse/filtering /resource /resources -Original Message- From: youhaodeyi [mailto:youhaod...@gmail.com] Sent: 26 February 2009 13:12 To: users@maven.apache.org Subject: How to copy resource files to target/classes directory? I have may XML files in src/main/java directory and its sub directory. When I run mvn compile, these XML files will not be copied to the target/classes directory. I know I can put these files in src/main/resources directory but it is really hard work for me. How can I let maven do this? -- View this message in context: http://www.nabble.com/How-to-copy-resource-files-to-target-classes-directory --tp3747p3747.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 __ Information from ESET NOD32 Antivirus, version of virus signature database 3891 (20090226) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __ Information from ESET NOD32 Antivirus, version of virus signature database 3891 (20090226) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: How to copy resource files to target/classes directory?
Okay, you know where those resources should be. Why is it so difficult to move the resource files to their correct directory? If you are using a version control system, and worry about moving files that other users might be working on, do a copy first, then let everyone get use to the new place. After that, delete them from the src/main/java directory. The whole process shouldn't take more than a day or two. It is possible to tell Maven to tell Maven to copy those resources from your src/main/java directory. Clovis has given you the solution, but one of the advantages of Maven is that there's a standard Maven way everything works. You know where to find the files because of the standardized directory structure. Let the developers learn the correct place where resource files should be stored, so they get use to Maven and use those job skills on their next assignment. On Thu, Feb 26, 2009 at 8:11 AM, youhaodeyi youhaod...@gmail.com wrote: I have may XML files in src/main/java directory and its sub directory. When I run mvn compile, these XML files will not be copied to the target/classes directory. I know I can put these files in src/main/resources directory but it is really hard work for me. How can I let maven do this? -- View this message in context: http://www.nabble.com/How-to-copy-resource-files-to-target-classes-directory--tp3747p3747.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 -- -- David Weintraub qazw...@gmail.com - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org