발견. build-helper-maven-plugin에는 버전의 구성 요소를 구문 분석 할 수있는 기능이 있습니다. 이 메이븐 3.3.9에서 작동
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>initialize</phase>
<id>parse-version</id>
<goals>
<goal>parse-version</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>[version] ${project.version}</echo>
<echo>[majorVersion] ${parsedVersion.majorVersion}</echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
그것은 메이븐은 http://SemVer.org 버전 사양을 사용하지 않는 것을 주목할 필요가있다. 대신에 매우 유사한 자체 컨벤션을 사용합니다. 여기에 대해 읽어보십시오 (3.3.1 "프로젝트 버전"섹션 아래) ... http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-pom-syntax.html –