Java Maven - 在当前项目中找不到前缀“wildfly”的插件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24405275/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 12:01:09  来源:igfitidea点击:

Maven - No plugin found for prefix 'wildfly' in the current project

javamavenwildfly

提问by Kevin Joymungol

Am using Wildfly 8 and I need to use the java batch processor from JSR 352. I downloaded the examples from https://github.com/javaee-samples/javaee7-samplesbut can't get them to work.

我正在使用 Wildfly 8,我需要使用 JSR 352 中的 java 批处理器。我从https://github.com/javaee-samples/javaee7-samples下载了示例,但无法让它们工作。

On the batch folder I did mvn clean package wildfly:deploybut am getting the error

在批处理文件夹上我做了mvn clean package wildfly:deploy但收到错误

No plugin found for prefix 'wildfly' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/krishnen/.m2/repository), codehaus-snapshots (http://nexus.codehaus.org/snapshots/), central (http://repo.maven.apache.org/maven2)]

在当前项目和插件组 [org.apache.maven.plugins, org.codehaus.mojo] 中找不到前缀“wildfly”的插件,可从存储库 [local (/home/krishnen/.m2/repository), codehaus-snapshots(http://nexus.codehaus.org/snapshots/),中央(http://repo.maven.apache.org/maven2)]

Any ideas what may be wrong?

任何想法可能有什么问题?

采纳答案by khmarbaise

You simply can add the following in your settings.xml file:

您只需在 settings.xml 文件中添加以下内容:

<pluginGroups>
  <pluginGroup>org.wildfly.plugins</pluginGroup>
</pluginGroups>

After that you can use it like this:

之后,您可以像这样使用它:

mvn wildfly:deploy

回答by Petr Mensik

You need add this plugin to your pom.xml.

您需要将此插件添加到您的pom.xml.

<build>
   <plugins>
      <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>1.0.2.Final</version>
        </plugin>
    </plugins>
</build>

And than call mvn wildfly:deploy, this should do the job :-)

而不是 call mvn wildfly:deploy,这应该可以完成工作:-)

回答by Ndirangu

<project>
    ...
    <build>
        ...
        <plugins>
            ...
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>1.1.0.Alpha8</version>
            </plugin>
            ...
        </plugins>
        ...
    </build>
...
</project>

Use this updated plugin. I also had the same problem as since i added the wildfly dependency to my pom.xml rather than the plugin

使用这个更新的插件。我也遇到了同样的问题,因为我将 wildfly 依赖项添加到我的 pom.xml 而不是插件