您好,我一直在嘗試創建一個適當的Maven構建版本。我創造了我的pom.xml文件,該文件是這樣的:使用Maven構建
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>XO Artifactory</name>
<url>artifactory:8081/artifactory/webapp/home.html?0</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
我想有構建發佈到artifactory的,我也想有建立依賴關係是artifactory的爲好。爲了構建發佈到artifactory,它將在settings.xml中正確設置?
將Settings.xml:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>artifactory:8081/artifactory/webapp/home.html?0</id>
<username>mhopper</username>
<password>*******</password>
</server>
</servers>
</settings>
你正在運行的所有行家的命令已經盡力做到這一點?如果是這樣,你可以分享他們嗎? –
現在我正在使用「mvn package」 – Macauley
你會想看看部署階段 - https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html –