插件'org.apache.maven.plugins:maven-jboss-as-plugin'不存在或找不到有效版本

时间:2013-04-03 07:09:52

标签: deployment maven-2 jboss7.x

我遇到了Could not connect to remote://localhost:9999. The connection timed out Jboss 7.1.1 Final中提到的Jboss AS 7.1.1最终部署的部署错误。我试图从'7.1.1.Final'使用最新版本的Jboss Maven插件'7.4.Final'。当我在POM配置中进行更改时,我对两个版本的插件都会出现以下错误。我已经确认我的.m2有这两个插件版本。

在我的情况下,POM元数据是否已损坏,如果是这样,我如何清理它以使其正常工作?

[INFO] Searching repository for plugin with prefix: 'jboss-as'.
[DEBUG] Loading plugin prefixes from group: org.apache.maven.plugins
[DEBUG] Loading plugin prefixes from group: org.codehaus.mojo
[DEBUG] maven-jboss-as-plugin: using locally installed snapshot
[DEBUG] Artifact not found - using stub model: Unable to determine the latest version

  org.apache.maven.plugins:maven-jboss-as-plugin:pom:LATEST



[DEBUG] Using defaults for missing POM org.apache.maven.plugins:maven-jboss-as-plugin:pom:LATEST
[DEBUG] maven-jboss-as-plugin: using locally installed snapshot
[DEBUG] Artifact not found - using stub model: Unable to determine the release version

  org.apache.maven.plugins:maven-jboss-as-plugin:pom:RELEASE



[DEBUG] Using defaults for missing POM org.apache.maven.plugins:maven-jboss-as-plugin:pom:RELEASE
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-jboss-as-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: The plugin 'org.apache.maven.plugins:maven-jboss-as-plugin' does not exist or no valid version could be found
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1569)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1851)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:462)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:175)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.version.PluginVersionNotFoundException: The plugin 'org.apache.maven.plugins:maven-jboss-as-plugin' does not exist or no valid version could be found
        at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:229)
        at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:91)
        at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:179)
        at org.apache.maven.plugin.DefaultPluginManager.loadPluginDescriptor(DefaultPluginManager.java:1642)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1540)
        ... 15 more

更新 的pom.xml

<build>

        <pluginManagement>

            <plugins>

                <plugin>

                    <groupId>org.apache.maven.plugins</groupId>

                    <artifactId>maven-compiler-plugin</artifactId>

                    <configuration>

                        <source>1.6</source>

                        <target>1.6</target>

                    </configuration>

                </plugin>

         <!-- continue build even test fails -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12</version>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                </configuration>
            </plugin>
<plugin>
        <groupId>org.jboss.as.plugins</groupId>
            <artifactId>jboss-as-maven-plugin</artifactId>
            <version>7.4.Final</version>
            <configuration>
               <filename>${project.build.finalName}.jar</filename>
            <username>${userName}</username>
                <password>${password}</password>

            </configuration>

                </plugin>

            </plugins>

        </pluginManagement>

    </build>

2 个答案:

答案 0 :(得分:3)

堆栈跟踪显示为

[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-jboss-as-plugin'
       does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------

应该是org.jboss.as.plugins:jboss-as-maven-plugin

The JBoss Application Server 7: Plugin Documentation告诉我们配置如下: -

    <project>
      ...
      <build>
        <!-- To define the plugin version in your parent POM -->
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.jboss.as.plugins</groupId>
              <artifactId>jboss-as-maven-plugin</artifactId>
              <version>7.4.Final</version>
            </plugin>
            ...
          </plugins>
        </pluginManagement>
        <!-- To use the plugin goals in your POM or parent POM -->
        <plugins>
          <plugin>
            <groupId>org.jboss.as.plugins</groupId>
            <artifactId>jboss-as-maven-plugin</artifactId>
            <version>7.4.Final</version>
          </plugin>
          ...
        </plugins>
      </build>
      ...
    </project>

请检查并确保插件org.jboss.as.plugins:boss-as-maven-plugin位于<build>的{​​{1}}下。

我希望这可能有所帮助。

答案 1 :(得分:0)

我遇到了类似的问题。此问题是由旧版本的maven2.2.1引起的。 当移动到maven的较新版本3.x时,它可以工作。