Re: Exclude some classes when package a jar.
I often exclude classes by redefining their scope as in test 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: > > … > > > … > > > > maven-compiler-plugin > > > > **/ > MyDeploymentRestrictedClass.java > > > > > > > > > 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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > - > 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]
Re: Exclude some classes when package a jar.
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: … … maven-compiler-plugin **/ MyDeploymentRestrictedClass.java 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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Exclude some classes when package a jar.
On 4/25/07, Trevor Torrez <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Exclude some classes when package a jar.
How would you "post process" a jar and what phase would that process be bound to? On 4/11/07, Jerome Lacoste <[EMAIL PROTECTED]> wrote: On 4/11/07, JesseLiu <[EMAIL PROTECTED]> wrote: > All, > I have a jar project. When packaging, I want some specified class excuded from the jar file. How should I do ? > > Thanks for any suggestions! not sure if this is possible before the packaging. You can always post-process your jar to remove some classes, but I wonder why you need that What kind of classes do you need to remove ? Jerome - 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]
Re: Exclude some classes when package a jar.
On 4/11/07, JesseLiu <[EMAIL PROTECTED]> wrote: All, I have a jar project. When packaging, I want some specified class excuded from the jar file. How should I do ? Thanks for any suggestions! not sure if this is possible before the packaging. You can always post-process your jar to remove some classes, but I wonder why you need that What kind of classes do you need to remove ? Jerome - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Exclude some classes when package a jar.
All, I have a jar project. When packaging, I want some specified class excuded from the jar file. How should I do ? Thanks for any suggestions!