maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julien Martin <bal...@gmail.com>
Subject Using filtered resources with the maven assembly plugin and the jar-with-dependencies descriptorRef
Date Tue, 04 Mar 2014 11:33:19 GMT
Hello,

I am trying to filter resources before they are "fed" to  the maven
assembly plugin (with a jar-with-dependencies) to no avail.

Here are the relevant portions of my POM.xml:

...

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

...
            <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/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/filters/prod.properties</filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
...

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>dev-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <archive>
                                <manifest>
                                    <addClasspath>true</addClasspath>
                                    <mainClass>com.ids.main.Main</mainClass>
                                </manifest>
                            </archive>
                            <descriptorRefs>

<descriptorRef>jar-with-dependencies</descriptorRef>
                            </descriptorRefs>
                            <filters>

<filter>src/main/filters/dev.properties</filter>
                            </filters>

<finalName>IDS-dev-${project.version}</finalName>
                            <appendAssemblyId>false</appendAssemblyId>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


Can anyone please help?

Regards,

Julien.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message