Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,13 @@ public void execute() throws MojoExecutionException, MojoFailureException {
filter(inputFile, outputFile);
getLog().info("Generation not enabled");
getLog().info("Attaching artifact");
//projectHelper.attachArtifact(project, attachmentArtifactType, attachmentArtifactClassifier, outputFile);
Artifact artifact = factory.createArtifactWithClassifier(project.getGroupId(), project.getArtifactId(), project.getVersion(), attachmentArtifactType, attachmentArtifactClassifier);
artifact.setFile(outputFile);
project.setArtifact(artifact);
if (project.getPackaging().equals("feature")) {
Artifact artifact = factory.createArtifactWithClassifier(project.getGroupId(), project.getArtifactId(), project.getVersion(), attachmentArtifactType, attachmentArtifactClassifier);
artifact.setFile(outputFile);
project.setArtifact(artifact);
} else {
projectHelper.attachArtifact(project, attachmentArtifactType, attachmentArtifactClassifier, outputFile);
}
return;
}
}
Expand All @@ -364,9 +367,17 @@ public void execute() throws MojoExecutionException, MojoFailureException {
try (PrintStream out = new PrintStream(new FileOutputStream(outputFile))) {
writeFeatures(out);
}
getLog().info("Attaching features XML");
// now lets attach it
projectHelper.attachArtifact(project, attachmentArtifactType, attachmentArtifactClassifier, outputFile);
if (project.getPackaging().equals("feature") && enableGeneration) {
getLog().info("Set artifact");
Artifact artifact = factory.createArtifactWithClassifier(project.getGroupId(), project.getArtifactId(), project.getVersion(), attachmentArtifactType
, FEATURE_CLASSIFIER);
artifact.setFile(outputFile);
project.setArtifact(artifact);
} else {
getLog().info("Attaching features XML");
// now lets attach it
projectHelper.attachArtifact(project, attachmentArtifactType, attachmentArtifactClassifier, outputFile);
}
} else {
throw new MojoExecutionException("Could not create directory for features file: " + dir);
}
Expand Down