Java项目没有pom,项目的POM缺失,无依赖信息

Background

Trying to add a Java library to the local Maven repository using a clean install of Apache Maven 3.1.0, with Java 1.7. Here is how the Java archive file was added:

mvn install:install-file \

-DgroupId=net.sourceforge.ant4x \

-DartifactId=ant4x \

-Dversion=0.3.0 \

-Dfile=ant4x-0.3.0.jar \

-Dpackaging=jar

This created the following directory structure:

$HOME/.m2/repository/net/sourceforge/ant4x/

├── 0.3.0

│ ├── ant4x-0.3.0.jar.lastUpdated

│ └── ant4x-0.3.0.pom.lastUpdated

└── ant4x

├── 0.3.0

│ ├── ant4x-0.3.0.jar

│ ├── ant4x-0.3.0.pom

│ └── _remote.repositories

└── maven-metadata-local.xml

The project's pom.xml file references the dependent project (the tree above) as follows:

1.5

0.3.0

UTF-8

...

net.sourceforge

ant4x

${net.sourceforge.ant4x-version}

provided

Problem

After running mvn compile, the following error was returned (full log on Pastebin):

[ERROR] Failed to execute goal on project ant4docbook: Could not resolve dependencies for project net.sourceforge:ant4docbook:jar:0.6-SNAPSHOT: Failure to find net.sourceforge:ant4x:jar:0.3.0 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]

The documentation notes a number of issues that could be present, however none of these appear to apply.

Ideas

I tried the following, as per the documentation:

Copy default settings to user's home directory for Maven:cp /opt/apache-maven-3.1.0/conf/settings.xml $HOME/.m2/.

Edit the user's settings.xml file.

Update the value for the local repository:${user.home}/.m2/repository

Save the file.

I also tried the following commands:

mvn -U

mvn clear -U

I tried using Maven 3.0.5, but that failed, too.

Question

How do you force Maven to use the local version of the library, rather than trying to seek out a library that is not yet available to download?

Related

Related questions and information that did not resolve the issue:

解决方案

Change:

net.sourceforge

ant4x

${net.sourceforge.ant4x-version}

provided

To:

net.sourceforge.ant4x

ant4x

${net.sourceforge.ant4x-version}

provided

The groupId of net.sourceforge was incorrect. The correct value is net.sourceforge.ant4x.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值