java - 如何配置 Eclipse m2 插件来查找我的企业存储库?

标签 java eclipse maven m2eclipse sts-springsourcetoolsuite

我无法弄清楚如何配置 SpringSource Tool Suite 的 m2 插件。为了让 Maven 从命令行工作,我必须在 settings.xml 文件中指向我们的企业存储库。

如果我尝试在 STS 内部构建,我会得到以下结果:

[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/com/mycompany/maven/adp/adp-base-pom/1.0.14/adp-base-pom-1.0.14.pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.mycompany.edelivery:edelivery-build:current 
(C:\code\workspace\edelivery-build\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM: Could not transfer artifact 
com.mycompany.maven.adp:adp-base-pom:pom:1.0.14 from/to central 
(http://repo1.maven.org/maven2): ConnectException and 'parent.relativePath' 
points at wrong local POM @ line 4, 
column 11: UnresolvedAddressException -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

我认为我需要告诉 STS 企业存储库在哪里,我该怎么做?我在 File -> Properties 下找到的唯一内容是 Active Maven Profiles 字段,但这没有帮助。

这是 settings.xml 文件中的一个片段,我该如何处理这些信息?

<profile>
  <id>internal-profile</id>
  <activation>
    <activeByDefault>true</activeByDefault>
  </activation>
  <pluginRepositories>
    <pluginRepository>
      <releases>
        <updatePolicy>always</updatePolicy>
      </releases>
      <name>Enterprise Plugin Repository</name>
      <url>http://svn01g.gdc.nwie.net/maven2/enterprise</url>
    </pluginRepository>
  </pluginRepositories>
  <repositories>
    <repository>
      <id>internal-release</id> 
      <name>MyCompany Enterprise Repository</name>
      <url>http://svn01g.gdc.nwie.net/maven2/enterprise</url>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
      </snapshots>
    </repository>
  </repositories>
</profile>  

最佳答案

假设您使用的是 0.12.1 或更早版本的 m2eclipse 插件,您所需要做的就是将 m2eclipse 指向您本地的 maven 安装。选择 Window -> Preferences -> Maven -> Installations,单击 Add... 并浏览到 Maven 安装的根目录。请记住,每当您切换到新工作区时,您都需要再次执行此操作。

关于java - 如何配置 Eclipse m2 插件来查找我的企业存储库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6782152/

相关文章:

java - OnClickListener 未按预期运行

android - 如何使用 Android Activity 修复 "Call requires API level 11"?

java - 在项目中使用 Jersey 和 Spring

Eclipse:infinitest 与 JUnit:字符编码

maven - 为什么在尝试使用 Grails Release 插件中的 publish-plugin 时得到 400

java - 如何禁用继承的logback?

java - 单元测试和模拟工厂

java - 如何将三个不同的集合迭代在一起

java - 静态变量搞乱了一切

java - 更改自动生成的主要方法的 Eclipse 模板?