Merge branch 'develop' into stable
This commit is contained in:
commit
3aba1362dd
src/main/java/com/inteligr8/wildfly/maven
@ -32,7 +32,6 @@ import org.eclipse.aether.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.resolution.ArtifactRequest;
|
||||
import org.eclipse.aether.resolution.ArtifactResolutionException;
|
||||
import org.eclipse.aether.resolution.ArtifactResult;
|
||||
import org.eclipse.aether.transfer.ArtifactNotFoundException;
|
||||
|
||||
import com.inteligr8.wildfly.maven.model.WildflyArtifact;
|
||||
import com.inteligr8.wildfly.maven.model.WildflyDeployable;
|
||||
@ -70,8 +69,8 @@ public class WildflyArtifactExtractor {
|
||||
WildflyModule module = new WildflyModule();
|
||||
module.id = artifact.getProperty("id", null);
|
||||
module.version = artifact.getProperty("version", null);
|
||||
module.exportMetaInf = Boolean.parseBoolean(artifact.getProperty("exportMetaInf", Boolean.FALSE.toString()));
|
||||
module.exportServices = Boolean.parseBoolean(artifact.getProperty("exportServices", Boolean.FALSE.toString()));
|
||||
module.exportMetaInf = artifact.getProperty("exportMetaInf", null);
|
||||
module.exportServices = artifact.getProperty("exportServices", null);
|
||||
module.exportAnnotations = Boolean.parseBoolean(artifact.getProperty("exportAnnotations", Boolean.FALSE.toString()));
|
||||
module.isSystem = Boolean.parseBoolean(artifact.getProperty("isSystem", Boolean.FALSE.toString()));
|
||||
return module;
|
||||
@ -108,25 +107,27 @@ public class WildflyArtifactExtractor {
|
||||
if (this.getLog().isDebugEnabled())
|
||||
this.getLog().debug("Formulated artifact effective POM [" + artifact + "]: " + model.getId());
|
||||
|
||||
switch (model.getPackaging().toLowerCase()) {
|
||||
case "ear":
|
||||
case "war":
|
||||
case "ejb":
|
||||
this.getLog().debug("Discovered deployable artifact [" + artifact + "]: " + model.getId());
|
||||
|
||||
WildflyDeployable deployable = new WildflyDeployable();
|
||||
deployable.id = artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getClassifier();
|
||||
deployable.version = artifact.getVersion();
|
||||
deployable.type = model.getPackaging();
|
||||
|
||||
Map<String, String> props = new HashMap<>();
|
||||
props.put("id", deployable.id);
|
||||
props.put("version", deployable.version);
|
||||
props.put("type", deployable.type);
|
||||
artifact.setProperties(props);
|
||||
|
||||
return deployable;
|
||||
default:
|
||||
if (!"client".equals(artifact.getClassifier())) {
|
||||
switch (model.getPackaging().toLowerCase()) {
|
||||
case "ear":
|
||||
case "war":
|
||||
case "ejb":
|
||||
this.getLog().debug("Discovered deployable artifact [" + artifact + "]: " + model.getId());
|
||||
|
||||
WildflyDeployable deployable = new WildflyDeployable();
|
||||
deployable.id = artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getClassifier();
|
||||
deployable.version = artifact.getVersion();
|
||||
deployable.type = model.getPackaging();
|
||||
|
||||
Map<String, String> props = new HashMap<>();
|
||||
props.put("id", deployable.id);
|
||||
props.put("version", deployable.version);
|
||||
props.put("type", deployable.type);
|
||||
artifact.setProperties(props);
|
||||
|
||||
return deployable;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
Properties modelProps = model.getProperties();
|
||||
@ -142,16 +143,20 @@ public class WildflyArtifactExtractor {
|
||||
WildflyModule module = new WildflyModule();
|
||||
module.id = moduleId;
|
||||
module.version = moduleVersion;
|
||||
module.exportMetaInf = Boolean.parseBoolean(modelProps.getProperty("wildfly.module.meta"));
|
||||
module.exportServices = Boolean.parseBoolean(modelProps.getProperty("wildfly.module.services"));
|
||||
module.exportMetaInf = modelProps.getProperty("wildfly.module.meta");
|
||||
module.exportServices = modelProps.getProperty("wildfly.module.services");
|
||||
module.exportAnnotations = Boolean.parseBoolean(modelProps.getProperty("wildfly.module.annotations"));
|
||||
module.isSystem = Boolean.parseBoolean(modelProps.getProperty("wildfly.module.system"));
|
||||
|
||||
// for backward compatibility
|
||||
if ("true".equalsIgnoreCase(module.exportMetaInf))
|
||||
module.exportMetaInf = "export";
|
||||
|
||||
Map<String, String> props = new HashMap<>();
|
||||
props.put("id", module.id);
|
||||
props.put("version", module.version);
|
||||
props.put("exportMetaInf", String.valueOf(module.exportMetaInf));
|
||||
props.put("exportServices", String.valueOf(module.exportServices));
|
||||
props.put("exportServices", module.exportServices);
|
||||
props.put("exportAnnotations", String.valueOf(module.exportAnnotations));
|
||||
props.put("isSystem", String.valueOf(module.isSystem));
|
||||
artifact.setProperties(props);
|
||||
|
@ -16,6 +16,8 @@ package com.inteligr8.wildfly.maven.goal;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
@ -39,6 +41,8 @@ public class CopyDeploymentResourcesGoal extends AbstractDeploymentGoal {
|
||||
|
||||
private File libDirectory;
|
||||
|
||||
private List<String> manifestClassPath = new LinkedList<>();
|
||||
|
||||
@Override
|
||||
protected void executePre() throws MojoExecutionException {
|
||||
if (this.isWebApp()) {
|
||||
@ -53,6 +57,7 @@ public class CopyDeploymentResourcesGoal extends AbstractDeploymentGoal {
|
||||
protected void handleDependency(Dependency dependency) throws MojoExecutionException {
|
||||
try {
|
||||
FileUtils.copyFileToDirectory(dependency.getArtifact().getFile(), this.libDirectory);
|
||||
this.manifestClassPath.add(this.libPath + "/" + dependency.getArtifact().getFile().getName());
|
||||
} catch (IOException ie) {
|
||||
throw new MojoExecutionException("An I/O related issue occurred", ie);
|
||||
}
|
||||
@ -67,6 +72,7 @@ public class CopyDeploymentResourcesGoal extends AbstractDeploymentGoal {
|
||||
|
||||
@Override
|
||||
public void executePost() throws MojoExecutionException {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ package com.inteligr8.wildfly.maven.model;
|
||||
public class WildflyModule extends WildflyArtifact {
|
||||
|
||||
public boolean export;
|
||||
public boolean exportMetaInf;
|
||||
public boolean exportServices;
|
||||
public String exportMetaInf;
|
||||
public String exportServices;
|
||||
public boolean exportAnnotations;
|
||||
public boolean exportOptional;
|
||||
public boolean isSystem;
|
||||
|
@ -66,12 +66,12 @@ public abstract class AbstractXmlBuilder {
|
||||
moduleElement.setAttribute("slot", module.version);
|
||||
if (module.export)
|
||||
moduleElement.setAttribute("export", Boolean.TRUE.toString());
|
||||
if (isDeployment && module.exportMetaInf)
|
||||
moduleElement.setAttribute("meta-inf", "export");
|
||||
if (module.exportServices)
|
||||
moduleElement.setAttribute("services", "export");
|
||||
if (isDeployment && module.exportMetaInf != null)
|
||||
moduleElement.setAttribute("meta-inf", module.exportMetaInf);
|
||||
if (module.exportServices != null)
|
||||
moduleElement.setAttribute("services", module.exportServices);
|
||||
if (isDeployment && module.exportAnnotations)
|
||||
moduleElement.setAttribute("annotations", "export");
|
||||
moduleElement.setAttribute("annotations", Boolean.TRUE.toString());
|
||||
this.dependenciesElement.appendChild(moduleElement);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user