Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Maven support for containerizing packaged JAR #1746

Merged
merged 34 commits into from
Jun 17, 2019
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
af2e106
wip
chanseokoh May 10, 2019
bc98dac
wip
chanseokoh May 10, 2019
759a8b7
Merge branch 'master' into jar-experiment
chanseokoh May 15, 2019
526a1ba
Add containerizingMode config
chanseokoh May 15, 2019
17d5dd0
Refactor code
chanseokoh May 15, 2019
e63bc7e
fix
chanseokoh May 17, 2019
4ec572d
Update example
chanseokoh May 17, 2019
56562cc
fix example
chanseokoh May 17, 2019
a7728fa
Merge branch 'master' into jar-experiment
chanseokoh May 29, 2019
4d8e81c
Remove debug output
chanseokoh May 29, 2019
bee3268
Fix existing tests
chanseokoh May 29, 2019
c8af0ff
wip
chanseokoh May 29, 2019
13db40c
Add tests
chanseokoh May 30, 2019
17d5ebc
Merge remote-tracking branch 'origin/master' into jar-experiment
chanseokoh May 30, 2019
c0d2c0b
Merge remote-tracking branch 'origin/master' into jar-experiment
chanseokoh May 30, 2019
9a33978
Set appRoot / update error message
chanseokoh May 30, 2019
8135c97
Add tests
chanseokoh May 30, 2019
24ee519
Refactor code
chanseokoh May 30, 2019
8fd5d18
Merge branch 'master' into jar-experiment
chanseokoh May 31, 2019
f0af7af
Merge remote-tracking branch 'origin/master' into jar-experiment
chanseokoh May 31, 2019
4c715c2
Add tests
chanseokoh May 31, 2019
c73eac3
Add integration test
chanseokoh May 31, 2019
185ed13
Define constant for containerizingMode
chanseokoh May 31, 2019
6ff148f
Specialize error message on mode / refactor code
chanseokoh May 31, 2019
2c34f80
Remove unused method introduced briefly
chanseokoh Jun 3, 2019
9365ae7
Get generated JAR in various ways
chanseokoh Jun 4, 2019
c6e5f7c
mainArtifact should be JAR
chanseokoh Jun 4, 2019
dc83f69
Target maven-jar-plugin's JAR path
chanseokoh Jun 4, 2019
279cb1e
Define constant for default mode (exploded)
chanseokoh Jun 12, 2019
32edbba
Error on "packaged" mode with WAR
chanseokoh Jun 12, 2019
19c41e7
Merge remote-tracking branch 'origin/master' into jar-experiment
chanseokoh Jun 12, 2019
ea170e1
Fix test
chanseokoh Jun 12, 2019
bbfff1c
Do not use context classloader
chanseokoh Jun 12, 2019
be7610b
Merge remote-tracking branch 'origin/master' into jar-experiment
chanseokoh Jun 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
chanseokoh committed May 10, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit bc98dacd36a87f159f09fb5f59e763269da7260a
4 changes: 4 additions & 0 deletions examples/helloworld/src/main/java/example/HelloWorld.java
Original file line number Diff line number Diff line change
@@ -28,6 +28,10 @@
public class HelloWorld {

public static void main(String[] args) throws URISyntaxException, IOException {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous code did not work inside a JAR, as it was complaining that there is no "file system" inside it. The new code works both inside and outside a JAR.

Package pack = HelloWorld.class.getPackage();
System.out.println(pack.getImplementationTitle());
System.out.println(pack.getImplementationVersion());

Path worldFile = Paths.get(Resources.getResource("world").toURI());
String world = new String(Files.readAllBytes(worldFile), StandardCharsets.UTF_8);

Original file line number Diff line number Diff line change
@@ -276,7 +276,7 @@ static List<String> computeEntrypoint(
List<String> classpath = new ArrayList<>(rawExtraClasspath);
boolean packagedApp = true;
if (packagedApp) {
classpath.add("/app/classpath");
classpath.add("/app/classpath/*");
classpath.add("/app/libs/*");
} else {
classpath.addAll(JavaEntrypointConstructor.defaultClasspath(appRoot));