• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

brianm/really-executable-jars-maven-plugin: maven plugin for making chmod +x jar ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

brianm/really-executable-jars-maven-plugin

开源软件地址(OpenSource Url):

https://github.com/brianm/really-executable-jars-maven-plugin

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

To use it, add a plugin to your pom like

<!-- You need to build an exectuable uberjar, I like Shade for that -->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>2.0</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>shade</goal>
            </goals>
            <configuration>
                <transformers>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">

                        <!-- note that the main class is set *here* -->

                        <mainClass>com.example.Main</mainClass>
                    </transformer>
                </transformers>
                <createDependencyReducedPom>false</createDependencyReducedPom>
                <filters>
                    <filter>
                        <artifact>*:*</artifact>
                        <excludes>
                            <exclude>META-INF/*.SF</exclude>
                            <exclude>META-INF/*.DSA</exclude>
                            <exclude>META-INF/*.RSA</exclude>
                        </excludes>
                    </filter>
                </filters>
            </configuration>
        </execution>
    </executions>
</plugin>

<!-- now make the jar chmod +x style executable -->
<plugin>
  <groupId>org.skife.maven</groupId>
  <artifactId>really-executable-jar-maven-plugin</artifactId>
  <version>1.4.1</version>
  <configuration>
    <!-- value of flags will be interpolated into the java invocation -->
    <!-- as "java $flags -jar ..." -->
    <flags>-Xmx1G</flags>

    <!-- (optional) name for binary executable, if not set will just -->
    <!-- make the regular jar artifact executable -->
    <programFile>nifty-executable</programFile>

    <!-- (optional) support other packaging formats than jar -->
    <!-- <allowOtherTypes>true</allowOtherTypes> -->
    
    <!-- (optional) name for a file that will define what script gets -->
    <!-- embedded into the executable jar.  This can be used to -->
    <!-- override the default startup script which is -->
    <!-- `#!/bin/sh -->
    <!--            -->
    <!-- exec java " + flags + " -jar "$0" "$@" -->
    <!-- <scriptFile>src/packaging/someScript.extension</scriptFile> -->
  </configuration>

  <executions>
    <execution>
      <phase>package</phase>
      <goals>
        <goal>really-executable-jar</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Changes:

1.4.0 - require Java 7, change code to use JDK7 APIs - Support Windows - Don't suppress errors

1.3.0 - add helpmojo - allow attachment of executable instead of unconditional replacement - make extension configurable - allow script replacement in the resulting executable

1.2.0 - never released

1.1.0 - If programFile is set, do not make the base artifact (the .jar) executable, just the programFile one.

1.0.0 - Stable

There is an introductory blog post at http://skife.org/java/unix/2011/06/20/really_executable_jars.html


Build Status




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap