fixed support for EJB client libraries

This commit is contained in:
2024-03-09 16:29:26 -05:00
parent 6b5dfddd71
commit c4385d11b4
2 changed files with 39 additions and 19 deletions

View File

@@ -108,25 +108,27 @@ public class WildflyArtifactExtractor {
if (this.getLog().isDebugEnabled()) if (this.getLog().isDebugEnabled())
this.getLog().debug("Formulated artifact effective POM [" + artifact + "]: " + model.getId()); this.getLog().debug("Formulated artifact effective POM [" + artifact + "]: " + model.getId());
switch (model.getPackaging().toLowerCase()) { if (!"client".equals(artifact.getClassifier())) {
case "ear": switch (model.getPackaging().toLowerCase()) {
case "war": case "ear":
case "ejb": case "war":
this.getLog().debug("Discovered deployable artifact [" + artifact + "]: " + model.getId()); case "ejb":
this.getLog().debug("Discovered deployable artifact [" + artifact + "]: " + model.getId());
WildflyDeployable deployable = new WildflyDeployable();
deployable.id = artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getClassifier(); WildflyDeployable deployable = new WildflyDeployable();
deployable.version = artifact.getVersion(); deployable.id = artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getClassifier();
deployable.type = model.getPackaging(); deployable.version = artifact.getVersion();
deployable.type = model.getPackaging();
Map<String, String> props = new HashMap<>();
props.put("id", deployable.id); Map<String, String> props = new HashMap<>();
props.put("version", deployable.version); props.put("id", deployable.id);
props.put("type", deployable.type); props.put("version", deployable.version);
artifact.setProperties(props); props.put("type", deployable.type);
artifact.setProperties(props);
return deployable;
default: return deployable;
default:
}
} }
Properties modelProps = model.getProperties(); Properties modelProps = model.getProperties();

View File

@@ -18,6 +18,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.Parameter;
@@ -49,6 +50,23 @@ public class CopyDeploymentResourcesGoal extends AbstractDeploymentGoal {
} }
} }
@Override
protected void handleDeployableDependency(Dependency dependency) throws MojoExecutionException, MojoFailureException {
String type = dependency.getArtifact().getProperties().get("type");
if ("ejb".equals(type)) {
}
try {
FileUtils.copyFileToDirectory(dependency.getArtifact().getFile(), this.libDirectory);
} catch (IOException ie) {
throw new MojoExecutionException("An I/O related issue occurred", ie);
}
if (this.getLog().isInfoEnabled())
this.getLog().info("Copied resource artifact: " + dependency.getArtifact());
}
@Override @Override
protected void handleDependency(Dependency dependency) throws MojoExecutionException { protected void handleDependency(Dependency dependency) throws MojoExecutionException {
try { try {