use of org.guvnor.ala.build.maven.model.impl.MavenBinaryImpl in project kie-wb-common by kiegroup.
the class MavenDependencyConfigExecutor method apply.
@Override
public Optional<MavenBinary> apply(final MavenDependencyConfig config) {
final String artifactId = config.getArtifact();
checkNotEmpty("artifact parameter is mandatory", artifactId);
LOGGER.debug("Resolving Artifact: {}", artifactId);
final Artifact artifact = resolveArtifact(artifactId);
if (artifact == null) {
throw new RuntimeException("Cannot resolve Maven artifact. Look at the previous logs for more information.");
}
final String absolutePath = artifact.getFile().getAbsolutePath();
LOGGER.debug("Resolved Artifact path: {}", absolutePath);
final Path path = FileSystems.getFileSystem(URI.create("file://default")).getPath(absolutePath);
final MavenBinary binary = new MavenBinaryImpl(path, artifact.getArtifactId(), artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion());
buildRegistry.registerBinary(binary);
return Optional.of(binary);
}
Aggregations