问题
i am using the maven plugin:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>parse-version</id>
<goals>
<goal>parse-version</goal>
</goals>
</execution>
</executions>
</plugin>
to parse the project version. It works fine:
[INFO] --- build-helper-maven-plugin:3.0.0:parse-version (parse-version)
[INFO]
[INFO] --- maven-antrun-plugin:1.1:run (default)
[INFO] Executing tasks
[echo] Major: 2
[echo] Minor: 0
[echo] Incremental: 0
[echo] Qualifier: SNAPSHOT
[echo] BuildNumber: 0
but if i want to use the property parsedVersion.majorVersion in profile properties, it can't resolved.
<profiles>
<profile>
<id>local</id>
<properties>
<majorVersion>${myMajorVersion}</majorVersion>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
<properties>
<myMajorVersion>${parsedVersion.majorVersion}</myMajorVersion>
Any Idea?
来源:https://stackoverflow.com/questions/50153395/cannot-access-parsedversion-value-in-pom-properties