Skip to content

BND might get wrong file extension #5286

@laeubi

Description

@laeubi

AbstractBndMavenPlugin makes the (wrong) assumption that the file extension is always the packaging type, while this is true for some (e.g. jar/war) this is not generally true.

private File createArtifactFile() {
return new File(targetDir, project.getBuild()
.getFinalName()
+ getClassifier().map("-"::concat)
.orElse("")
+ "." + project.getPackaging());
}

Instead BND should query the org.apache.maven.artifact.handler.manager.ArtifactHandlerManager e.g.

public String getExtension(String packaging) {
    if (packaging == null) {
        return "jar";
    }
    ArtifactHandler handler = artifactHandlerManager.getArtifactHandler(packaging);
    return handler.getExtension();
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions