我将一个 jar 下载到本地存储库,但每次我编译 netbeans 时都尝试下载它,为什么会发生这种情况,我尝试更改依赖范围,但我无法找到解决方案。这是我的依赖项,我也尝试提供,运行时...
正则表达式
正则表达式
1.2_01
编译
Netbeans 输出如下,我使用 netbeans 建议的 maven 命令将手动下载的 jregex jar 存储到我的本地存储库,并且我还安装了其他依赖的 jar 并存储了我的本地存储库。
[警告] 使用平台编码(实际上是 UTF-8)来复制过滤的资源,即构建依赖于平台!
复制3个资源
下载: http://repository.jboss.org/ maven2//jregex/jregex/1.2_01/jregex-1.2_01.pom
无法在存储库repository.jboss.org (http://repository.jboss.org/maven2/) 中找到资源“jregex:jregex:pom:1.2_01”
下载:http://download.java。净/maven/2//jregex/jregex/1.2_01/jregex-1.2_01.pom
无法在存储库 java.net (http://download.java.net/maven/2/) 中找到资源“jregex:jregex:pom:1.2_01”
下载: http://repo1.maven.org/maven2 /jregex/jregex/1.2_01/jregex-1.2_01.pom
无法在存储库中央(http://repo1.maven.org/maven2)中找到资源“jregex:jregex:pom:1.2_01”
I download a jar to my local reposotory but every times i compile netbeans try to download it why can be this happen i try to change dependecy scope but i couldnt figure out a solution.This is my dependency i also try provided ,runtime...
jregex
jregex
1.2_01
compile
Netbeans output as below and i use netbeans suggested maven command to store manualy downloaded jregex jar to my local repository and i also have other dependend jars instaled and stored my local repository .
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
Copying 3 resources
Downloading: http://repository.jboss.org/maven2//jregex/jregex/1.2_01/jregex-1.2_01.pom
Unable to find resource 'jregex:jregex:pom:1.2_01' in repository repository.jboss.org (http://repository.jboss.org/maven2/)
Downloading: http://download.java.net/maven/2//jregex/jregex/1.2_01/jregex-1.2_01.pom
Unable to find resource 'jregex:jregex:pom:1.2_01' in repository java.net (http://download.java.net/maven/2/)
Downloading: http://repo1.maven.org/maven2/jregex/jregex/1.2_01/jregex-1.2_01.pom
Unable to find resource 'jregex:jregex:pom:1.2_01' in repository central (http://repo1.maven.org/maven2)
发布评论
评论(3)
cd
到包含jregex-1.2_01.jar
文件的目录并运行以下命令:这将根据您编写的依赖项将 jar 安装在本地存储库中,其中是(如果我理解正确的话):
如果你想摆脱警告,你还可以添加
更新:检查 POM 本身 (
jregex-1.2_01.pom
)确实位于您的本地存储库中。也许这是显而易见的,你已经做到了,但我没有主意了:)出于某种原因,可能是在那里找到了 jar,但 pom 却没有。如果不是这种情况,那么当 maven 运行时和从控制台安装 jar 时,本地存储库之间会存在某种不匹配,但我不知道如何实现。cd
to the directory containing yourjregex-1.2_01.jar
file and run the following:That will install the jar in your local repository as indicated by the dependency you wrote, which is (if I understood correctly):
If you want to get rid of the warning, you can also add
update: check that the POM itself (
jregex-1.2_01.pom
) is really on your local repository. Maybe this is obvious and you already did it but I'm out of ideas :) For some reason it could be that the jar is found there, but the pom is not. If this is not the case, you have some kind of mismatch between the local repository when maven runs and when you install the jar from console, but I can't figure out how.如果您需要进一步的解释,您应该发布 pom.xml、settings.xml 的摘录以及依赖项的路径...
You should post an extract from your pom.xml, settings.xml and the path to the dependency if you want further explanations...
或者您的依赖项在远程存储库中没有 pom 文件,maven 会重新尝试下载它。
请尝试使用最近发布的 nb 7.0,它嵌入了最新的 maven 3.x 二进制文件。
or your dependency doesn't have a pom file in the remote repository and maven re-attempts to download it.
please try with recently released nb 7.0, it has the uptodate maven 3.x binaries embedded.