Anil, Please reply to the list so that others may find the solutions to the problem (i.e. let google be their friend)
To answer your question: Nope... I said the path *_in the jar_* so to exclude the class com.foo.bar.Manchu you would use <exclude>com/foo/bar/Manchu.class</exclude> to exclude the entire com.foo.bar package you would use <exclude>com/foo/bar/**</exclude> and to exclude all the dto packages you would use something like <exclude>**/dto/**</exclude> -Stephen 2009/10/29 <[email protected]> > So in my case as the jar and compiled class files are being stored in > directory "F:/ARL/HIS/src/target/ " and "F:/ARL/HIS/src/classes/ , the > relative to the class files will be "F:/ARL/HIS/src/target/../classes/ ". In > this case the jar file created should be empty but it includes all the class > files coming under classes directory. > Regards, > Anil > > Stephen Connolly-2 wrote: > > > > specify includes/excludes relative to the path in the jar. > > > > 2009/10/29 anil.kumar <[email protected]> > > > >> > >> Requirement: In initial stage I will compile all the files coming under > >> my > >> project source directory. Finally at the time of making the jar I need > to > >> selectively include and exclude certain files. The files which are to be > >> included and excluded comes under my project source directory. > >> My Project source directory : "F:/ARL/HIS/src/" > >> > >> I am able to successfully compile all the files coming under my source > >> directory. It is being saved in the location :" F:/ARL/HIS/src/classes/" > >> Sample code to include and exclude class files to make the jar file. > >> > >> <plugin> > >> <groupId>org.apache.maven.plugins</groupId> > >> <artifactId>maven-jar-plugin</artifactId> > >> <executions> > >> <execution> > >> <phase>package</phase> > >> <goals> > >> <goal>jar</goal> > >> </goals> > >> <configuration> > >> <classifier>client</classifier> > >> > >> <excludes> > >> <exclude> F:\ARL\HIS\src\classes\*.class</exclude>// > >> added for testing purpose to check if exclude tags work or not > >> </excludes> > >> </configuration> > >> </execution> > >> </executions> > >> </plugin> > >> While executing the goal "mvn > >> org.apache.maven.plugins:maven-jar-plugin:jar" > >> , for making the jar file it takes all the files coming under classes > >> directory where as i have specifically mentioned it not to be included > >> while > >> making the jar file. Where am I going wrong ? > >> -- > >> View this message in context: > >> > http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26107145.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] > >> > >> > > > > > Quoted from: > > http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26107471.html > >
