简体   繁体   中英

mvn spring-boot:run errors with No plugin found for prefix 'spring-boot' in the current project and in the plugin groups

I have a Java application which should be run with mvn spring-boot:run -Dspring.profiles.active=dev -Djasypt.encryptor.password=<DJASYPT_ENCRYPTOR_PASSWORD> .

If I just run that command I get this:

[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ie.avis.digital.account:accapiapp:jar:1.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.httpcomponents:httpclient:jar -> version (?) vs 4.5.3 @ ie.avis.digital.account:accapiapp:[unknown-version], C:\DevTools\git\api.account\accapiapp\pom.xml, line 156, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] accapi
[INFO] accapiapp
Downloading: https://binaries.avisgroup.com:443/artifactory/public-maven/org/eclipse/m2e/lifecycle-mapping/1.0.0/lifecycle-mapping-1.0.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
Downloading: https://binaries.avisgroup.com:443/artifactory/public-maven/org/codehaus/mojo/maven-metadata.xml
Downloading: https://binaries.avisagroup.com:443/artifactory/public-maven/org/apache/maven/plugins/maven-metadata.xml
Downloaded: https://binaries.avisgroup.com:443/artifactory/public-maven/org/apache/maven/plugins/maven-metadata.xml (10 kB at 1.2 kB/s)
Downloaded: https://binaries.avisgroup.com:443/artifactory/public-maven/org/codehaus/mojo/maven-metadata.xml (20 kB at 299 B/s)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] accapi ......................................... SKIPPED
[INFO] accapiapp ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:12 min
[INFO] Finished at: 2022-01-11T19:10:33Z
[INFO] Final Memory: 13M/209M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'spring-boot' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\A183540\.m2\repository), avis-nexus (https://binaries.avisagroup.com:443/artifactory/public-maven/)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[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/NoPluginFoundForPrefixException

I don't think I should need to add this to the accapi pom:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.12.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>

and this to plugins

If I do and run the mvn command I get this:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <skip>true</skip>
    </configuration>
</plugin>

I get this:

[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ie.avis.digital.account:accapiapp:jar:1.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.httpcomponents:httpclient:jar -> version (?) vs 4.5.3 @ ie.avis.digital.account:accapiapp:[unknown-version], C:\DevTools\git\api.account\accapiapp\pom.xml, line 156, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] accapi
[INFO] accapiapp
Downloading: https://binaries.avisgroup.com:443/artifactory/public-maven/org/eclipse/m2e/lifecycle-mapping/1.0.0/lifecycle-mapping-1.0.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building accapi 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) > test-compile @ accapi >>>
[INFO]
[INFO] <<< spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) < test-compile @ accapi <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) @ accapi ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building accapiapp 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) > test-compile @ accapiapp >>>
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create (2) @ accapiapp ---
[INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD"
[INFO] Working directory: C:\DevTools\git\api.account\accapiapp
[INFO] Storing buildNumber: b9bd8c84473a4d0f5ab3f0e0f9a24a92620850d8 at timestamp: 1641928952817
[INFO] Storing buildScmBranch: develop
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create-metadata (1) @ accapiapp ---
[INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD"
[INFO] Working directory: C:\DevTools\git\api.account\accapiapp
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ accapiapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 20 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ accapiapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ accapiapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 15 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ accapiapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) < test-compile @ accapiapp <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) @ accapiapp ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] accapi ......................................... SUCCESS [  0.997 s]
[INFO] accapiapp ...................................... SUCCESS [  4.948 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.137 s
[INFO] Finished at: 2022-01-11T19:22:35Z
[INFO] Final Memory: 33M/258M
[INFO] ------------------------------------------------------------------------

Even if I was correct to do this I'd expect the application to remain running. Is there anything obvious that I'm doing wrong?

I had to cd accapiapp then run my mvn command.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM