如何设置行家?

How to set up maven?

如何设置Maven(settings.xml)和Artifactory通过Artifactory访问所有仓库? 我现在的设置如下,连Maven-deploy插件都获取不到 执行。错误是在任何 repos (local + artifactory)

中都找不到
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <servers>
    <server>
      <username>xxx</username>
      <password>xxx</password>
      <id>central</id>
    </server>
    <server>
      <username>xxx</username>
      <password>xxx</password>
      <id>snapshots</id>
    </server>
  </servers>
  <mirrors>
    <mirror>
      <mirrorOf>*</mirrorOf>
      <name>repo</name>
      <url>http://[host]:[port]/artifactory/repo</url>
      <id>repo</id>
    </mirror>
  </mirrors>
  <profiles>
    <profile>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://[host]:[port]/artifactory/libs-release</url>
        </repository>
        <repository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://[host]:[port]/artifactory/libs-snapshot</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>plugins-release</name>
          <url>http://[host]:[port]/artifactory/plugins-release</url>
        </pluginRepository>
        <pluginRepository>
          <snapshots />
          <id>snapshots</id>
          <name>plugins-snapshot</name>
          <url>http://[host]:[port]/artifactory/plugins-snapshot</url>
        </pluginRepository>
      </pluginRepositories>
      <id>artifactory</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
</settings>

[host]:[port] 在文件中是真实的,[username][password] 也是如此,检查了 3 次。

[ERROR] No plugin found for prefix 'deploy' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\[username]\.m2), repo (http://[host]:[port]/artifactory/repo)] -> [Help 1]    

Artifactory 可以为您生成正确的 settings.xml 文件。在主屏幕的右侧菜单中查找 Maven Settings link。