You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gisbert Amm <gi...@webde.de> on 2005/12/22 14:44:30 UTC
Re: Can I exclude a package from the generated jar file?
maven.jar.excludes for Maven 1
(http://maven.apache.org/maven-1.x/reference/plugins/jar/properties.html)
For Maven 2 I don't know (yet).
-Gisbert
Alexander Hars wrote:
> Hi,
>
> I am trying to exclude some packages of my source tree from the
> automatically generated jar file. Is that possible?
>
> For example, if I have the following source tree
>
> +- src/ |
> +- main/
> +- java/
> +- com/
> +- mycompany/
> +- package1/
> | +- ... |
> +- package2/
> | +- ... |
> +- package3/
> | +- ... |
>
>
> Is there a way to exclude all files from package3 or a specific file
> from package3 in my jar file?
> Thanks,
>
> -Alexander
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
--
Gisbert Amm
Softwareentwickler Infrastruktur
WEB.DE GmbH
Amalienbadstraße 41 · D-76227 Karlsruhe
Tel. +49-721-94329-8530 · Fax +49-721-94329-22
gisbert.amm@webde.de · http://www.web.de/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Can I exclude a package from the generated jar file?
Posted by dan tran <da...@gmail.com>.
you can configure maven-compiler-plugin to exclude your unwanted packages or
files to be compiled in the first place. But you will not be able to
prevent javac to compile those files
if they are
referenced by other packages within the source tree. To prevent that, you
will need to use
antrun plugin ( or write your own custom plugin), bind it to compile phase,
and remove unwanted
classes in ${project.build.directory}/classes
If possible, just move those pacakges/files to another source tree to be
come another project.
-D
On 12/22/05, Gisbert Amm <gi...@webde.de> wrote:
>
> maven.jar.excludes for Maven 1
> (http://maven.apache.org/maven-1.x/reference/plugins/jar/properties.html)
>
> For Maven 2 I don't know (yet).
>
> -Gisbert
>
> Alexander Hars wrote:
> > Hi,
> >
> > I am trying to exclude some packages of my source tree from the
> > automatically generated jar file. Is that possible?
> >
> > For example, if I have the following source tree
> >
> > +- src/ |
> > +- main/
> > +- java/
> > +- com/
> > +- mycompany/
> > +- package1/
> > | +- ... |
> > +- package2/
> > | +- ... |
> > +- package3/
> > | +- ... |
> >
> >
> > Is there a way to exclude all files from package3 or a specific file
> > from package3 in my jar file?
> > Thanks,
> >
> > -Alexander
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
> --
> Gisbert Amm
> Softwareentwickler Infrastruktur
>
> WEB.DE GmbH
> Amalienbadstraße 41 · D-76227 Karlsruhe
> Tel. +49-721-94329-8530 · Fax +49-721-94329-22
> gisbert.amm@webde.de · http://www.web.de/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>