Skip to content

Commit

Permalink
maven: Use actual file name for jar file type test
Browse files Browse the repository at this point in the history
Since we care about the file and not just the artifact object, we check
the file name for ending in ".jar" (jar extension) instead of relying
on the artifact reporting the "jar" type.

Fixes #5349

Signed-off-by: BJ Hargrave <bj@hargrave.dev>
  • Loading branch information
bjhargrave committed Aug 19, 2022
1 parent b545b94 commit b3dcf38
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -302,8 +302,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
builder.updateModified(cpeJar.lastModified(), cpe.getPath());
buildpath.add(cpeJar);
} else {
if (!artifact.getType()
.equals("jar")) {
if (!cpe.getName().endsWith(".jar")) {
/*
* Check if it is a valid zip file. We don't create a
* Jar object here because we want to avoid the cost of
Expand Down

0 comments on commit b3dcf38

Please sign in to comment.