Skip to content

Commit

Permalink
Use Dependencies only when inputSpec starts with "jar:"
Browse files Browse the repository at this point in the history
  • Loading branch information
parenko committed Jul 7, 2024
1 parent ee17acc commit 69d72d1
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ public void execute() throws MojoExecutionException {
if (isNotEmpty(inputSpec)) {
URL url = inputSpecRemoteUrl();

if ((! inputSpecFile.exists()) && url != null) {
if (!inputSpecFile.exists() && url != null) {
configurator.setInputSpec(url.toString());
} else {
configurator.setInputSpec(inputSpec);
Expand Down Expand Up @@ -1019,7 +1019,10 @@ private String calculateInputSpecHash(String inputSpec) {
* @return A valid URL or null if inputSpec is not a valid URL
*/
private URL inputSpecRemoteUrl() {
URL url = dependencyClassLoader().getResource(inputSpec);
URL url = null;
if(inputSpec.toLowerCase().startsWith("jar:")) {
url = dependencyClassLoader().getResource(inputSpec);
}

if (url == null) {
try {
Expand All @@ -1037,7 +1040,7 @@ private ClassLoader dependencyClassLoader() {
for (Artifact artifact : project.getArtifacts()) {
try {
if (artifact.isResolved() && artifact.getType().equals("jar")) {
list.add(new URL("jar:" + artifact.getFile().toURI() + "!/"));
list.add(new URI("jar:" + artifact.getFile().toURI() + "!/").toURL());
}
} catch (Exception e) {
}
Expand Down

0 comments on commit 69d72d1

Please sign in to comment.