Merge branch 'develop' into stable
This commit is contained in:
commit
18b61f00ce
@ -24,14 +24,15 @@ import org.apache.maven.model.building.DefaultModelBuildingRequest;
|
||||
import org.apache.maven.model.building.ModelBuildingException;
|
||||
import org.apache.maven.model.building.ModelBuildingRequest;
|
||||
import org.apache.maven.model.building.ModelBuildingResult;
|
||||
import org.apache.maven.model.building.ModelSource;
|
||||
import org.apache.maven.model.resolution.UnresolvableModelException;
|
||||
import org.apache.maven.plugin.logging.Log;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.artifact.ArtifactType;
|
||||
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;
|
||||
@ -77,15 +78,28 @@ public class WildflyArtifactExtractor {
|
||||
}
|
||||
}
|
||||
|
||||
DefaultModelBuildingRequest modelBuildRequest = new DefaultModelBuildingRequest(this.modelBuildRequestTemplate);
|
||||
|
||||
// need to go after the artifact as there could be a classifier
|
||||
Artifact pomArtifact = new DefaultArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getClassifier(), "pom", artifact.getVersion());
|
||||
ArtifactRequest artifactRequest = new ArtifactRequest(pomArtifact, this.dac.getMavenProject().getRemoteProjectRepositories(), null);
|
||||
try {
|
||||
ArtifactResult artifactResult = this.dac.getArtifactResolver().resolveArtifact(this.dac.getMavenSession().getRepositorySession(), artifactRequest);
|
||||
if (this.getLog().isDebugEnabled())
|
||||
this.getLog().debug("Found artifact POM [" + artifact + "]: " + artifactResult.getArtifact().getFile());
|
||||
this.getLog().debug("Found artifact classifier POM [" + artifact + "]: " + artifactResult.getArtifact().getFile());
|
||||
modelBuildRequest.setPomFile(artifactResult.getArtifact().getFile());
|
||||
} catch (ArtifactResolutionException are) {
|
||||
if (this.getLog().isDebugEnabled())
|
||||
this.getLog().debug("There is no artifact classifier POM [" + artifact + "]: " + are.getMessage());
|
||||
|
||||
ModelSource source = this.dac.getProjectModelResolver().resolveModel(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion());
|
||||
if (this.getLog().isDebugEnabled())
|
||||
this.getLog().debug("Found artifact POM [" + artifact + "]: " + source.getLocation());
|
||||
|
||||
modelBuildRequest.setModelResolver(this.dac.getProjectModelResolver());
|
||||
modelBuildRequest.setModelSource(source);
|
||||
}
|
||||
|
||||
DefaultModelBuildingRequest modelBuildRequest = new DefaultModelBuildingRequest(this.modelBuildRequestTemplate)
|
||||
.setPomFile(artifactResult.getArtifact().getFile());
|
||||
ModelBuildingResult result = this.dac.getModelBuilder().build(modelBuildRequest);
|
||||
if (this.getLog().isDebugEnabled())
|
||||
this.getLog().debug("Parsed artifact POM [" + artifact + "]: " + result.getModelIds());
|
||||
|
Loading…
x
Reference in New Issue
Block a user