The plugin 'org.apache.maven.plugins:maven-jbo

2019-07-21 02:02发布

I hit into deployment error for Jboss AS 7.1.1 Final deployment as mentioned at Could not connect to remote://localhost:9999. The connection timed out Jboss 7.1.1 Final. I am trying to use latest version of Jboss Maven plugin '7.4.Final' from '7.1.1.Final'. When I made change in POM configuration I am getting following error for both versions of plug-in. I have confirmed that my .m2 has both of these plug-in versions available.

Is POM meta data corrupt in my case, if so how do I clean it up to get it working?

[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

UPDATE 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条回答
Root(大扎)
2楼-- · 2019-07-21 02:13

The stack trace show us as

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

It should be org.jboss.as.plugins:jboss-as-maven-plugin instead.

The JBoss Application Server 7: Plugin Documentation told us to configure as the following: -

    <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>

Please review and ensure that the plugin org.jboss.as.plugins:boss-as-maven-plugin is under the <build> in your pom.xml.

I hope this may help.

查看更多
你好瞎i
3楼-- · 2019-07-21 02:27

I was facing similar issue. This issue was due to older version of maven2.2.1. When moved to newer version3.x of maven it worked.

查看更多
登录 后发表回答