从Jfrog Artifactory获取Maven插件的问题
我正在尝试将一个旧的Maven项目连接到私人文物,以便在构建时下载插件。我使用JFrog文物坐在互码网络(使用VPN)中。
“ MVN CLEAN安装-u”返回:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] ProjektYXZ - parent POM [pom]
[INFO] ProjektYXZ - main POM [pom]
[INFO]
[INFO] ---------------------< com.*:mvn-project >----------------------
[INFO] Building ProjektYXZ - parent POM 1.14.0-SNAPSHOT [1/2]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mvn-project ---
[INFO] Deleting **mvn-project\target
[INFO]
[INFO] >>> maven-source-plugin:3.0.1:jar (attach-sources) > generate-sources @ mvn-project >>>
[INFO]
[INFO] <<< maven-source-plugin:3.0.1:jar (attach-sources) < generate-sources @ mvn-project <<<
[INFO]
[INFO]
[INFO] --- maven-source-plugin:3.0.1:jar (attach-sources) @ mvn-project ---
[INFO]
[INFO] --- maven-javadoc-plugin:3.0.1:jar (attach-javadocs) @ mvn-project ---
[INFO] Not executing Javadoc as the project is not a Java classpath-capable package
[INFO]
[INFO] --- maven-checkstyle-plugin:3.0.0:check (default) @ mvn-project ---
[INFO]
[INFO] >>> spotbugs-maven-plugin:3.1.11:check (default) > :spotbugs @ mvn-project >>>
[INFO]
[INFO] --- spotbugs-maven-plugin:3.1.11:spotbugs (spotbugs) @ mvn-project ---
[INFO]
[INFO] <<< spotbugs-maven-plugin:3.1.11:check (default) < :spotbugs @ mvn-project <<<
[INFO]
[INFO]
[INFO] --- spotbugs-maven-plugin:3.1.11:check (default) @ mvn-project ---
[INFO]
[INFO] >>> maven-pmd-plugin:3.11.0:check (default) > :pmd @ mvn-project >>>
[INFO]
[INFO] --- maven-pmd-plugin:3.11.0:pmd (pmd) @ mvn-project ---
[INFO]
[INFO] <<< maven-pmd-plugin:3.11.0:check (default) < :pmd @ mvn-project <<<
[INFO]
[INFO]
[INFO] --- maven-pmd-plugin:3.11.0:check (default) @ mvn-project ---
[INFO]
[INFO] --- plugin:1.4.1:enforce (default) @ mvn-project ---
Downloading from central-mirror: https://artifactory.*.de/artifactory/maven/**/*-1.0.2.pom
Downloading from company-releases: https://artifactory.**.de/artifactory/**/1.0.2/*-1.0.2.pom
[WARNING] The POM for com.**:jar:1.0.2 is missing, no dependency information available
Downloading from central-mirror: https://artifactory.**.de/artifactory/maven/**/*-1.0.2.jar
Downloading from company-releases: https://artifactory.**.de/artifactory/**/*-1.0.2.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for ProjektYXZ - main POM 1.14.0-SNAPSHOT:
[INFO]
[INFO] ProjektYXZ - parent POM .................................. FAILURE [ 7.645 s]
[INFO] ProjektYXZ - main POM .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.826 s
[INFO] Finished at: 2022-04-12T10:18:02+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:plugin:1.4.1:enforce (default) on project mvn-project: Execution default of goal org.apache.maven.plugins:plugin:1.4.1:enforce failed: Plugin org.apache.maven.plugins:plugin:1.4.1 or one of its dependencies could not be resolved: Could not find artifact com.**:jar:1.0.2 in central-mirror (https://artifactory.**.de/artifactory/maven) -> [Help 1]
[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.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
在行中:
Downloading from company-releases: https://artifactory.**.de/artifactory/**/1.0.2/*-1.0.2.pom
Maven查看正确的位置。我可以用卷发下载它:
curl -u username:password -X GET "https://artifactory.**.de/artifactory/**/1.0.2/*-1.0.2.pom"
但是,如果我将那条路径粘贴到Chrome中,我会遇到404错误。
我还在c:/users/username/.m2/文件夹中配置了settings.xml:
<server>
<id>company-releases</id>
<username>my_username</username>
<password>my_password</password>
</server>
我还检查了日志底部显示的链接的可能错误,但是由于我能够“ curl”这些链接似乎不是原因。目前,我没有想法。希望您能帮助我:)请告诉我您是否需要查看其他资源。
I'm trying to get an old maven project connected to private artifactory to download plugins when building. I'm sitting in a coporate network (using vpn), using a jfrog artifactory.
"mvn clean install -U" returns:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] ProjektYXZ - parent POM [pom]
[INFO] ProjektYXZ - main POM [pom]
[INFO]
[INFO] ---------------------< com.*:mvn-project >----------------------
[INFO] Building ProjektYXZ - parent POM 1.14.0-SNAPSHOT [1/2]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mvn-project ---
[INFO] Deleting **mvn-project\target
[INFO]
[INFO] >>> maven-source-plugin:3.0.1:jar (attach-sources) > generate-sources @ mvn-project >>>
[INFO]
[INFO] <<< maven-source-plugin:3.0.1:jar (attach-sources) < generate-sources @ mvn-project <<<
[INFO]
[INFO]
[INFO] --- maven-source-plugin:3.0.1:jar (attach-sources) @ mvn-project ---
[INFO]
[INFO] --- maven-javadoc-plugin:3.0.1:jar (attach-javadocs) @ mvn-project ---
[INFO] Not executing Javadoc as the project is not a Java classpath-capable package
[INFO]
[INFO] --- maven-checkstyle-plugin:3.0.0:check (default) @ mvn-project ---
[INFO]
[INFO] >>> spotbugs-maven-plugin:3.1.11:check (default) > :spotbugs @ mvn-project >>>
[INFO]
[INFO] --- spotbugs-maven-plugin:3.1.11:spotbugs (spotbugs) @ mvn-project ---
[INFO]
[INFO] <<< spotbugs-maven-plugin:3.1.11:check (default) < :spotbugs @ mvn-project <<<
[INFO]
[INFO]
[INFO] --- spotbugs-maven-plugin:3.1.11:check (default) @ mvn-project ---
[INFO]
[INFO] >>> maven-pmd-plugin:3.11.0:check (default) > :pmd @ mvn-project >>>
[INFO]
[INFO] --- maven-pmd-plugin:3.11.0:pmd (pmd) @ mvn-project ---
[INFO]
[INFO] <<< maven-pmd-plugin:3.11.0:check (default) < :pmd @ mvn-project <<<
[INFO]
[INFO]
[INFO] --- maven-pmd-plugin:3.11.0:check (default) @ mvn-project ---
[INFO]
[INFO] --- plugin:1.4.1:enforce (default) @ mvn-project ---
Downloading from central-mirror: https://artifactory.*.de/artifactory/maven/**/*-1.0.2.pom
Downloading from company-releases: https://artifactory.**.de/artifactory/**/1.0.2/*-1.0.2.pom
[WARNING] The POM for com.**:jar:1.0.2 is missing, no dependency information available
Downloading from central-mirror: https://artifactory.**.de/artifactory/maven/**/*-1.0.2.jar
Downloading from company-releases: https://artifactory.**.de/artifactory/**/*-1.0.2.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for ProjektYXZ - main POM 1.14.0-SNAPSHOT:
[INFO]
[INFO] ProjektYXZ - parent POM .................................. FAILURE [ 7.645 s]
[INFO] ProjektYXZ - main POM .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.826 s
[INFO] Finished at: 2022-04-12T10:18:02+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:plugin:1.4.1:enforce (default) on project mvn-project: Execution default of goal org.apache.maven.plugins:plugin:1.4.1:enforce failed: Plugin org.apache.maven.plugins:plugin:1.4.1 or one of its dependencies could not be resolved: Could not find artifact com.**:jar:1.0.2 in central-mirror (https://artifactory.**.de/artifactory/maven) -> [Help 1]
[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.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
in the line:
Downloading from company-releases: https://artifactory.**.de/artifactory/**/1.0.2/*-1.0.2.pom
maven looks at the correct place. I'm able to download it with curl:
curl -u username:password -X GET "https://artifactory.**.de/artifactory/**/1.0.2/*-1.0.2.pom"
but if I paste that path into Chrome, I get an 404 Error.
I also configured the settings.xml in my C:/Users/Username/.m2/ folder:
<server>
<id>company-releases</id>
<username>my_username</username>
<password>my_password</password>
</server>
I also checked the possible errors of the Link shown at the bottom of the log, but as I'm able to "curl" it these don't seem to be the reasons. Currently I'm out of ideas. I hope you can help me :) Please tell me if you need to see additional sources.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,解决方案是在settings.xml中设置抢占式身份验证:
例如:
说明:maven首先尝试在不进行身份验证的情况下进行请求。如果 Repo 是私有的(这意味着如果没有身份验证,工件就会被隐藏),jfrog 工件会以 404 响应,而不是未经身份验证。 404 之后,maven 不再尝试,而是将其视为失败。
有关更多详细信息,请参阅:https://jfrog.com/knowledge-base/why-does-my-maven-builds-are-failing-with-a-404-error-when-hide-existence-of-unauthorized-resources-is -启用/
okay, the solution was to set preemptive authentification in settings.xml:
for example:
Explanation: maven first tries to request without authentification. If the Repo is private (this means that without authentification, artifacts are hidden), jfrog artifactory responses with 404 instead of unauthenticated. After 404 maven doesn't try again, but sees it as failed.
For more details see: https://jfrog.com/knowledge-base/why-does-my-maven-builds-are-failing-with-a-404-error-when-hide-existence-of-unauthorized-resources-is-enabled/