ошибка несовместимости maven API для sh.tak.appbundler: appbundle-maven-plugin:1.2.0

#maven #maven-plugin

#maven #maven-плагин

Вопрос:

когда я пытаюсь создать свой проект (получил разные модули) в последнем модуле, я получаю это сообщение об ошибке (используя maven 3.6.3 Java 11, также пробовал с maven 3.6.0)

 [ERROR] Failed to execute goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle (default) on project judocu-clientUI: Execution default of goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle failed: An API incompatibility was encountered while executing sh.tak.appbundler:appbundle-maven-plugin:1.2.0
:bundle: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>sh.tak.appbundler:appbundle-maven-plugin:1.2.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/SelcukCabuk/.m2/repository/sh/tak/appbundler/appbundle-maven-plugin/1.2.0/appbundle-maven-plugin-1.2.0.jar
[ERROR] urls[1] = file:/C:/Users/SelcukCabuk/.m2/repository/org/codehaus/plexus/plexus-archiver/4.2.3/plexus-archiver-4.2.3.jar
[ERROR] urls[2] = file:/C:/Users/SelcukCabuk/.m2/repository/org/codehaus/plexus/plexus-utils/3.3.0/plexus-utils-3.3.0.jar
[ERROR] urls[3] = file:/C:/Users/SelcukCabuk/.m2/repository/org/codehaus/plexus/plexus-io/3.2.0/plexus-io-3.2.0.jar
[ERROR] urls[4] = file:/C:/Users/SelcukCabuk/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar
[ERROR] urls[5] = file:/C:/Users/SelcukCabuk/.m2/repository/org/apache/commons/commons-compress/1.20/commons-compress-1.20.jar
[ERROR] urls[6] = file:/C:/Users/SelcukCabuk/.m2/repository/org/iq80/snappy/snappy/0.4/snappy-0.4.jar
[ERROR] urls[7] = file:/C:/Users/SelcukCabuk/.m2/repository/org/tukaani/xz/1.8/xz-1.8.jar
[ERROR] urls[8] = file:/C:/Users/SelcukCabuk/.m2/repository/org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar
[ERROR] urls[9] = file:/C:/Users/SelcukCabuk/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar
[ERROR] urls[10] = file:/C:/Users/SelcukCabuk/.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar
[ERROR] urls[11] = file:/C:/Users/SelcukCabuk/.m2/repository/commons-chain/commons-chain/1.1/commons-chain-1.1.jar
[ERROR] urls[12] = file:/C:/Users/SelcukCabuk/.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar
[ERROR] urls[13] = file:/C:/Users/SelcukCabuk/.m2/repository/commons-logging/commons-logging/1.1/commons-logging-1.1.jar
[ERROR] urls[14] = file:/C:/Users/SelcukCabuk/.m2/repository/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar
[ERROR] urls[15] = file:/C:/Users/SelcukCabuk/.m2/repository/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar
[ERROR] urls[16] = file:/C:/Users/SelcukCabuk/.m2/repository/dom4j/dom4j/1.1/dom4j-1.1.jar
[ERROR] urls[17] = file:/C:/Users/SelcukCabuk/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar
[ERROR] urls[18] = file:/C:/Users/SelcukCabuk/.m2/repository/sslext/sslext/1.2-0/sslext-1.2-0.jar
[ERROR] urls[19] = file:/C:/Users/SelcukCabuk/.m2/repository/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar
[ERROR] urls[20] = file:/C:/Users/SelcukCabuk/.m2/repository/antlr/antlr/2.7.2/antlr-2.7.2.jar
[ERROR] urls[21] = file:/C:/Users/SelcukCabuk/.m2/repository/org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.jar
[ERROR] urls[22] = file:/C:/Users/SelcukCabuk/.m2/repository/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar
[ERROR] urls[23] = file:/C:/Users/SelcukCabuk/.m2/repository/org/apache/velocity/velocity/1.6.2/velocity-1.6.2.jar
[ERROR] urls[24] = file:/C:/Users/SelcukCabuk/.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar
[ERROR] urls[25] = file:/C:/Users/SelcukCabuk/.m2/repository/org/codehaus/plexus/plexus-velocity/1.1.8/plexus-velocity-1.1.8.jar
[ERROR] urls[26] = file:/C:/Users/SelcukCabuk/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[27] = file:/C:/Users/SelcukCabuk/.m2/repository/velocity/velocity/1.5/velocity-1.5.jar
[ERROR] urls[28] = file:/C:/Users/SelcukCabuk/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
[ERROR] urls[29] = file:/C:/Users/SelcukCabuk/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.2/org.eclipse.sisu.inject-0.3.2.jar
[ERROR] urls[30] = file:/C:/Users/SelcukCabuk/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar
[ERROR] urls[31] = file:/C:/Users/SelcukCabuk/.m2/repository/org/apache/maven/maven-builder-support/3.3.9/maven-builder-support-3.3.9.jar
[ERROR] urls[32] = file:/C:/Users/SelcukCabuk/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar
[ERROR] urls[33] = file:/C:/Users/SelcukCabuk/.m2/repository/org/eclipse/aether/aether-util/1.0.2.v20150114/aether-util-1.0.2.v20150114.jar
[ERROR] urls[34] = file:/C:/Users/SelcukCabuk/.m2/repository/com/google/inject/guice/4.0/guice-4.0-no_aop.jar
[ERROR] urls[35] = file:/C:/Users/SelcukCabuk/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
[ERROR] urls[36] = file:/C:/Users/SelcukCabuk/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.jar
[ERROR] urls[37] = file:/C:/Users/SelcukCabuk/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.6/plexus-component-annotations-1.6.jar
[ERROR] urls[38] = file:/C:/Users/SelcukCabuk/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[39] = file:/C:/Users/SelcukCabuk/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : begin 0, end 3, length 2
[ERROR] -> [Help 1]
 

Самое странное, что та же конфигурация, та же pom.xml , успешно собран на ноутбуке моего коллеги, но в моем я получаю эту ошибку.

Удаление папки .m2 и повторная загрузка зависимостей maven ничего не решили.

Что я должен думать об этой проблеме? Если действительно существует несовместимость зависимостей, я думаю, что maven вообще должен создавать проект. Но проблема выглядит специфичной для моей среды.

Ниже приведена конфигурация плагина

             <plugin>
                <groupId>sh.tak.appbundler</groupId>
                <artifactId>appbundle-maven-plugin</artifactId>
                <version>1.2.0</version>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-archiver</artifactId>
                        <version>RELEASE</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.velocity</groupId>
                        <artifactId>velocity-tools</artifactId>
                        <version>2.0</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <mainClass>com.myProject.CLTapplication</mainClass>
                    <jrePath>./target/jre-mac/jre</jrePath>
                    <!--<dictionaryFile>Info.plist</dictionaryFile>-->
                    <jvmVersion>1.8 </jvmVersion>
                    <bundleName>judocu</bundleName>
                    <version>${mainVersion}</version>
                    <generateDiskImageFile>true</generateDiskImageFile>
                    <includeApplicationsSymlink>true</includeApplicationsSymlink>
                    <iconFile>./src/main/resources/images/iconImage.icns</iconFile>
                    <workingDirectory>$APP_ROOT/Contents/Java/lib</workingDirectory>
                    <jvmOptions>
                        <option>-Djava.library.path=$APP_ROOT/Contents/Java/lib</option>
                        <option>-Xmx768m</option>
                        <option>-splash:splash.png</option>
                    </jvmOptions>
                    <additionalBundledClasspathResources>
                        <fileSet>
                            <directory>./../licences</directory>
                            <includes>
                                <include>lib*</include>
                                <include>client.properties</include>
                                <include>splash.png</include>
                            </includes>
                        </fileSet>
                        <fileSet>
                            <directory>./../licences/conf</directory>
                            <includes>
                                <include>log4jClt.xml</include>
                                <include>log4j.dtd</include>
                            </includes>
                        </fileSet>
                    </additionalBundledClasspathResources>
                </configuration>
                <executions>
                    <execution>
                        <phase>install</phase>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
 

Комментарии:

1. Во-первых, какую версию Maven вы используете? И использование «RELEASE» в качестве версии должно быть предотвращено, потому что такая версия не существует…

2. @khmarbaise Я забыл сказать, я использовал версии 4.2.0 и 4.2.4, столкнулся с той же проблемой. И пробовал с maven 3.6.3 и 3.6.0

3. Не могли бы вы, пожалуйста, удалить зависимости из конфигурации appbundle-maven-plugin… и запустите его…

4. Я не знаю почему, но удаление зависимостей сработало

5. Потому что вы меняете зависимости самого плагина, которые могут быть несовместимы….