如何设置maven?

时间:2015-03-17 22:42:40

标签: maven settings artifactory

如何设置Maven(settings.xml)和Artifactory以通过Artifactory访问所有存储库? 我当前的设置如下,我甚至无法获得Maven-deploy插件 执行。错误是在任何回购(本地+神器)

中找不到它
<?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]在文件中是真实的,因此[用户名] [密码]检查了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]    

1 个答案:

答案 0 :(得分:0)

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