如何在izpack 5.0.0中使用gradle-izpack插件

时间:2014-03-20 10:24:53

标签: gradle izpack

我们现在正在使用gradle-izpack一段时间,而且效果非常好。 我尝试将依赖项升级到从分发站点下载的izpack 5.0.0-rc1。 无论如何,在打包安装程序时我遇到了一个奇怪的错误:

:izPackCreateInstaller
[ant:izpack] Exception in thread "Thread-3" java.lang.NullPointerException: componentInstance cannot be null
[ant:izpack]    at org.picocontainer.adapters.InstanceAdapter.getInstanceClass(InstanceAdapter.java:69)
[ant:izpack]    at org.picocontainer.adapters.InstanceAdapter.<init>(InstanceAdapter.java:50)
[ant:izpack]    at org.picocontainer.DefaultPicoContainer.addConfig(DefaultPicoContainer.java:506)
[ant:izpack]    at com.izforge.izpack.core.container.AbstractContainer.addConfig(AbstractContainer.java:172)
[ant:izpack]    at com.izforge.izpack.ant.IzpackAntRunnable.run(IzpackAntRunnable.java:43)
[ant:izpack]    at java.lang.Thread.run(Unknown Source)

我在一年前发现了类似的帖子,但没有解决方案。

感谢任何帮助 尔根

1 个答案:

答案 0 :(得分:2)

我刚碰到这个。我最终不得不直接调用编译器。

configurations {
   izpack    
}

dependencies {
    izpack 'org.codehaus.izpack:izpack-ant:5.0.0-rc4'
    izpack project(':symmetric-pro-izpack')
}

task izpack(dependsOn:'prepareIzpack') {
    description = "Creates an IzPack based installer for both binary and source distributions."

    doLast {
        javaexec {
            main = 'com.izforge.izpack.compiler.bootstrap.CompilerLauncher'
            classpath = configurations.izpack
            args = [
                "$projectDir/src/izpack/install.xml",
                "-b",
                "$buildDir/assemble/izpack",
                "-o",
                "$buildDir/distributions/app-${version}-setup.jar",
                "-c",
                "deflate",
                "-l",
                "9",
                "-k",
                "standard"                    
            ]
        }
    }
}