使用部署插件

时间:2016-04-26 14:08:06

标签: java eclipse maven maven-deploy-plugin

我正在使用maven deploy plugin将工件部署到存储库。

<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>

我有一个要求,我必须从settings.xml获取repositoryId和url。我可以指向我的settings.xml并获取repositoryId和url并避免在pom中进行分发管理。

0 个答案:

没有答案