Skip deployment when the project version is not consistent with the active profile.
This commit is contained in:
parent
2d0ad9bc35
commit
58c5232e6c
102
pom.xml
102
pom.xml
|
@ -130,6 +130,42 @@
|
|||
<url>${repository.snapshots.readwrite}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- sets the only.when.is.snapshot.used property to true if SNAPSHOT was used,
|
||||
to the project version otherwise -->
|
||||
<id>build-helper-regex-is-snapshot-used</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>regex-property</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<name>skip.when.is.release.used</name>
|
||||
<value>${project.version}</value>
|
||||
<regex>^((?!.*-SNAPSHOT).)*$</regex>
|
||||
<replacement>true</replacement>
|
||||
<failIfNoMatch>false</failIfNoMatch>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.0.0-M1</version>
|
||||
<configuration>
|
||||
<skip>${skip.when.is.release.used}</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
|
@ -164,6 +200,41 @@
|
|||
<url>${repository.snapshots.readwrite}</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- sets the only.when.is.snapshot.used property to true if SNAPSHOT was used,
|
||||
to the project version otherwise -->
|
||||
<id>build-helper-regex-is-snapshot-used</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>regex-property</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<name>skip.when.is.release.used</name>
|
||||
<value>${project.version}</value>
|
||||
<regex>^((?!.*-SNAPSHOT).)*$</regex>
|
||||
<replacement>true</replacement>
|
||||
<failIfNoMatch>false</failIfNoMatch>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.0.0-M1</version>
|
||||
<configuration>
|
||||
<skip>${skip.when.is.release.used}</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
|
@ -233,6 +304,37 @@
|
|||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- sets the only.when.is.snapshot.used property to true if SNAPSHOT was used,
|
||||
to the project version otherwise -->
|
||||
<id>build-helper-regex-is-snapshot-used</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>regex-property</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<name>skip.when.is.snapshot.used</name>
|
||||
<value>${project.version}</value>
|
||||
<regex>.*-SNAPSHOT$</regex>
|
||||
<replacement>true</replacement>
|
||||
<failIfNoMatch>false</failIfNoMatch>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.0.0-M1</version>
|
||||
<configuration>
|
||||
<skip>${skip.when.is.snapshot.used}</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}-${project.version}-${gcube.release.number}-${buildNumber}</finalName>
|
||||
</build>
|
||||
|
|
Loading…
Reference in New Issue