您好我是Maven的新手,我正在尝试创建一个Maven项目:
具有仅从Artifactory拉出的依赖项
只有工件才会发布到Artifactory 可以更改工件发布的位置(Integration或Dev) 发布的工件可以用作依赖项
发布到Integration时,maven pom文件将能够传递在构建输出中无法访问/查看的凭据
连接到不需要构建/发布的工件(可以在本地发布)
可以在命令行上构建项目而不需要在机器上进行eclipse
目前这是我对Maven Pom文件的代码:
<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">
<repositories>
<repository>
<id>central</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven Quick Start Archetype</name>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<dependencies>
<dependency>
<groupId>Test</groupId>
<artifactId>Test</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
我不确定这是否设置不正确,因为这是我第一次使用Maven。
编辑:我一直在阅读建议的Jfrog网站,虽然它有所帮助但我仍然不确定我所拥有的是否正确无论如何。
<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>
<!-- The Basics -->
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<packaging>...</packaging>
<dependencies>
<dependency>
<groupId>Test</groupId>
<artifactId>Test</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<parent>...</parent>
<dependencyManagement>...</dependencyManagement>
<modules>...</modules>
<properties>...</properties>
<!-- Build Settings -->
<build>...</build>
<reporting>...</reporting>
<!-- More Project Information -->
<name>Maven Quick Start Archetype</name>
<description>...</description>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<inceptionYear>...</inceptionYear>
<licenses>...</licenses>
<developers>...</developers>
<contributors>...</contributors>
<!-- Environment Settings -->
<issueManagement>...</issueManagement>
<ciManagement>...</ciManagement>
<mailingLists>...</mailingLists>
<scm>...</scm>
<prerequisites>...</prerequisites>
<repositories>
<repository>
<id>central</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>ArtifactoryDeploy</id>
<name>ArtifactoryDeployThing</name>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
</distributionManagement>
<profiles>...</profiles>
</project>