maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Redden <jred...@matrix-consultants.com>
Subject Re: Exclude some classes when package a jar.
Date Wed, 11 Jul 2007 20:45:30 GMT
I often exclude classes by redefining their scope

as in

<scope>test</scope>  

Includes jars that I need for junit that don't end up in the war file.

hope this helps.


-John R.


On Wed, 2007-07-11 at 12:12 -0600, Tommy Knowlton wrote:
> I have a class that is a specialized implementation of a given  
> interface, and this specialized implementation cannot be distributed  
> to all customers. I wasn't able to find a way to exclude the class  
> from the jar, but I was able to exclude it from compilation, by  
> reflectively loading it if it's on the runtime classpath... thereby  
> erasing all compile-time dependence on this class.
> 
> Here's the POM excerpt:
> <project>
> 	…
>    <profiles>
>      <profile>
> 	…
> 	<build>
> 		<plugin>
>                  <artifactId>
>                      maven-compiler-plugin
>                  </artifactId>
>                  <configuration>
>                      <excludes>
>                          <exclude>**/ 
> MyDeploymentRestrictedClass.java</exclude>
>                      </excludes>
>                  </configuration>
>              </plugin>
> 	</build>
>      <profile>
>    <profiles>
> </project>
> 
> I realize it's not exactly the answer to the question you were  
> asking, but if your situation is similar (class is runtime-optional),  
> it may work for you.
> 
> HTH,
> \Tommy
> 
> On  30 Apr 2007, at 16:53 , Jerome Lacoste wrote:
> 
> > On 4/25/07, Trevor Torrez <jackdimm@gmail.com> wrote:
> >> How would you "post process" a jar and what phase would that process
> >> be bound to?
> >
> > using the assembly plugin during the package phase ?
> >
> > J
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


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


Mime
View raw message