You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ian Brandt <ia...@ianbrandt.com> on 2006/10/06 01:41:41 UTC
[m2] Exclude resources from Jar?
Hi,
<http://maven.apache.org/guides/getting-started/index.html#How%20do%20add%20resources%20to%20my%20JAR?>
nicely explains how to include resources in a Jar. Is there a way
exclude them?
I have a couple .properties files that I'd like to have available in
my distribution assembly outside of the Jar, so they can be modified
by the end user without repacking. I do still want them copied and
filtered into my target/classes directory, so they'll be available on
the classpath during debugging, which appears to rule out
<resource><excludes>. (I'm open to alternative strategies.) Instead
of being packed in the Jar I'd like to copy them to the ./lib dir of
my distribution assembly.
Thanks,
Ian
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Exclude resources from Jar?
Posted by Wendy Smoak <ws...@gmail.com>.
On 10/6/06, Ian Brandt <ia...@ianbrandt.com> wrote:
> Thanks for the suggestion, but unfortunately that seems to exclude the
> resources from the build entirely. I want them to be filtered and
> copied to the target/classes directory (so they're on the classpath
> when debugging), and included in my distribution assembly, just
> outside of the the Jar.
Try adding a profile to your build that copies the files into
'classes'. You'll use this during debugging (not sure what that
means, exactly...).
Then when you're ready to relase or deploy the jar, leave off the
profile, and you won't get the files. You'll need to be sure to 'mvn
clean' before building the jar to release, or it might still contain
the unwanted files.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Exclude resources from Jar?
Posted by Ian Brandt <ia...@ianbrandt.com>.
Neeraj Bisht wrote:
> hi
> just use <excludes>
> <exclude> </eclude>
> </exclude>
>
> tag in resource to exclude any resource
Thanks for the suggestion, but unfortunately that seems to exclude the
resources from the build entirely. I want them to be filtered and
copied to the target/classes directory (so they're on the classpath
when debugging), and included in my distribution assembly, just
outside of the the Jar.
~Ian
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Exclude resources from Jar?
Posted by Neeraj Bisht <ne...@daffodildb.com>.
hi
just use <excludes>
<exclude> </eclude>
</exclude>
tag in resource to exclude any resource
Regards
Neeraj
On 10/6/06, Ian Brandt <ia...@ianbrandt.com> wrote:
>
>
> Hi,
>
> <
> http://maven.apache.org/guides/getting-started/index.html#How%20do%20add%20resources%20to%20my%20JAR?
> >
> nicely explains how to include resources in a Jar. Is there a way
> exclude them?
>
> I have a couple .properties files that I'd like to have available in
> my distribution assembly outside of the Jar, so they can be modified
> by the end user without repacking. I do still want them copied and
> filtered into my target/classes directory, so they'll be available on
> the classpath during debugging, which appears to rule out
> <resource><excludes>. (I'm open to alternative strategies.) Instead
> of being packed in the Jar I'd like to copy them to the ./lib dir of
> my distribution assembly.
>
> Thanks,
>
> Ian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>