#maven
#maven
Вопрос:
При вводе команды я получаю следующую ошибку mvn archetype:generate
:
➜ mvn archetype:generate
---------------------------------------------------
constituent[0]: file:/opt/maven/conf/logging/
constituent[1]: file:/opt/maven/lib/plexus-component-annotations-2.1.0.jar
constituent[2]: file:/opt/maven/lib/plexus-utils-3.2.1.jar
constituent[3]: file:/opt/maven/lib/maven-resolver-spi-1.4.1.jar
constituent[4]: file:/opt/maven/lib/maven-embedder-3.6.3.jar
constituent[5]: file:/opt/maven/lib/maven-resolver-impl-1.4.1.jar
constituent[6]: file:/opt/maven/lib/jansi-1.17.1.jar
constituent[7]: file:/opt/maven/lib/commons-lang3-3.8.1.jar
constituent[8]: file:/opt/maven/lib/maven-compat-3.6.3.jar
constituent[9]: file:/opt/maven/lib/javax.inject-1.jar
constituent[10]: file:/opt/maven/lib/maven-resolver-api-1.4.1.jar
constituent[11]: file:/opt/maven/lib/slf4j-api-1.7.29.jar
constituent[12]: file:/opt/maven/lib/wagon-file-3.3.4.jar
constituent[13]: file:/opt/maven/lib/wagon-provider-api-3.3.4.jar
constituent[14]: file:/opt/maven/lib/wagon-http-3.3.4-shaded.jar
constituent[15]: file:/opt/maven/lib/jcl-over-slf4j-1.7.29.jar
constituent[16]: file:/opt/maven/lib/maven-model-3.6.3.jar
constituent[17]: file:/opt/maven/lib/org.eclipse.sisu.plexus-0.3.4.jar
constituent[18]: file:/opt/maven/lib/plexus-sec-dispatcher-1.4.jar
constituent[19]: file:/opt/maven/lib/maven-resolver-connector-basic-1.4.1.jar
constituent[20]: file:/opt/maven/lib/jsoup-1.12.1.jar
constituent[21]: file:/opt/maven/lib/maven-repository-metadata-3.6.3.jar
constituent[22]: file:/opt/maven/lib/maven-builder-support-3.6.3.jar
constituent[23]: file:/opt/maven/lib/maven-resolver-util-1.4.1.jar
constituent[24]: file:/opt/maven/lib/maven-slf4j-provider-3.6.3.jar
constituent[25]: file:/opt/maven/lib/maven-resolver-provider-3.6.3.jar
constituent[26]: file:/opt/maven/lib/maven-resolver-transport-wagon-1.4.1.jar
constituent[27]: file:/opt/maven/lib/maven-model-builder-3.6.3.jar
constituent[28]: file:/opt/maven/lib/maven-artifact-3.6.3.jar
constituent[29]: file:/opt/maven/lib/guava-25.1-android.jar
constituent[30]: file:/opt/maven/lib/commons-io-2.5.jar
constituent[31]: file:/opt/maven/lib/cdi-api-1.0.jar
constituent[32]: file:/opt/maven/lib/plexus-interpolation-1.25.jar
constituent[33]: file:/opt/maven/lib/maven-plugin-api-3.6.3.jar
constituent[34]: file:/opt/maven/lib/commons-cli-1.4.jar
constituent[35]: file:/opt/maven/lib/maven-settings-builder-3.6.3.jar
constituent[36]: file:/opt/maven/lib/maven-core-3.6.3.jar
constituent[37]: file:/opt/maven/lib/jsr250-api-1.0.jar
constituent[38]: file:/opt/maven/lib/maven-shared-utils-3.2.1.jar
constituent[39]: file:/opt/maven/lib/guice-4.2.1-no_aop.jar
constituent[40]: file:/opt/maven/lib/org.eclipse.sisu.inject-0.3.4.jar
constituent[41]: file:/opt/maven/lib/plexus-cipher-1.7.jar
constituent[42]: file:/opt/maven/lib/maven-settings-3.6.3.jar
---------------------------------------------------
Exception in thread "main" java.lang.AssertionError: pom file must not be null from PolyglotModelManager as per API
at org.sonatype.maven.polyglot.TeslaModelProcessor.locatePom(TeslaModelProcessor.java:64)
at org.apache.maven.cli.MavenCli.populateRequest(MavenCli.java:1484)
at org.apache.maven.cli.MavenCli.populateRequest(MavenCli.java:1298)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Я использую maven 3.6.3 с java 11:
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/maven
Java version: 11.0.8, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-48-generic", arch: "amd64", family: "unix"
И последний Ubuntu LTS (20.04):
➜ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
Я погуглил, но не могу найти ни одной ссылки.
Спасибо.
Ответ №1:
Ну, наконец-то я получил ответ. У меня оказался следующий файл ~/.mvn/extensions.xml для построения RCP Eclipse без использования pom. Я экспериментировал с этим и создал этот файл в своей домашней папке, а не в корневом каталоге проекта.
<extensions>
<extension>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-pomless</artifactId>
<version>2.0.0</version>
</extension>
</extensions>
Я удалил его, а затем все вернулось к нормальной жизни.
➜ mvn archetype:generate
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.2.0:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.2.0:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO]
[INFO] --- maven-archetype-plugin:3.2.0:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
...