java - appbundle-maven-plugin 在使用 java 10 的 mac OSX 上失败

标签 java maven app-bundle

我尝试使用 appbundle-maven-plugin 打包我的应用程序,但出现以下错误:

[ERROR] Failed to execute goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle (default) on project mailAutomatedReply: 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:/Users/home/.m2/repository/sh/tak/appbundler/appbundle-maven-plugin/1.2.0/appbundle-maven-plugin-1.2.0.jar
[ERROR] urls[1] = file:/Users/home/.m2/repository/org/codehaus/plexus/plexus-velocity/1.1.8/plexus-velocity-1.1.8.jar
.
.
.
[ERROR] Number of foreign imports: 1

插件定义如下:

         <plugin>
            <groupId>sh.tak.appbundler</groupId>
            <artifactId>appbundle-maven-plugin</artifactId>
            <version>1.2.0</version>
            <configuration>
                <mainClass>package.SwingMainApp</mainClass>
                <bundleName>Inscription</bundleName>
                <iconFile>logoInscriptionsApp.png</iconFile>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>bundle</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

Java 版本如下:

> java -version
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)

谢谢

最佳答案

您需要使用最新的依赖项:将其添加到您的 <plugin> 中.

<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>package.SwingMainApp</mainClass>
        <bundleName>Inscription</bundleName>
        <iconFile>logoInscriptionsApp.icns</iconFile>
    </configuration>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>bundle</goal>
            </goals>
        </execution>
    </executions>
</plugin>

关于java - appbundle-maven-plugin 在使用 java 10 的 mac OSX 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53696439/

相关文章:

c# - Monomac System.Net.WebRequest 的类型初始值设定项所显示的异常

android - 如何通过 App Bundle 使用 Android 扩展文件?

python - 从任何(不安全)字符串创建(正常/安全)应用程序包标识符

java - 将字符串存储在整数数组中。

java - 回溯 - 给定一组数字,找到和等于 M 的所有子集(M 已给定)

java - Maven Central 和 JCenter 是否容易被域名仿冒?

java - 导入到 Eclipse 时,Maven 生成的项目看起来有所不同

maven - Wildfly 部署 Maven - 删除版本

java - 如何在单元测试中用内容数据模拟页面?

java - 如何根据行数删除数据库表行