Hi Julien,

could you please create a simple example project with files and description what you expect the result should be...and what the current results are...

The best would be having a github project which can be cloned to analyze the problem...or may be a tar.gz / zip file which contains such a project...

Kind regards
Karl-Heinz Marbaise

On 3/13/14 4:58 PM, Julien Martin wrote:
Hello,

I am having issues with maven filtering. My resources are not filtered...

I want to generate a jar with dependencies with custom filtering.

Can anyone please help? Here is my configuration (*pom.xml* and
*assembly.xml*):




*Resources:*

    <resources>
             <resource>
                 <directory>src/main/resources</directory>
                 <filtering>true</filtering>
             </resource>
         </resources>

*Plugins:*

<plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-resources-plugin</artifactId>
                 <version>2.6</version>
                 <executions>
                     <execution>
                         <id>copy-resources</id>
                         <phase>validate</phase>
                         <goals>
                             <goal>copy-resources</goal>
                         </goals>
                         <configuration>
                             <outputDirectory>target</outputDirectory>
                             <resources>
                                 <resource>

<directory>misc/external-resources</directory>
                                 </resource>
                             </resources>
                         </configuration>
                     </execution>
                     <execution>
                         <id>dev</id>
                         <phase>process-resources</phase>
                         <goals>
                             <goal>resources</goal>
                         </goals>
                         <configuration>
                             <outputDirectory>target/dev</outputDirectory>
                             <filters>

<filter>src/main/resources/filters/dev.properties</filter>
                             </filters>
                         </configuration>
                     </execution>
                     <execution>
                         <id>prod</id>
                         <phase>process-resources</phase>
                         <goals>
                             <goal>resources</goal>
                         </goals>
                         <configuration>
                             <outputDirectory>target/prod</outputDirectory>
                             <filters>

<filter>src/main/resources/filters/prod.properties</filter>
                             </filters>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>build-helper-maven-plugin</artifactId>
                 <version>1.1</version>
                 <executions>
                     <execution>
                         <phase>generate-sources</phase>
                         <goals>
                             <goal>add-source</goal>
                         </goals>
                         <configuration>
                             <sources>

<source>${project.generated-sources.directory}</source>
                             </sources>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>
             <plugin>
                 <artifactId>maven-assembly-plugin</artifactId>
                 <version>2.4</version>
                 <executions>
                     <execution>
                         <id>dev</id>
                         <phase>package</phase>
                         <goals>
                             <goal>single</goal>
                         </goals>
                         <configuration>
                             <archive>
                                 <manifest>
                                     <addClasspath>true</addClasspath>

<mainClass>com.otcexids.main.Main</mainClass>
                                 </manifest>
                             </archive>
                             <descriptors>

<descriptor>src/main/resources/assemble/assembly.xml</descriptor>
                             </descriptors>
                             <filters>

<filter>src/main/resources/filters/dev.properties</filter>
                             </filters>
                             <finalName>IDS-dev</finalName>
                             <appendAssemblyId>false</appendAssemblyId>
                         </configuration>
                     </execution>
                     <execution>
                         <id>prod</id>
                         <phase>package</phase>
                         <goals>
                             <goal>single</goal>
                         </goals>
                         <configuration>
                             <archive>
                                 <manifest>
                                     <addClasspath>true</addClasspath>

<mainClass>com.otcexids.main.Main</mainClass>
                                 </manifest>
                             </archive>
                             <descriptors>

<descriptor>src/main/resources/assemble/assembly.xml</descriptor>
                             </descriptors>
                             <filters>

<filter>src/main/resources/filters/prod.properties</filter>
                             </filters>
                             <finalName>IDS-prod</finalName>
                             <appendAssemblyId>false</appendAssemblyId>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>


*Assembly.xml*


<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="
http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2";
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
           xsi:schemaLocation="
http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
http://maven.apache.org/xsd/assembly-1.1.2.xsd";>
     <id>jar-with-dependencies</id>
     <formats>
         <format>jar</format>
     </formats>
     <includeBaseDirectory>false</includeBaseDirectory>
     <dependencySets>
         <dependencySet>
             <outputDirectory>/</outputDirectory>
             <useProjectArtifact>true</useProjectArtifact>
             <unpack>true</unpack>
             <scope>runtime</scope>
         </dependencySet>
     </dependencySets>
     <files>
         <file>
             <filtered>true</filtered>
             <outputDirectory>wsdl/brokerhub</outputDirectory>

<source>src/main/resources/wsdl/brokerhub/soapinterface_1.2.wsdl</source>
         </file>
         <file>
             <filtered>true</filtered>
             <outputDirectory>wsdl/finderpro</outputDirectory>

<source>src/main/resources/wsdl/finderpro/B2T_DataModel.asmx.wsdl</source>
         </file>
         <file>
             <filtered>false</filtered>
             <outputDirectory>wsdl/website</outputDirectory>

<source>src/main/resources/wsdl/website/WSWebsiteIDS.wsdl</source>
         </file>

     </files>
</assembly>

Can anyone please help?

Regards,

J.



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to