You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "anil.kumar" <an...@gmail.com> on 2009/10/29 06:38:41 UTC

Selectively include and exclude class file while building the artifact

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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Selectively include and exclude class file while building the artifact

Posted by Stephen Connolly <st...@gmail.com>.
specify includes/excludes relative to the path in the jar.

2009/10/29 anil.kumar <an...@gmail.com>

>
> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Selectively include and exclude class file while building the artifact

Posted by "anil.kumar" <an...@gmail.com>.
As requested I have added more details about the pom.xml . I hope this would
be sufficient . 

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                             http://maven.apache.org/maven-v4_0_0.xsd" 
basedir=".">
     <modelVersion>4.0.0</modelVersion>
     <groupId>HIS</groupId>
     <artifactId>HIS</artifactId>
     <version>1.0</version>
     <packaging>jar</packaging>

  <name>HIS Project</name>
  
  	<dependencies> // Only part  of the dependencies are mentioned  
  		<dependency>
  		        <groupId>xerces</groupId>
  		        <artifactId>xerces</artifactId>
  		        <version>2.4.0</version>
  		 </dependency>
    
    
    		<dependency>
    			<groupId>xml-apis</groupId>
    			<artifactId>xml-apis</artifactId>
    			<version>2.0.0</version>
    		</dependency>
    
    		<dependency>
    			<groupId>commons-digester</groupId>
    			<artifactId>commons-digester</artifactId>
    			<version>1.3</version>
  		</dependency>
      
  	<dependencies> 
  <build>
  
 <plugins>
 
   <plugin>
   	<groupId>org.codehaus.mojo</groupId>
	<artifactId>build-helper-maven-plugin</artifactId>
	<version>1.3</version>
	<executions>
	  <execution>
	        <id>first</id>
	        <goals>
	        <goal>add-source</goal>
	        </goals>
	        <phase>generate-sources</phase>
	        <configuration>
	        <sources>
	        
		<source>F:/ARL/HIS/src/</source> //Compile all the files under source
directory 		
	        </sources>
	        </configuration>
	        </execution>
	        </executions>

   </plugin>
   
   <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
           <execution>
                <phase>package</phase>
                <goals>
                    <goal>jar</goal> // Execute the goal using "mvn
org.apache.maven.plugins:maven-jar-plugin:jar"
                 </goals>
                <configuration>
                <classifier>client</classifier>
                    
                 <excludes>     	
   	          	
   	             <exclude>**/com/ADHOC/*</exclude>  	   	         	
   			
                 </excludes> 
                  
                    
                                        
                  </configuration>
            </execution>
         </executions>
   </plugin>  
    
  </plugins>	
	<outputDirectory>classes</outputDirectory>
</build>	

</project>

Stephen Connolly-2 wrote:
> 
> giv e us a more full pom snippet
> 
> 2009/10/29 anil.kumar <an...@gmail.com>
> 
>>
>> There are files making use of package com.ADHOC which  i need to ignore
>> while
>> making the jar file.
>> So I tried to exclude them in the jar by using the following
>>
>> <exclude>com/ADHOC /**</exclude>
>> <exclude>**/com/ADHOC /**</exclude>
>> In both the ways it didn't work out.
>>
>>
>> Stephen Connolly-2 wrote:
>> >
>> > are you using backslashes?
>> >
>> > jar files do not have backslashes
>> >
>> > 2009/10/29 anil.kumar <an...@gmail.com>
>> >
>> >>
>> >> Wanted to know one thing .Is the issue related to the way I have named
>> >> the
>> >> path to be mentioned in <exclude > tag.
>> >> I have tried out all possible combination's . Still not working.
>> >>
>> >> Stephen Connolly-2 wrote:
>> >> >
>> >> > well just clobber it with a **/ as the prefix ;-)
>> >> >
>> >> > 2009/10/29 anil.kumar <an...@gmail.com>
>> >> >
>> >> >>
>> >> >> Tried this as well. Not working.
>> >> >>
>> >> >> Stephen Connolly-2 wrote:
>> >> >> >
>> >> >> > you might require a leading /
>> >> >> >
>> >> >> > 2009/10/29 anil.kumar <an...@gmail.com>
>> >> >> >
>> >> >> >>
>> >> >> >> Stephen,
>> >> >> >> I thought by emailing is the only way you will be notified when
>> I
>> >> >> reply
>> >> >> >> to
>> >> >> >> the topic unless you sub scribe to the thread. Hence forth I
>> will
>> >> only
>> >> >> >> post
>> >> >> >> my queries in the forum. Thanks for letting me know.
>> >> >> >>
>> >> >> >> Coming to the topic ,it didn't work out. I will give this a try
>> >> once
>> >> >> more
>> >> >> >> else I may have to look for other possible alternatives like
>> >> >> >> "maven-assembly-plugin".
>> >> >> >>
>> >> >> >> Thanks for your time.
>> >> >> >>
>> >> >> >>
>> >> >> >> Stephen Connolly-2 wrote:
>> >> >> >> >
>> >> >> >> > 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 <an...@gmail.com>
>> >> >> >> >
>> >> >> >> >> 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 <an...@gmail.com>
>> >> >> >> >> >
>> >> >> >> >> >>
>> >> >> >> >> >> 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: users-unsubscribe@maven.apache.org
>> >> >> >> >> >> For additional commands, e-mail:
>> users-help@maven.apache.org
>> >> >> >> >> >>
>> >> >> >> >> >>
>> >> >> >> >> >
>> >> >> >> >> >
>> >> >> >> >> Quoted from:
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26107471.html
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >
>> >> >> >> >
>> >> >> >>
>> >> >> >> --
>> >> >> >> View this message in context:
>> >> >> >>
>> >> >>
>> >>
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26109882.html
>> >> >> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> ---------------------------------------------------------------------
>> >> >> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> >> >> For additional commands, e-mail: users-help@maven.apache.org
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26110534.html
>> >> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> >> For additional commands, e-mail: users-help@maven.apache.org
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26111113.html
>> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: users-help@maven.apache.org
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26111566.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26112725.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Selectively include and exclude class file while building the artifact

Posted by Stephen Connolly <st...@gmail.com>.
giv e us a more full pom snippet

2009/10/29 anil.kumar <an...@gmail.com>

>
> There are files making use of package com.ADHOC which  i need to ignore
> while
> making the jar file.
> So I tried to exclude them in the jar by using the following
>
> <exclude>com/ADHOC /**</exclude>
> <exclude>**/com/ADHOC /**</exclude>
> In both the ways it didn't work out.
>
>
> Stephen Connolly-2 wrote:
> >
> > are you using backslashes?
> >
> > jar files do not have backslashes
> >
> > 2009/10/29 anil.kumar <an...@gmail.com>
> >
> >>
> >> Wanted to know one thing .Is the issue related to the way I have named
> >> the
> >> path to be mentioned in <exclude > tag.
> >> I have tried out all possible combination's . Still not working.
> >>
> >> Stephen Connolly-2 wrote:
> >> >
> >> > well just clobber it with a **/ as the prefix ;-)
> >> >
> >> > 2009/10/29 anil.kumar <an...@gmail.com>
> >> >
> >> >>
> >> >> Tried this as well. Not working.
> >> >>
> >> >> Stephen Connolly-2 wrote:
> >> >> >
> >> >> > you might require a leading /
> >> >> >
> >> >> > 2009/10/29 anil.kumar <an...@gmail.com>
> >> >> >
> >> >> >>
> >> >> >> Stephen,
> >> >> >> I thought by emailing is the only way you will be notified when I
> >> >> reply
> >> >> >> to
> >> >> >> the topic unless you sub scribe to the thread. Hence forth I will
> >> only
> >> >> >> post
> >> >> >> my queries in the forum. Thanks for letting me know.
> >> >> >>
> >> >> >> Coming to the topic ,it didn't work out. I will give this a try
> >> once
> >> >> more
> >> >> >> else I may have to look for other possible alternatives like
> >> >> >> "maven-assembly-plugin".
> >> >> >>
> >> >> >> Thanks for your time.
> >> >> >>
> >> >> >>
> >> >> >> Stephen Connolly-2 wrote:
> >> >> >> >
> >> >> >> > 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 <an...@gmail.com>
> >> >> >> >
> >> >> >> >> 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 <an...@gmail.com>
> >> >> >> >> >
> >> >> >> >> >>
> >> >> >> >> >> 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: users-unsubscribe@maven.apache.org
> >> >> >> >> >> For additional commands, e-mail:
> users-help@maven.apache.org
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >
> >> >> >> >> >
> >> >> >> >> Quoted from:
> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26107471.html
> >> >> >> >>
> >> >> >> >>
> >> >> >> >
> >> >> >> >
> >> >> >>
> >> >> >> --
> >> >> >> View this message in context:
> >> >> >>
> >> >>
> >>
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26109882.html
> >> >> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >> >> >>
> >> >> >>
> >> >> >>
> >> ---------------------------------------------------------------------
> >> >> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> >> >> For additional commands, e-mail: users-help@maven.apache.org
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26110534.html
> >> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> >> For additional commands, e-mail: users-help@maven.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26111113.html
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26111566.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Selectively include and exclude class file while building the artifact

Posted by "anil.kumar" <an...@gmail.com>.
There are files making use of package com.ADHOC which  i need to ignore while
making the jar file.
So I tried to exclude them in the jar by using the following

<exclude>com/ADHOC /**</exclude> 
<exclude>**/com/ADHOC /**</exclude> 
In both the ways it didn't work out.


Stephen Connolly-2 wrote:
> 
> are you using backslashes?
> 
> jar files do not have backslashes
> 
> 2009/10/29 anil.kumar <an...@gmail.com>
> 
>>
>> Wanted to know one thing .Is the issue related to the way I have named
>> the
>> path to be mentioned in <exclude > tag.
>> I have tried out all possible combination's . Still not working.
>>
>> Stephen Connolly-2 wrote:
>> >
>> > well just clobber it with a **/ as the prefix ;-)
>> >
>> > 2009/10/29 anil.kumar <an...@gmail.com>
>> >
>> >>
>> >> Tried this as well. Not working.
>> >>
>> >> Stephen Connolly-2 wrote:
>> >> >
>> >> > you might require a leading /
>> >> >
>> >> > 2009/10/29 anil.kumar <an...@gmail.com>
>> >> >
>> >> >>
>> >> >> Stephen,
>> >> >> I thought by emailing is the only way you will be notified when I
>> >> reply
>> >> >> to
>> >> >> the topic unless you sub scribe to the thread. Hence forth I will
>> only
>> >> >> post
>> >> >> my queries in the forum. Thanks for letting me know.
>> >> >>
>> >> >> Coming to the topic ,it didn't work out. I will give this a try
>> once
>> >> more
>> >> >> else I may have to look for other possible alternatives like
>> >> >> "maven-assembly-plugin".
>> >> >>
>> >> >> Thanks for your time.
>> >> >>
>> >> >>
>> >> >> Stephen Connolly-2 wrote:
>> >> >> >
>> >> >> > 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 <an...@gmail.com>
>> >> >> >
>> >> >> >> 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 <an...@gmail.com>
>> >> >> >> >
>> >> >> >> >>
>> >> >> >> >> 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: users-unsubscribe@maven.apache.org
>> >> >> >> >> For additional commands, e-mail: users-help@maven.apache.org
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >
>> >> >> >> >
>> >> >> >> Quoted from:
>> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26107471.html
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26109882.html
>> >> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> >> For additional commands, e-mail: users-help@maven.apache.org
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26110534.html
>> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: users-help@maven.apache.org
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26111113.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26111566.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Selectively include and exclude class file while building the artifact

Posted by Stephen Connolly <st...@gmail.com>.
are you using backslashes?

jar files do not have backslashes

2009/10/29 anil.kumar <an...@gmail.com>

>
> Wanted to know one thing .Is the issue related to the way I have named the
> path to be mentioned in <exclude > tag.
> I have tried out all possible combination's . Still not working.
>
> Stephen Connolly-2 wrote:
> >
> > well just clobber it with a **/ as the prefix ;-)
> >
> > 2009/10/29 anil.kumar <an...@gmail.com>
> >
> >>
> >> Tried this as well. Not working.
> >>
> >> Stephen Connolly-2 wrote:
> >> >
> >> > you might require a leading /
> >> >
> >> > 2009/10/29 anil.kumar <an...@gmail.com>
> >> >
> >> >>
> >> >> Stephen,
> >> >> I thought by emailing is the only way you will be notified when I
> >> reply
> >> >> to
> >> >> the topic unless you sub scribe to the thread. Hence forth I will
> only
> >> >> post
> >> >> my queries in the forum. Thanks for letting me know.
> >> >>
> >> >> Coming to the topic ,it didn't work out. I will give this a try once
> >> more
> >> >> else I may have to look for other possible alternatives like
> >> >> "maven-assembly-plugin".
> >> >>
> >> >> Thanks for your time.
> >> >>
> >> >>
> >> >> Stephen Connolly-2 wrote:
> >> >> >
> >> >> > 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 <an...@gmail.com>
> >> >> >
> >> >> >> 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 <an...@gmail.com>
> >> >> >> >
> >> >> >> >>
> >> >> >> >> 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: users-unsubscribe@maven.apache.org
> >> >> >> >> For additional commands, e-mail: users-help@maven.apache.org
> >> >> >> >>
> >> >> >> >>
> >> >> >> >
> >> >> >> >
> >> >> >> Quoted from:
> >> >> >>
> >> >> >>
> >> >>
> >>
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26107471.html
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26109882.html
> >> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> >> For additional commands, e-mail: users-help@maven.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26110534.html
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26111113.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Selectively include and exclude class file while building the artifact

Posted by "anil.kumar" <an...@gmail.com>.
Wanted to know one thing .Is the issue related to the way I have named the
path to be mentioned in <exclude > tag.
I have tried out all possible combination's . Still not working.

Stephen Connolly-2 wrote:
> 
> well just clobber it with a **/ as the prefix ;-)
> 
> 2009/10/29 anil.kumar <an...@gmail.com>
> 
>>
>> Tried this as well. Not working.
>>
>> Stephen Connolly-2 wrote:
>> >
>> > you might require a leading /
>> >
>> > 2009/10/29 anil.kumar <an...@gmail.com>
>> >
>> >>
>> >> Stephen,
>> >> I thought by emailing is the only way you will be notified when I
>> reply
>> >> to
>> >> the topic unless you sub scribe to the thread. Hence forth I will only
>> >> post
>> >> my queries in the forum. Thanks for letting me know.
>> >>
>> >> Coming to the topic ,it didn't work out. I will give this a try once
>> more
>> >> else I may have to look for other possible alternatives like
>> >> "maven-assembly-plugin".
>> >>
>> >> Thanks for your time.
>> >>
>> >>
>> >> Stephen Connolly-2 wrote:
>> >> >
>> >> > 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 <an...@gmail.com>
>> >> >
>> >> >> 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 <an...@gmail.com>
>> >> >> >
>> >> >> >>
>> >> >> >> 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: users-unsubscribe@maven.apache.org
>> >> >> >> For additional commands, e-mail: users-help@maven.apache.org
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> Quoted from:
>> >> >>
>> >> >>
>> >>
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26107471.html
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26109882.html
>> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: users-help@maven.apache.org
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26110534.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26111113.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Selectively include and exclude class file while building the artifact

Posted by Stephen Connolly <st...@gmail.com>.
well just clobber it with a **/ as the prefix ;-)

2009/10/29 anil.kumar <an...@gmail.com>

>
> Tried this as well. Not working.
>
> Stephen Connolly-2 wrote:
> >
> > you might require a leading /
> >
> > 2009/10/29 anil.kumar <an...@gmail.com>
> >
> >>
> >> Stephen,
> >> I thought by emailing is the only way you will be notified when I reply
> >> to
> >> the topic unless you sub scribe to the thread. Hence forth I will only
> >> post
> >> my queries in the forum. Thanks for letting me know.
> >>
> >> Coming to the topic ,it didn't work out. I will give this a try once
> more
> >> else I may have to look for other possible alternatives like
> >> "maven-assembly-plugin".
> >>
> >> Thanks for your time.
> >>
> >>
> >> Stephen Connolly-2 wrote:
> >> >
> >> > 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 <an...@gmail.com>
> >> >
> >> >> 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 <an...@gmail.com>
> >> >> >
> >> >> >>
> >> >> >> 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: users-unsubscribe@maven.apache.org
> >> >> >> For additional commands, e-mail: users-help@maven.apache.org
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >> Quoted from:
> >> >>
> >> >>
> >>
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26107471.html
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26109882.html
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26110534.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Selectively include and exclude class file while building the artifact

Posted by "anil.kumar" <an...@gmail.com>.
Tried this as well. Not working.

Stephen Connolly-2 wrote:
> 
> you might require a leading /
> 
> 2009/10/29 anil.kumar <an...@gmail.com>
> 
>>
>> Stephen,
>> I thought by emailing is the only way you will be notified when I reply
>> to
>> the topic unless you sub scribe to the thread. Hence forth I will only
>> post
>> my queries in the forum. Thanks for letting me know.
>>
>> Coming to the topic ,it didn't work out. I will give this a try once more
>> else I may have to look for other possible alternatives like
>> "maven-assembly-plugin".
>>
>> Thanks for your time.
>>
>>
>> Stephen Connolly-2 wrote:
>> >
>> > 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 <an...@gmail.com>
>> >
>> >> 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 <an...@gmail.com>
>> >> >
>> >> >>
>> >> >> 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: users-unsubscribe@maven.apache.org
>> >> >> For additional commands, e-mail: users-help@maven.apache.org
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> Quoted from:
>> >>
>> >>
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26107471.html
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26109882.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26110534.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Selectively include and exclude class file while building the artifact

Posted by Stephen Connolly <st...@gmail.com>.
you might require a leading /

2009/10/29 anil.kumar <an...@gmail.com>

>
> Stephen,
> I thought by emailing is the only way you will be notified when I reply to
> the topic unless you sub scribe to the thread. Hence forth I will only post
> my queries in the forum. Thanks for letting me know.
>
> Coming to the topic ,it didn't work out. I will give this a try once more
> else I may have to look for other possible alternatives like
> "maven-assembly-plugin".
>
> Thanks for your time.
>
>
> Stephen Connolly-2 wrote:
> >
> > 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 <an...@gmail.com>
> >
> >> 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 <an...@gmail.com>
> >> >
> >> >>
> >> >> 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: users-unsubscribe@maven.apache.org
> >> >> For additional commands, e-mail: users-help@maven.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >> Quoted from:
> >>
> >>
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26107471.html
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26109882.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Selectively include and exclude class file while building the artifact

Posted by "anil.kumar" <an...@gmail.com>.
Stephen, 
I thought by emailing is the only way you will be notified when I reply to
the topic unless you sub scribe to the thread. Hence forth I will only post
my queries in the forum. Thanks for letting me know. 

Coming to the topic ,it didn't work out. I will give this a try once more
else I may have to look for other possible alternatives like
"maven-assembly-plugin".

Thanks for your time.


Stephen Connolly-2 wrote:
> 
> 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 <an...@gmail.com>
> 
>> 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 <an...@gmail.com>
>> >
>> >>
>> >> 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: users-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: users-help@maven.apache.org
>> >>
>> >>
>> >
>> >
>> Quoted from:
>>
>> http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26107471.html
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Selectively-include-and-exclude-class-file-while-building-the-artifact-tp26107145p26109882.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org