Skip to content

Commit 1ecd61b

Browse files
authored
Refactoring, with added feature and some fixes (#25 #27 #19) (#29)
Some renovation and refactoring * fix offsets instead of rebuilding JAR (#25) * programFile should only work with 1 artifact (#27) * allow setting a specific file as input (#19) * add integration tests * Update to basepom 51 * add a github action for CI * update README for added clarity * add maven wrapper
1 parent eb30576 commit 1ecd61b

File tree

43 files changed

+1294
-247
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1294
-247
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI
2+
3+
on:
4+
[ "push", "pull_request" ]
5+
6+
env:
7+
BUILD_JDK: '17'
8+
TEST_JDK: '8'
9+
10+
jobs:
11+
build:
12+
name: build and test
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Set up JDK
17+
uses: actions/setup-java@v3
18+
with:
19+
java-version: |
20+
${{ env.TEST_JDK }}
21+
${{ env.BUILD_JDK }}
22+
distribution: 'corretto'
23+
cache: maven
24+
- name: Build with Maven
25+
run: |
26+
./mvnw -ntp -B package
27+
- name: Run integration tests
28+
run: |
29+
./mvnw -e -ntp -B -Dinvoker.javaHome="$JAVA_HOME_${{ env.TEST_JDK }}_${{ runner.arch }}" verify
30+
- name: Run integration tests on older Maven
31+
run: |
32+
./mvnw wrapper:wrapper -Dmaven=3.6.0
33+
./mvnw -e -B -Dinvoker.javaHome="$JAVA_HOME_${{ env.TEST_JDK }}_${{ runner.arch }}" verify
34+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ out
1212
.settings
1313
*~
1414
test-output
15+
/.mvn/wrapper/maven-wrapper.jar

.mvn/wrapper/maven-wrapper.properties

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.0/apache-maven-3.9.0-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar

README.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
To use it, add a plugin to your pom like
1+
# really-executable-jar-maven-plugin
22

3-
``` xml
3+
There is an introductory blog post at http://skife.org/java/unix/2011/06/20/really_executable_jars.html
4+
5+
To use it, add a plugin to your pom like:
46

7+
``` xml
58
<!-- You need to build an exectuable uberjar, I like Shade for that -->
69
<plugin>
710
<groupId>org.apache.maven.plugins</groupId>
811
<artifactId>maven-shade-plugin</artifactId>
9-
<version>2.0</version>
12+
<version>3.4.1</version>
1013
<executions>
1114
<execution>
1215
<phase>package</phase>
@@ -15,7 +18,6 @@ To use it, add a plugin to your pom like
1518
</goals>
1619
<configuration>
1720
<transformers>
18-
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
1921
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
2022

2123
<!-- note that the main class is set *here* -->
@@ -24,16 +26,6 @@ To use it, add a plugin to your pom like
2426
</transformer>
2527
</transformers>
2628
<createDependencyReducedPom>false</createDependencyReducedPom>
27-
<filters>
28-
<filter>
29-
<artifact>*:*</artifact>
30-
<excludes>
31-
<exclude>META-INF/*.SF</exclude>
32-
<exclude>META-INF/*.DSA</exclude>
33-
<exclude>META-INF/*.RSA</exclude>
34-
</excludes>
35-
</filter>
36-
</filters>
3729
</configuration>
3830
</execution>
3931
</executions>
@@ -43,7 +35,7 @@ To use it, add a plugin to your pom like
4335
<plugin>
4436
<groupId>org.skife.maven</groupId>
4537
<artifactId>really-executable-jar-maven-plugin</artifactId>
46-
<version>2.0.0</version>
38+
<version>2.1.0</version>
4739
<configuration>
4840
<!-- value of flags will be interpolated into the java invocation -->
4941
<!-- as "java $flags -jar ..." -->
@@ -78,6 +70,13 @@ To use it, add a plugin to your pom like
7870

7971
Changes:
8072

73+
```
74+
2.1.0 - use zip-prefixer instead of rebuilding JAR
75+
- improve handling of multi-artifact builds
76+
- add inputFile parameter to select any file
77+
- add basic integration testing
78+
- require JDK 11+ to build (plugin still targets JDK 8)
79+
8180
2.0.0 - support ZIP64 format
8281
- require Java 8, drop support for JDK7
8382
- support packaging other file formats than jars
@@ -97,9 +96,6 @@ Changes:
9796
.jar) executable, just the programFile one.
9897
9998
1.0.0 - Stable
99+
```
100100

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

105-
[![Build Status](https://travis-ci.org/brianm/really-executable-jars-maven-plugin.svg?branch=master)](https://travis-ci.org/brianm/really-executable-jars-maven-plugin)

0 commit comments

Comments
 (0)