Cannot access parsedVersion value in pom properties

邮差的信 提交于 2020-01-16 01:17:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!