Skip to content

Commit

Permalink
Merge pull request #87 from dweiss/fileArtifact
Browse files Browse the repository at this point in the history
Allow referencing non-jarred artefacts (so that compile phase works).
  • Loading branch information
uschindler committed Nov 9, 2015
2 parents 851409c + 66d3027 commit 229d9e0
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ private URL createJarUrl(File f, String jarPath) throws MalformedURLException {
return new URL(jarBaseUrl, encodeUrlPath(jarPath));
}

private URL createFileUrl(File f, String relativePath) throws MalformedURLException {
return new File(f, relativePath).toURI().toURL();
}

@Override
public void execute() throws MojoExecutionException {
final Logger log = new Logger() {
Expand Down Expand Up @@ -363,11 +367,16 @@ public void info(String msg) {
if (signaturesFiles != null) {
sigFiles.addAll(Arrays.asList(signaturesFiles));
}

if (signaturesArtifacts != null) {
for (final SignaturesArtifact artifact : signaturesArtifacts) {
final File f = resolveSignaturesArtifact(artifact);
if (artifact.path != null) {
sigUrls.add(createJarUrl(f, artifact.path));
if (f.isDirectory()) {
sigUrls.add(createFileUrl(f, artifact.path));
} else {
sigUrls.add(createJarUrl(f, artifact.path));
}
} else {
sigFiles.add(f);
}
Expand Down

0 comments on commit 229d9e0

Please sign in to comment.