You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ovidio Mallo <ov...@student.ethz.ch> on 2006/09/01 00:17:10 UTC

Re: excluding directories from jar

Hi again,

that's strange. Upon reading your post, I have tested it on a
simple project and for me, the pattern including "/**" worked
fine while the other didn't.
However, AFAIK, the "mvn jar:jar" mojo does not rebuild the
project but instead takes whatever is in the target/ directory.
So, if you haven't done this yet, you may try to clean the project
and rebuild it before assembling the JAR file as, for me, the
directory already gets excluded during the execution of "mvn compile".

Sorry, if this doesn't help either...

Regards,
   Ovidio

berndq wrote:
> Ovidio Mallo wrote:
> 
>> Hi,
>>
>> I think you should replace your exclude pattern by
>>     <exclude>conf/**</exclude>
> 
> 
> hi, thanks, I forgot to mention that I tried this already
> but it does not help.
> 
> It looks like the plugin does not see the configuration:
> 
> [DEBUG] Configuring mojo 
> 'org.apache.maven.plugins:maven-jar-plugin:2.0:jar' -->
> [DEBUG]   (f) basedir = D:\xxx
> [DEBUG]   (f) finalName = xxx-1.0-SNAPSHOT
> [DEBUG]   (f) outputDirectory = D:\xxx\target\classes
> [DEBUG]   (f) project = org.apache.maven.project.MavenProject@5a089115
> [DEBUG] -- end configuration --
> [INFO] [jar:jar]
> [INFO] Building jar: D:\xxx\target\xxx-1.0-SNAPSHOT.jar
> ...
> [DEBUG] adding directory conf/
> 
> Bernd
> 
>> HPH & Regards,
>>   Ovidio
>>
>> berndq wrote:
>>
>>> Hi,
>>>
>>> I have a maven standard directory layout:
>>>
>>>   src/main/resources
>>>
>>> and different directories there:
>>>
>>>   src/main/resources/conf
>>>   src/main/resources/images
>>>
>>>
>>> How can I exlcude the conf directory from the jar?
>>>
>>> MJAR-30 says that there is no exclude for the jar plugin
>>> but one could exclude resources.
>>>
>>> So I tried
>>>
>>>   <build>
>>>     ...
>>>     <resources>
>>>       <resource>
>>>         <directory>src/main/resources</directory>
>>>           <excludes>
>>>             <exclude>conf</exclude>
>>>           </excludes>
>>>       </resource>
>>>     </resources>
>>>   </build>
>>>
>>> in my pom but this did not help.
>>>
>>> What is wrong here? thanks for you help!
>>>
>>> Bernd
>>>
>>> ---------------------------------------------------------------------
>>> 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
> 


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


Re: excluding directories from jar

Posted by berndq <be...@gmx.net>.
Ovidio Mallo wrote:

> However, AFAIK, the "mvn jar:jar" mojo does not rebuild the
> project but instead takes whatever is in the target/ directory.
> So, if you haven't done this yet, you may try to clean the project
> and rebuild it before assembling the JAR file as, for me, the
> directory already gets excluded during the execution of "mvn compile".

that did it! Thanks!

Bernd


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