Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Filtering issues with maven and assemblies...

$
0
0
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.

Viewing all articles
Browse latest Browse all 5648

Trending Articles