有没有办法以独立于平台的方式运行install4j-maven-plugin? (i4j 7.0.6)

时间:2018-06-20 14:15:49

标签: maven install4j

我希望因为install4j本质上是一个jar文件,所以我可以解压缩Linux / Unix .tar.gz并通过install4j-maven-plugin属性将其提供给<installDir>。遗憾的是,这失败了,因为插件坚持要在Windows上运行.exe

有没有办法使这项工作有效? 我可以在POM中检测环境,并通过Maven配置文件在调用细节之间进行切换,但这会使POM变得复杂,因此,我非常希望我可以使install4j-maven-plugin仅运行jar文件。

相关的Maven日志:

[INFO] --- install4j-maven-plugin:1.0.7:compile (compile-installers) @ id-gui ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=79, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=35, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=1, ConflictResolver.conflictItemCount=74, DefaultDependencyCollector.collectTime=16, DefaultDependencyCollector.transformTime=1}
[DEBUG] org.sonatype.install4j:install4j-maven-plugin:jar:1.0.7:
[DEBUG]    org.apache.maven:maven-core:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-settings:jar:2.2.1:compile
[DEBUG]          org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
[DEBUG]       org.apache.maven:maven-plugin-parameter-documenter:jar:2.2.1:compile
[DEBUG]       org.slf4j:jcl-over-slf4j:jar:1.5.6:runtime
[DEBUG]       org.apache.maven.reporting:maven-reporting-api:jar:2.2.1:compile
[DEBUG]          org.apache.maven.doxia:doxia-sink-api:jar:1.1:compile
[DEBUG]          org.apache.maven.doxia:doxia-logging-api:jar:1.1:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-model:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:2.2.1:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG]          junit:junit:jar:3.8.1:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-error-diagnostics:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-project:jar:2.2.1:compile
[DEBUG]          org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
[DEBUG]       commons-cli:commons-cli:jar:1.2:compile
[DEBUG]       org.apache.maven:maven-plugin-descriptor:jar:2.2.1:compile
[DEBUG]       org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile
[DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
[DEBUG]          backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
[DEBUG]       org.apache.maven:maven-monitor:jar:2.2.1:compile
[DEBUG]       org.codehaus.plexus:plexus-utils:jar:1.5.15:compile
[DEBUG]       classworlds:classworlds:jar:1.1:compile
[DEBUG]       org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
[DEBUG]          org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.2.1:compile
[DEBUG]    org.eclipse.aether:aether-api:jar:0.9.0.M3:compile
[DEBUG]    org.eclipse.aether:aether-util:jar:0.9.0.M3:compile
[DEBUG]    org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.1:compile
[DEBUG]    org.apache.ant:ant:jar:1.8.4:compile
[DEBUG]    org.apache.ant:ant-launcher:jar:1.8.4:compile
[DEBUG] Created new class realm plugin>org.sonatype.install4j:install4j-maven-plugin:1.0.7
[DEBUG] Importing foreign packages into class realm plugin>org.sonatype.install4j:install4j-maven-plugin:1.0.7
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.sonatype.install4j:install4j-maven-plugin:1.0.7
[DEBUG]   Included: org.sonatype.install4j:install4j-maven-plugin:jar:1.0.7
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
[DEBUG]   Included: org.slf4j:jcl-over-slf4j:jar:1.5.6
[DEBUG]   Included: org.apache.maven.reporting:maven-reporting-api:jar:2.2.1
[DEBUG]   Included: org.apache.maven.doxia:doxia-sink-api:jar:1.1
[DEBUG]   Included: org.apache.maven.doxia:doxia-logging-api:jar:1.1
[DEBUG]   Included: junit:junit:jar:3.8.1
[DEBUG]   Included: commons-cli:commons-cli:jar:1.2
[DEBUG]   Included: org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4
[DEBUG]   Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.5.15
[DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
[DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
[DEBUG]   Included: org.eclipse.aether:aether-util:jar:0.9.0.M3
[DEBUG]   Included: org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.1
[DEBUG]   Included: org.apache.ant:ant:jar:1.8.4
[DEBUG]   Included: org.apache.ant:ant-launcher:jar:1.8.4
[DEBUG] Configuring mojo org.sonatype.install4j:install4j-maven-plugin:1.0.7:compile from plugin realm ClassRealm[plugin>org.sonatype.install4j:install4j-maven-plugin:1.0.7, parent: sun.misc.Launcher$AppClassLoader@18b4aac2]
[DEBUG] Configuring mojo 'org.sonatype.install4j:install4j-maven-plugin:1.0.7:compile' with basic configurator -->
[DEBUG]   (f) attach = false
[DEBUG]   (f) buildSelected = false
[DEBUG]   (f) debug = false
[DEBUG]   (f) destination = C:\develop\id-gui\id-gui\target
[DEBUG]   (f) disableSigning = false
[DEBUG]   (f) failIfMissing = true
[DEBUG]   (f) faster = false
[DEBUG]   (f) installDir = C:\develop\id-gui\id-gui\target\install4j
[DEBUG]   (f) projectFile = C:\develop\id-gui\id-gui\src\install\SIX_iD.install4j
[DEBUG]   (f) quiet = false
[DEBUG]   (f) release = 10.1.0-SNAPSHOT
[DEBUG]   (f) skip = false
[DEBUG]   (f) test = false
[DEBUG]   (f) verbose = false
[DEBUG]   (f) winKeystorePassword = S3eSpuya
[DEBUG]   (f) project = MavenProject: com.six-group.six-id:id-gui:10.1.0-SNAPSHOT @ C:\develop\id-gui\id-gui\pom.xml
[DEBUG] -- end configuration --
[DEBUG] Detected Java version: 1.8 in: C:\Daten\software\jdk-8u152-windows-x64\jre
[DEBUG] Detected OS: Windows 7
[DEBUG] Setting property: scmBranch=feature/local-installer-build
[DEBUG] Setting property: maven.build.timestamp.format=yyyy-MM-dd'T'HH:mm:ss
[DEBUG] Setting property: java.version=1.8
[DEBUG] Override ignored for property "java.version"
[DEBUG] Setting property: install4j.home=C:\Daten\software\install4j7
[DEBUG] Setting property: slf4jversion=1.7.12
[DEBUG] Setting property: install4j.pass=S3eSpuya
[DEBUG] Setting property: logbackversion=0.9.24
[DEBUG] Setting property: timestamp=1529501201991
[DEBUG] Setting property: build.timestamp=2018-06-20T13:26:40
[DEBUG] Setting property: project.build.sourceEncoding=UTF-8
[DEBUG] Setting property: build.revision=301be02
[DEBUG] Setting property: project.basedir=C:\develop\id-gui\id-gui
[DEBUG] install4j installation directory: C:\develop\id-gui\id-gui\target\install4j
[ERROR] Missing install4j compiler executable: C:\develop\id-gui\id-gui\target\install4j\bin\install4jc.exe

1 个答案:

答案 0 :(得分:1)

  

因为install4j本质上是一个jar文件

maven插件调用本地启动器bin/install4jc。由于对于install4j的所有平台都没有带有本机启动程序的多平台tar.gz发行版,因此必须在要使用install4j的每个平台上安装适当的归档文件。