Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
19 changed files
with
230 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...radle-plugin/src/test/java/com/example/bootjar/classpath/BootJarClasspathApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 2012-2019 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.example.bootjar.classpath; | ||
|
||
import java.net.URL; | ||
import java.net.URLClassLoader; | ||
|
||
/** | ||
* Application used for testing classpath handling with BootJar. | ||
* | ||
* @author Andy Wilkinson | ||
*/ | ||
public class BootJarClasspathApplication { | ||
|
||
protected BootJarClasspathApplication() { | ||
|
||
} | ||
|
||
public static void main(String[] args) { | ||
int i = 1; | ||
ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); | ||
for (URL url : ((URLClassLoader) classLoader).getURLs()) { | ||
System.out.println(i++ + ". " + url.getFile()); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ols/spring-boot-gradle-plugin/src/test/java/com/example/bootrun/main/CustomMainClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright 2012-2020 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.example.bootrun.main; | ||
|
||
/** | ||
* Application used for testing {@code BootRun}'s main class configuration. | ||
* | ||
* @author Andy Wilkinson | ||
*/ | ||
public class CustomMainClass { | ||
|
||
protected CustomMainClass() { | ||
|
||
} | ||
|
||
public static void main(String[] args) { | ||
System.out.println(CustomMainClass.class.getName()); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
...ols/spring-boot-gradle-plugin/src/test/java/com/example/bootwar/main/CustomMainClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright 2012-2020 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.example.bootwar.main; | ||
|
||
/** | ||
* Application used for testing {@code BootRun}'s main class configuration. | ||
* | ||
* @author Andy Wilkinson | ||
*/ | ||
public class CustomMainClass { | ||
|
||
protected CustomMainClass() { | ||
|
||
} | ||
|
||
public static void main(String[] args) { | ||
System.out.println(CustomMainClass.class.getName()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...rk/boot/gradle/tasks/bundling/BootJarIntegrationTests-explodedApplicationClasspath.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '{version}' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { url "file:repository" } | ||
} | ||
|
||
dependencies { | ||
implementation("com.example:library:1.0-SNAPSHOT") | ||
implementation("org.apache.commons:commons-lang3:3.9") | ||
} | ||
|
||
task explode(type: Sync) { | ||
dependsOn(bootJar) | ||
destinationDir = file("$buildDir/exploded") | ||
from zipTree(files(bootJar).singleFile) | ||
} | ||
|
||
task launch(type: JavaExec) { | ||
classpath = files(explode) | ||
main = 'org.springframework.boot.loader.JarLauncher' | ||
} |
19 changes: 19 additions & 0 deletions
19
...rk/boot/gradle/tasks/bundling/BootJarIntegrationTests-packagedApplicationClasspath.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '{version}' | ||
} | ||
|
||
task launch(type: JavaExec) { | ||
classpath = files(bootJar) | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { url "file:repository" } | ||
} | ||
|
||
dependencies { | ||
implementation("com.example:library:1.0-SNAPSHOT") | ||
implementation("org.apache.commons:commons-lang3:3.9") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.