maven
maven copied to clipboard
Support for project.version in profile evaluation
Affected version
3.9.11
Bug description
I use the current profile:
<profiles>
<profile>
<id>snapshot</id>
<activation>
<property>
<name>project.version</name>
<value>.*-SNAPSHOT</value>
</property>
</activation>
<properties>
<deploy.id>nexus-da-snapshots</deploy.id>
<deploy.url>https://nexus.exterieur.dassault-aviation.com:8446/repository/da-maven-snapshots/</deploy.url>
</properties>
</profile>
<profile>
<id>release</id>
<activation>
<property>
<name>project.version</name>
<value>^(?!.*-SNAPSHOT$).*$</value>
</property>
</activation>
<properties>
<deploy.id>nexus-da-releases</deploy.id>
<deploy.url>https://nexus.exterieur.dassault-aviation.com:8446/repository/da-maven-releases/</deploy.url>
</properties>
</profile>
<profile>
<id>platform-windows</id>
<activation>
<os><family>windows</family></os>
</activation>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>jdk-windows</artifactId>
<version>${jdk-platform.version}</version>
<type>zip</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>download-jdk</id>
<phase>deploy</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.oracle</includeGroupIds>
<includeArtifactIds>jdk-windows</includeArtifactIds>
<includeTypes>zip</includeTypes>
<outputDirectory>${jdkUnzipDir}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.panteleyev</groupId>
<artifactId>jpackage-maven-plugin</artifactId>
<version>1.7.1</version>
<executions>
<execution>
<id>create-jpackage</id>
<phase>deploy</phase>
<goals>
<goal>jpackage</goal>
</goals>
<configuration>
<type>APP_IMAGE</type>
<mainClass>com.dassault.cameo4ecoa.launcher.Launcher</mainClass>
<input>${project.basedir}/../distrib/target/cameo4ecoa-distrib</input>
<name>${appName}</name>
<mainJar>CAMEO4ECOA-${project.version}.jar</mainJar>
<runtimeImage>${jdkUnzipDir}</runtimeImage>
<destination>${project.build.directory}/jpackage</destination>
<icon>Cameo4ECOA.ico</icon>
<winConsole>true</winConsole>
<!-- can't use SNAPSHOT version here -->
<appVersion>1.0.0</appVersion>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>zip-jpackage</id>
<phase>deploy</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<zip destfile="${project.build.directory}/${appName}-jpackage.zip"
basedir="${project.build.directory}/jpackage"
includes="**/*"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<skip>true</skip>
</configuration>
</execution>
<execution>
<id>jpackage-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<artifactId>${project.artifactId}</artifactId>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
<packaging>zip</packaging>
<file>${project.build.directory}/${appName}-jpackage.zip</file>
<repositoryId>${deploy.id}</repositoryId>
<url>${deploy.url}</url>
<generatePom>true</generatePom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>platform-linux</id>
<activation>
<os><family>linux</family></os>
</activation>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>jdk-linux</artifactId>
<version>${jdk-platform.version}</version>
<type>zip</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>download-jdk</id>
<phase>deploy</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.oracle</includeGroupIds>
<includeArtifactIds>jdk-linux</includeArtifactIds>
<includeTypes>zip</includeTypes>
<outputDirectory>${jdkUnzipDir}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.panteleyev</groupId>
<artifactId>jpackage-maven-plugin</artifactId>
<version>1.7.1</version>
<executions>
<execution>
<id>create-jpackage</id>
<phase>deploy</phase>
<goals>
<goal>jpackage</goal>
</goals>
<configuration>
<type>APP_IMAGE</type>
<mainClass>com.dassault.cameo4ecoa.launcher.Launcher</mainClass>
<input>${project.basedir}/../distrib/target/cameo4ecoa-distrib</input>
<name>${appName}</name>
<mainJar>CAMEO4ECOA-${project.version}.jar</mainJar>
<runtimeImage>${jdkUnzipDir}</runtimeImage>
<destination>${project.build.directory}/jpackage</destination>
<icon>Cameo4ECOA.ico</icon>
<winConsole>true</winConsole>
<!-- can't use SNAPSHOT version here -->
<appVersion>1.0.0</appVersion>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>zip-jpackage</id>
<phase>deploy</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<zip destfile="${project.build.directory}/${appName}-jpackage.zip"
basedir="${project.build.directory}/jpackage"
includes="**/*"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<skip>true</skip>
</configuration>
</execution>
<execution>
<id>jpackage-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<artifactId>${project.artifactId</artifactId>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
<packaging>zip</packaging>
<file>${project.build.directory}/${appName}-jpackage.zip</file>
<repositoryId>${deploy.id}</repositoryId>
<url>${deploy.url}</url>
<generatePom>true</generatePom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
And it appears when I do a mvn deploy that the property deploy.url is not set to its supposed value when the maven-deploy-plugin is called.
One work-around is to use -Psnapshot on the command-line but I don't understant why this is not activated automatically.
It's propbably more like a feature request then.
Supported properties are system/user properties and packaging, but project.version is not one of those.
Also regular expressions are not supported in property actiovation