내 POM에 set a custom system property에 gmaven-plugin을 사용하고 있습니다. 이것은 maven-antrun-plugin을 사용하여 속성을 성공적으로 에코 할 수 있기 때문에 효과가있는 것 같습니다. 그러나 maven-deploy-plugin은 속성을 완전히 인식하지 못하기 때문에이를 해결할 수 없습니다.왜 maven-deploy-plugin이 내 사용자 정의 시스템 속성을 해결할 수 없습니까?
POM의관련 부분 :
<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
System.setProperty("nodotsversion", "${env.PATCH_VERSION}".replace('.', ''))
</source>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version><!-- 1.2 in central -->
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<configuration>
<target>
<echo message="${nodotsversion}" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.6</version>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<repositoryId>artifactory</repositoryId>
<packaging>sql</packaging>
<generatePom>true</generatePom>
<url>${project.distributionManagement.snapshotRepository.url}</url>
<groupId>com.company.product</groupId>
<artifactId>patch${nodotsversion}</artifactId>
<version>1.0.0-SNAPSHOT</version>
<file>${WORKSPACE}/myfile.sql</file>
</configuration>
</plugin>
</plugins>
</build>
내가 mvn clean install deploy:deploy-file
이것을 실행하면, 나는 다음과 같은 오류 얻을 :
Caused by: org.apache.maven.plugin.MojoExecutionException: The artifact information is incomplete or not valid:
[0] 'artifactId' with value 'patch${nodotsversion}' does not match a valid id pattern.
왜 수 받는다는-antrun - 플러그인이 해결됩니다 내 사용자 정의 시스템 속성, maven-deploy-plugin은 그렇지 않습니까?
'mvn clean deploy'는 작동합니까? – Raghuram
@Raghuram - 아니요.이 POM으로 만든 유일한 아티팩트는 .sql 파일이며 Maven에는 sql 패키지 유형이 없습니다. 즉, deploy : deploy-file을 대신 실행해야합니다. –