【问题标题】:No plugin found for prefix 'exec' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo]在当前项目和插件组 [org.apache.maven.plugins, org.codehaus.mojo] 中找不到前缀“exec”的插件
【发布时间】:2017-01-31 03:36:08
【问题描述】:

我是 Maven 新手,我正在尝试使用 Maven 3.3 构建项目,但在命令提示符下使用命令 mvn clean install exec:java 遇到以下错误。

[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to mirrorId (https://oss.sonatype.org/content/repositories): http://http=server.proxyserver.com
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.132 s
[INFO] Finished at: 2016-09-22T18:59:14+05:30
[INFO] Final Memory: 8M/113M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'exec' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\xxx\.m2\repository), mirrorId (https://oss.sonatype.org/content/repositories)] -> [Help 1]

我在我的 POM.xml 中更改了我的代理设置,而我的 POM 是,

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.4.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>java</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includeProjectDependencies>false</includeProjectDependencies>
                    <includePluginDependencies>true</includePluginDependencies>
                    <executableDependency>
                        <groupId>org.kaaproject.kaa.demo.zeppelin</groupId>
                        <artifactId>simulator</artifactId>
                    </executableDependency>
                    <mainClass>org.kaaproject.kaa.demo.zeppelin.Simulator</mainClass>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.kaaproject.kaa.demo.zeppelin</groupId>
                        <artifactId>simulator</artifactId>
                        <version>1.2.0-SNAPSHOT</version>
                        <type>jar</type>
                    </dependency>
                </dependencies>
            </plugin>

而我的 settings.xml 是,

<proxies>
   <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>http://http=xxx.proxyserver.com</host>
      <port>8080</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
  </proxies>

感谢您的提前......期待听到......即使最后发布的内容也没有帮助。

【问题讨论】:

    标签: java maven maven-plugin


    【解决方案1】:

    我认为问题在于您的代理配置。看看this (https://maven.apache.org/settings.html#Proxies)this (https://maven.apache.org/guides/mini/guide-proxies.html)

    &lt;host&gt; 应该是没有协议的主机名(&lt;protocol&gt; 已经给出了。我认为“http://http=...”是一个错字?或者你是什么意思 =

    你写过“我是 Maven 新手”,你真的想使用代理吗?如果是这样,您必须正确配置它。如果不只是从您身上删除&lt;proxies&gt; 元素settings.xml

    【讨论】:

      猜你喜欢
      • 2016-12-28
      • 2016-04-18
      • 2018-04-28
      • 2016-07-09
      • 1970-01-01
      • 2014-08-10
      • 2019-08-09
      • 2017-06-02
      • 2015-08-31
      相关资源
      最近更新 更多