【问题标题】:Maven - AbsoluteLayout dependencyMaven - AbsoluteLayout 依赖
【发布时间】:2017-03-20 16:45:58
【问题描述】:

我正在尝试恢复我的旧项目。我想使用 maven 并且我想添加 AbsoluteLayout 依赖项。我是 maven 的新手,所以我不知道出了什么问题。我发现这应该可行:

<dependency>
<groupId>org.netbeans.external</groupId>
<artifactId>AbsoluteLayout</artifactId>
<version>RELEASE802</version>
</dependency>

但我只收到此错误:

Failed to execute goal on project XXX: Could not resolve dependencies for project xx.xxxx:XXX:jar:1.0-SNAPSHOT: Failure to find org.netbeans.external:AbsoluteLayout:jar:RELEASE802 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

在此之后,我从计算机中的 netbeans 文件夹中手动添加了此依赖项。它正在工作。还有另一种方法如何添加此依赖项?我想将它包含在我的 pom 文件中。有什么想法吗?

【问题讨论】:

  • 由于它不是公开可用的库(至少不在Maven central),您需要install it in your local repository
  • 嗨,它的公共图书馆和它为用户 Eric B 工作。有什么想法吗?
  • 它在 Netbeans 存储库中可用,请参阅我的回答。

标签: java maven netbeans absolutelayout


【解决方案1】:

您需要将 Netbeans 存储库添加到您的 POM:

<repositories>
    <repository>
      <id>netbeans</id>
      <name>Netbeans rep</name>
      <url>http://bits.netbeans.org/maven2/</url>
    </repository>
</repositories>

【讨论】:

  • 对我也有用!非常感谢。
【解决方案2】:

我将以下依赖块添加到我的 POM 中,并且在更新我的 maven 索引后它工作得很好。

<!-- https://mvnrepository.com/artifact/org.netbeans.external/AbsoluteLayout -->
<dependency>
    <groupId>org.netbeans.external</groupId>
    <artifactId>AbsoluteLayout</artifactId>
    <version>RELEASE802</version>
</dependency>

因此,您可能想尝试更新您的 Maven 索引,看看是否适合您。这个依赖块直接来自 mvnrepository.com/,据我所知,我不需要添加任何特殊的 repo。

【讨论】:

  • @jv95 你是从命令行还是 IDE 运行它?如果它只是直接命令行执行:mvn clean install -U 这将执行全新安装,并且 -U 强制更新依赖项。
【解决方案3】:

貌似公共仓库中不存在这个依赖,你可以注册一个账号上传,或者,在我看来更好,你可以设置自己的私有maven仓库服务器,有很多软件支持这样做,例如JFrog Artifactory,很容易安装和操作。

【讨论】:

  • 您好,公共存储库中似乎存在依赖项。我在互联网上与我的问题“如何在 maven 中使用 AbsoluteLayout”相关的主题中找到了它,它也适用于用户 Eric B。你能试试它对你也有用吗? ://
猜你喜欢
  • 1970-01-01
  • 2011-04-22
  • 2019-09-02
  • 1970-01-01
  • 1970-01-01
  • 2021-12-21
  • 2011-12-21
  • 2013-10-06
相关资源
最近更新 更多