栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

尝试使用Alakai插件将Launch4j集成到Maven项目中

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

尝试使用Alakai插件将Launch4j集成到Maven项目中

  1. 没有config.xml,您需要在pom.xml文件中配置launch4j。
  2. 您可以使用maven-assembly-plugin,但是我建议您使用maven-shade-plugin。
  3. 无需指定launch4j安装,此插件可以100%运行Maven。
  4. 当然。遵循我使用的shade和launch4j配置,使用不同的主类生成两个exe,一个控制台和一个gui:
    <plugin>        <groupId>org.apache.maven.plugins</groupId>        <artifactId>maven-shade-plugin</artifactId>        <version>1.4</version>        <executions> <execution>     <phase>package</phase>     <goals>         <goal>shade</goal>     </goals> </execution>        </executions>        <configuration> <shadedArtifactAttached>true</shadedArtifactAttached> <!-- Make the shaded artifact not the main one --> <shadedClassifierName>shaded</shadedClassifierName> <!-- set the suffix to the shaded jar -->        </configuration>    </plugin>    <plugin>        <groupId>org.bluestemsoftware.open.maven.plugin</groupId>        <artifactId>launch4j-plugin</artifactId>        <version>1.5.0.0</version>        <executions> <!-- GUI exe --> <execution>     <id>l4j-gui</id>     <phase>package</phase>     <goals>         <goal>launch4j</goal>     </goals>     <configuration>         <headerType>gui</headerType>         <outfile>target/app-gui.exe</outfile>         <jar>target/${artifactId}-${version}-shaded.jar</jar> <!-- 'shaded' is the value set on shadedClassifierName above -->         <errTitle>App Err</errTitle>         <classPath>  <mainClass>package.AppGUI</mainClass>         </classPath>         <icon>src/main/resources/icons/exeIcon.ico</icon>         <jre>  <minVersion>1.5.0</minVersion>  <maxVersion>1.6.0</maxVersion>  <initialHeapSize>128</initialHeapSize>  <maxHeapSize>1024</maxHeapSize>         </jre>         <versionInfo>  <fileVersion>1.0.0.0</fileVersion>  <txtFileVersion>1.0.0.0</txtFileVersion>  <fileDescription>Desc</fileDescription>  <copyright>C</copyright>  <productVersion>1.0.0.0</productVersion>  <txtProductVersion>1.0.0.0</txtProductVersion>  <productName>Product</productName>  <internalName>Product</internalName>  <originalFilename>App.exe</originalFilename>         </versionInfo>     </configuration> </execution> <!-- Command-line exe --> <execution>     <id>l4j-cli</id>     <phase>package</phase>     <goals>         <goal>launch4j</goal>     </goals>     <configuration>         <headerType>console</headerType>         <outfile>target/app-cli.exe</outfile>         <jar>target/${artifactId}-${version}-shaded.jar</jar> <!-- 'shaded' is the value set on shadedClassifierName above -->         <errTitle>App Err</errTitle>         <classPath>  <mainClass>package.AppCLI</mainClass>         </classPath>         <icon>src/main/resources/icons/exeIcon.ico</icon>         <jre>  <minVersion>1.5.0</minVersion>  <maxVersion>1.6.0</maxVersion>  <initialHeapSize>128</initialHeapSize>  <maxHeapSize>1024</maxHeapSize>         </jre>     </configuration> </execution>        </executions>    </plugin>

或者,您可以在launch4j-plugin上省略’jar’标签,并删除shade-
plugin的额外配置,但是请注意,这将用阴影jar(带有嵌入式)替换流的主jar(无嵌入式依赖项)。依赖项),并且该版本将安装在您的本地存储库中,或在需要时在反应堆中使用。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/452917.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号