You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marc Schneider <ma...@gmail.com> on 2008/09/04 15:07:02 UTC
Excluding a file in resources when compiling
Hello,
I have this file : src/main/resources/faces-config.xml
After mvn clean compile this file is put at the root of the classes
directory.
But I don't want that, so I tried :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.4</target>
<encoding>UTF-8</encoding>
<excludes>
<exclude>**/faces-config.xml</exclude>
</excludes>
</configuration>
</plugin>
But this doesn't work.
Looking at the trace of maven however I can see :
(f) excludes = [**/src/main/resources/*]
So I don't understand. Could somebody help ?
Thanks,
Marc.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Excluding a file in resources when compiling
Posted by Marc SCHNEIDER <ms...@freelance.com>.
Geoffrey Wiseman a écrit :
> On Thu, Sep 4, 2008 at 9:07 AM, Marc Schneider
> <ma...@gmail.com>wrote:
>
>> I have this file : src/main/resources/faces-config.xml
>>
>> After mvn clean compile this file is put at the root of the classes
>> directory.
>>
>> But I don't want that, so I tried :
>
>
> Can I ask what you do want to do with it, if not put it in the class root?
> That's normally what Maven would do with a "main resource" which is mostly
> what I would want to do with things like configuration files, but since you
> don't want that, I'm wondering what you do want.
>
> - Geoffrey
In fact this file is put during a further phase in the WEB-INF directory
because lines are added to this file.
So I just don't want to have this file twice (in classes and WEB-INF)
knowing that WEB-INF is the right place (avoids confusion).
Marc.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Excluding a file in resources when compiling
Posted by Marc Schneider <ma...@gmail.com>.
Geoffrey Wiseman a écrit :
> On Thu, Sep 4, 2008 at 9:07 AM, Marc Schneider
> <ma...@gmail.com>wrote:
>
>> I have this file : src/main/resources/faces-config.xml
>>
>> After mvn clean compile this file is put at the root of the classes
>> directory.
>>
>> But I don't want that, so I tried :
>
>
> Can I ask what you do want to do with it, if not put it in the class root?
> That's normally what Maven would do with a "main resource" which is mostly
> what I would want to do with things like configuration files, but since you
> don't want that, I'm wondering what you do want.
>
> - Geoffrey
In fact this file is put during a further phase in the WEB-INF directory
because lines are added to this file.
So I just don't want to have this file twice (in classes and WEB-INF)
knowing that WEB-INF is the right place (avoids confusion).
Marc.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Excluding a file in resources when compiling
Posted by Geoffrey Wiseman <ge...@gmail.com>.
On Thu, Sep 4, 2008 at 9:07 AM, Marc Schneider
<ma...@gmail.com>wrote:
> I have this file : src/main/resources/faces-config.xml
>
> After mvn clean compile this file is put at the root of the classes
> directory.
>
> But I don't want that, so I tried :
Can I ask what you do want to do with it, if not put it in the class root?
That's normally what Maven would do with a "main resource" which is mostly
what I would want to do with things like configuration files, but since you
don't want that, I'm wondering what you do want.
- Geoffrey
--
Geoffrey Wiseman
Re: Excluding a file in resources when compiling
Posted by Marc Schneider <ma...@gmail.com>.
Yes sorry you're right in fact this works.
Thanks for your help.
Marc.
Edelson, Justin a écrit :
> Hmm. That works for me. If you run mvn -X, do you see that the exclude is being passed to the resources plugin? Should look something like this:
>
> [DEBUG] (f) resources = [Resource {targetPath: null, filtering: false, FileSet {directory: YOUR_PROJECT_DIRECTORY\src\main\resources, PatternSet [includes: {}, excludes: {**/faces-config.xml}]}}]
>
> ________________________________
>
> From: Marc Schneider [mailto:marc.schneider73@gmail.com]
> Sent: Thu 9/4/2008 10:27 AM
> To: Maven Users List
> Subject: Re: Excluding a file in resources when compiling
>
>
>
> Thanks for your answer.
>
> So I add this in the build section :
>
> <resources>
> <resource>
> <directory>src/main/resources</directory>
> <excludes>
> <exclude>**/faces-config.xml</exclude>
> </excludes>
> </resource>
> </resources>
>
> but after mvn clean compile, I still can see the faces-config.xml file
> in the classes directory.
>
> I don't understand why.
>
> Marc.
>
> Edelson, Justin a écrit :
>> Resources aren't "compiled". See http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html for information on how to exclude resource files.
>>
>> Justin
>>
>> ________________________________
>>
>> From: Marc Schneider [mailto:marc.schneider73@gmail.com]
>> Sent: Thu 9/4/2008 9:07 AM
>> To: Maven Users List
>> Subject: Excluding a file in resources when compiling
>>
>>
>>
>> Hello,
>>
>> I have this file : src/main/resources/faces-config.xml
>>
>> After mvn clean compile this file is put at the root of the classes
>> directory.
>>
>> But I don't want that, so I tried :
>>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-compiler-plugin</artifactId>
>> <configuration>
>> <source>1.6</source>
>> <target>1.4</target>
>> <encoding>UTF-8</encoding>
>> <excludes>
>> <exclude>**/faces-config.xml</exclude>
>> </excludes>
>> </configuration>
>> </plugin>
>>
>> But this doesn't work.
>> Looking at the trace of maven however I can see :
>> (f) excludes = [**/src/main/resources/*]
>>
>> So I don't understand. Could somebody help ?
>>
>> Thanks,
>> Marc.
>>
>>
>> ---------------------------------------------------------------------
>> 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 a file in resources when compiling
Posted by "Edelson, Justin" <Ju...@mtvstaff.com>.
Hmm. That works for me. If you run mvn -X, do you see that the exclude is being passed to the resources plugin? Should look something like this:
[DEBUG] (f) resources = [Resource {targetPath: null, filtering: false, FileSet {directory: YOUR_PROJECT_DIRECTORY\src\main\resources, PatternSet [includes: {}, excludes: {**/faces-config.xml}]}}]
________________________________
From: Marc Schneider [mailto:marc.schneider73@gmail.com]
Sent: Thu 9/4/2008 10:27 AM
To: Maven Users List
Subject: Re: Excluding a file in resources when compiling
Thanks for your answer.
So I add this in the build section :
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>**/faces-config.xml</exclude>
</excludes>
</resource>
</resources>
but after mvn clean compile, I still can see the faces-config.xml file
in the classes directory.
I don't understand why.
Marc.
Edelson, Justin a écrit :
> Resources aren't "compiled". See http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html for information on how to exclude resource files.
>
> Justin
>
> ________________________________
>
> From: Marc Schneider [mailto:marc.schneider73@gmail.com]
> Sent: Thu 9/4/2008 9:07 AM
> To: Maven Users List
> Subject: Excluding a file in resources when compiling
>
>
>
> Hello,
>
> I have this file : src/main/resources/faces-config.xml
>
> After mvn clean compile this file is put at the root of the classes
> directory.
>
> But I don't want that, so I tried :
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.6</source>
> <target>1.4</target>
> <encoding>UTF-8</encoding>
> <excludes>
> <exclude>**/faces-config.xml</exclude>
> </excludes>
> </configuration>
> </plugin>
>
> But this doesn't work.
> Looking at the trace of maven however I can see :
> (f) excludes = [**/src/main/resources/*]
>
> So I don't understand. Could somebody help ?
>
> Thanks,
> Marc.
>
>
> ---------------------------------------------------------------------
> 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 a file in resources when compiling
Posted by Marc Schneider <ma...@gmail.com>.
Thanks for your answer.
So I add this in the build section :
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>**/faces-config.xml</exclude>
</excludes>
</resource>
</resources>
but after mvn clean compile, I still can see the faces-config.xml file
in the classes directory.
I don't understand why.
Marc.
Edelson, Justin a écrit :
> Resources aren't "compiled". See http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html for information on how to exclude resource files.
>
> Justin
>
> ________________________________
>
> From: Marc Schneider [mailto:marc.schneider73@gmail.com]
> Sent: Thu 9/4/2008 9:07 AM
> To: Maven Users List
> Subject: Excluding a file in resources when compiling
>
>
>
> Hello,
>
> I have this file : src/main/resources/faces-config.xml
>
> After mvn clean compile this file is put at the root of the classes
> directory.
>
> But I don't want that, so I tried :
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.6</source>
> <target>1.4</target>
> <encoding>UTF-8</encoding>
> <excludes>
> <exclude>**/faces-config.xml</exclude>
> </excludes>
> </configuration>
> </plugin>
>
> But this doesn't work.
> Looking at the trace of maven however I can see :
> (f) excludes = [**/src/main/resources/*]
>
> So I don't understand. Could somebody help ?
>
> Thanks,
> Marc.
>
>
> ---------------------------------------------------------------------
> 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 a file in resources when compiling
Posted by "Edelson, Justin" <Ju...@mtvstaff.com>.
Resources aren't "compiled". See http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html for information on how to exclude resource files.
Justin
________________________________
From: Marc Schneider [mailto:marc.schneider73@gmail.com]
Sent: Thu 9/4/2008 9:07 AM
To: Maven Users List
Subject: Excluding a file in resources when compiling
Hello,
I have this file : src/main/resources/faces-config.xml
After mvn clean compile this file is put at the root of the classes
directory.
But I don't want that, so I tried :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.4</target>
<encoding>UTF-8</encoding>
<excludes>
<exclude>**/faces-config.xml</exclude>
</excludes>
</configuration>
</plugin>
But this doesn't work.
Looking at the trace of maven however I can see :
(f) excludes = [**/src/main/resources/*]
So I don't understand. Could somebody help ?
Thanks,
Marc.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org