Set output paths for WEB/META-INF extra resources with conditional properties.
This commit is contained in:
parent
e1c2282b2d
commit
3ba0723681
119
pom.xml
119
pom.xml
|
@ -157,22 +157,6 @@
|
|||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}</directory>
|
||||
<includes>
|
||||
<include>LICENSE.md</include>
|
||||
</includes>
|
||||
<targetPath>${basedir}/target/classes/META-INF/</targetPath>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/resources/META-INF</directory>
|
||||
<targetPath>${basedir}/target/classes/META-INF/</targetPath>
|
||||
</resource><resource>
|
||||
<directory>${project.basedir}/src/main/resources/WEB-INF</directory>
|
||||
<targetPath>${basedir}/target/classes/WEB-INF/</targetPath>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
|
@ -334,16 +318,8 @@
|
|||
<url>${repository.releases.url}</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}</directory>
|
||||
<includes>
|
||||
<include>LICENSE.md</include>
|
||||
</includes>
|
||||
<targetPath>META-INF</targetPath>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
@ -473,15 +449,6 @@
|
|||
</repository>
|
||||
</distributionManagement>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}</directory>
|
||||
<includes>
|
||||
<include>LICENSE.md</include>
|
||||
</includes>
|
||||
<targetPath>META-INF</targetPath>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
@ -618,6 +585,8 @@
|
|||
</executions>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
|
@ -880,7 +849,7 @@
|
|||
</pluginManagement>
|
||||
|
||||
|
||||
<!-- attached to all life-cycles -->
|
||||
<!-- attached to all profiles -->
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
|
@ -921,18 +890,69 @@
|
|||
<version>${plugin.build.helper.version}</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.7</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>print</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<echo>******** Displaying value of *.outputDirectory properties ********</echo>
|
||||
<echo>project.metainf.outputDirectory=${project.metainf.outputDirectory}</echo>
|
||||
<echo>project.webinf.outputDirectory=${project.webinf.outputDirectory}</echo>
|
||||
</tasks>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>set-vars</id>
|
||||
<phase>validate</phase>
|
||||
<configuration>
|
||||
<exportAntProperties>true</exportAntProperties>
|
||||
<target>
|
||||
<condition property="isService">
|
||||
<contains string="${project.packaging}" substring="war" />
|
||||
</condition>
|
||||
<condition property="project.webinf.outputDirectory"
|
||||
value="${project.build.directory}/${project.build.finalName}/WEB-INF">
|
||||
<isset property="isService" />
|
||||
</condition>
|
||||
<condition property="project.metainf.outputDirectory"
|
||||
value="${project.build.directory}/${project.build.finalName}/META-INF">
|
||||
<isset property="isService" />
|
||||
</condition>
|
||||
<!-- Properties in ant are immutable, so the following assignments
|
||||
will only take place if the properties are not yet set. -->
|
||||
<property name="project.webinf.outputDirectory"
|
||||
value="${project.build.outputDirectory}/WEB-INF" />
|
||||
|
||||
<property name="project.metainf.outputDirectory"
|
||||
value="${project.build.outputDirectory}/META-INF" />
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>${plugin.resources.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-web-inf</id>
|
||||
<phase>validate</phase>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/target/classes/WEB-INF/</outputDirectory>
|
||||
<outputDirectory>${project.webinf.outputDirectory}</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>gcube/extra-resources/WEB-INF</directory>
|
||||
|
@ -943,12 +963,12 @@
|
|||
</execution>
|
||||
<execution>
|
||||
<id>copy-meta-inf</id>
|
||||
<phase>validate</phase>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/target/classes/META-INF/</outputDirectory>
|
||||
<outputDirectory>${project.metainf.outputDirectory}</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>gcube/extra-resources/META-INF</directory>
|
||||
|
@ -957,6 +977,25 @@
|
|||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-license</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.metainf.outputDirectory}</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}</directory>
|
||||
<includes>
|
||||
<include>LICENSE.md</include>
|
||||
</includes>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
@ -1032,7 +1071,7 @@
|
|||
<plugin.deploy.version>3.0.0-M1</plugin.deploy.version>
|
||||
<plugin.plaintext.version>1.0.0</plugin.plaintext.version>
|
||||
<plugin.jar.version>3.1.2</plugin.jar.version>
|
||||
<plugin.war.version>3.2.3</plugin.war.version>
|
||||
<plugin.war.version>3.3.1</plugin.war.version>
|
||||
<plugin.assembly.version>2.6</plugin.assembly.version>
|
||||
<plugin.compiler.version>3.8.1</plugin.compiler.version>
|
||||
<plugin.source.version>2.1.2</plugin.source.version>
|
||||
|
|
Loading…
Reference in New Issue