我正在使用 Maven 部署插件将工件部署到存储库。
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>none</phase>
</execution>
<execution>
<id>aqua-deploy</id>
<phase>package</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<file>./deploy/sample.zip</file>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
<artifactId>standalonehostrelease</artifactId>
<generatePom>false</generatePom>
<packaging>zip</packaging>
<repositoryId>${project.distributionManagement.snapshotRepository.id}</repositoryId>
<url>${project.distributionManagement.snapshotRepository.url}</url>
</configuration>
</execution>
</executions>
</plugin>
目前我已经在 pom.xml 中定义了 distributionManagement 来获取 repositoryId 和 url。
<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<name>name</name>
<urlurl</url>
</snapshotRepository>
<repository>
<id>central</id>
<name>name</name>
<urlurl</url>
</repository>
</distributionManagement>
我有一个要求,我必须从setting.xml中获取repositoryId和url。是否可以指向我的settings.xml并获取repositoryId和url并避免在pom中进行分发管理。