相关疑难解决方法(0)

Maven 依赖项失败并出现 501 错误

最近在Jenkins中运行的Maven构建作业失败,出现以下异常,表示它们无法从Maven Central 中提取依赖项,应使用HTTPS。我不确定如何将请求从HTTP更改为HTTPS。有人可以指导我解决这个问题吗?

[错误] 无法解析的构建扩展:
插件org.apache.maven.wagon:wagon-ssh:2.1或其依赖项之一无法解析:
无法收集依赖项org.apache.maven.wagon:wagon-ssh:jar:2.1 ()
无法读取工件描述符org.apache.maven.wagon:wagon-ssh:jar:2.1
无法org.apache.maven.wagon:wagon-ssh:pom:2.1从/向中央(http://repo.maven.apache. org/maven2):
无法传输文件:http://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-ssh/2.1/wagon-ssh-2.1.pom
返回代码为:501, ReasonPhrase:HTTPS Required. -> [Help 2]

等待Jenkins完成收集data[ERROR]
插件org.apache.maven.plugins:maven-clean-plugin:2.4.1或其依赖项之一无法解决:
无法读取工件描述符org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
无法org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1从/向中央传输工件(http://repo.maven.apache.org/maven2):
无法传输文件:http : //repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
返回代码为:501 , ReasonPhrase:HTTPS Required. -> [Help 1]

java maven jenkins maven-central

196
推荐指数
16
解决办法
13万
查看次数

无法执行目标org.codehaus.mojo:exec-maven-plugin:1.2:java(default-cli)

我正在研究Smooks - Camel Integration.我遇到了错误.当我尝试使用mvn exec运行它时,Build失败了:java


[错误]: 无法在项目上执行目标org.codehaus.mojo:exec-maven-plugin:1.2:java(default-cli) camel-example-smooks-integration:

我的控制台日志如下:

[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/MojoNotFoundException

C:\apache-camel-2.11.0\examples\camel-example-smooks-integration>mvn exec:java
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
org.apache.camel:camel-example-smooks-integration:bundle:2.11.0
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate   
declaration of plugin org.codehaus.mojo:exec-maven-plugin @ line 138, column 9

[WARNING]
[WARNING] It is highly recommended to fix these problems …
Run Code Online (Sandbox Code Playgroud)

integration exec-maven-plugin smooks

31
推荐指数
2
解决办法
12万
查看次数

maven codehaus.mojo 无法解析

我正在尝试使用 NetBeans 构建一个 JavaFX 项目,但是当我运行它时,我有一个:

Plugin org.codehaus.mojo:exec-maven-plugin:1.2.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:exec-maven-plugin:jar:1.2.1: Could not transfer artifact org.codehaus.mojo:exec-maven-plugin:pom:1.2.1 from/to HTTP (http://repo.maven.apache.org/maven2): Access denied to: http://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.2.1/exec-maven-plugin-1.2.1.pom , ReasonPhrase:Forbidden. -> [Help 1]
Run Code Online (Sandbox Code Playgroud)

我在代理后面工作,但我用我的代理配置了 Netbeans,我尝试了“测试连接”,这是可行的。

我还用这个代理配置了“.m2/settings.xml”目录

<?xml  version="1.0" encoding="UTF-8"?> <settings>   <proxies>
    <proxy>
      <active />
      <protocol>http</protocol>
      <username>username</username>
      <password>password</password>
      <port>8080</port>
      <host>proxyhost</host>
      <id/>
    </proxy>   </proxies>
     <mirrors>
    <mirror>
      <id>HTTP</id>
      <name>HTTP Central</name>
      <url>http://repo.maven.apache.org/maven2</url>
      <mirrorOf>central</mirrorOf>
    </mirror>   </mirrors> </settings>
Run Code Online (Sandbox Code Playgroud)

我的 pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion> …
Run Code Online (Sandbox Code Playgroud)

maven-2 netbeans maven-plugin

5
推荐指数
1
解决办法
4万
查看次数

Netbeans + Maven(更新中央存储库)

由于“需要 HTTPS”错误,我最近在构建项目时遇到了问题。这个问题解决了通过修改我的pom.xml所描述这里,添加以下:

    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <updatePolicy>never</updatePolicy>
            </releases>
        </pluginRepository>
    </pluginRepositories>
    <repositories>
        <repository>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
Run Code Online (Sandbox Code Playgroud)

但是,对于我拥有的每个项目,更新每个 pom.xml 很麻烦。

我曾尝试将相同的代码片段添加到我的 settings.xml 中,但无济于事。

我知道较新版本的 Maven 解决了这个问题。但是,由于工作限制,我无法更新我的环境。

我目前已经安装了 Netbeans 8.2 安装程序捆绑的 Java 8 和 Maven。

有什么我可以添加到我的 settings.xml 以避免修改我工作的每个 pom.xml 的东西吗?如果绝对必要,有没有办法可以只更新我的 Maven 版本,知道我已经安装了 Netbeans 的任何东西?

希望这不是重复的,我已经搜索了几个条目,但都无济于事。

java netbeans maven netbeans-8

2
推荐指数
1
解决办法
4529
查看次数