Hello Franz,

i just use the resources-plugin but its not very useful.

OK, i will try to explain.

It's a simple webapp project as part of a bigger project. Later i need the war artifact to include it in a release zip. Some files in the war have to be filtered environment specific while building the release zip. So the war artifact is installed unfiltered in the repository. But to simplify the development i want to filter the target/artifact-0.1-SNAPSHOT directory to target/artifact-0.1-SNAPSHOT.filterd (or somewhere else) after building the war. Then it's able to use the filterd directory to test the webapp locally without calling anymore commands.

At the moment i use this code in the pom:

   <profile>
     <id>local-filter</id>
     <build>
       <resources>
         <resource>
           <directory>target/${project.build.finalName}</directory>
           <filtering>true</filtering>
           <targetPath>${project.build.finalName}.filtered</targetPath>
         </resource>
       </resources>
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-resources-plugin</artifactId>
           <configuration>
             <outputDirectory>${project.build.directory}</outputDirectory>
           </configuration>
           <executions>
             <execution>
               <id>filter files while package</id>
               <goals>
                 <goal>resources</goal>
               </goals>
               <phase>package</phase>
             </execution>
           </executions>
         </plugin>
       </plugins>
     </build>
   </profile>

The disadvantage is that the resources goal runs twice. During building the war and after that. So the files will be copied twice - not very nice.


Sebastian


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to