Skip to content

Commit

Permalink
GBLD-1108: it works
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeDemoulinGebit committed Sep 26, 2023
1 parent 12c1ca1 commit 16158d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@
public class MavenPluginConfigurationTranslator extends AbstractMavenPluginConfigurationTranslator {

private static final Logger LOG = LoggerFactory.getLogger(MavenPluginConfigurationTranslator.class);
private final IMaven imaven;

private MavenPluginConfigurationTranslator(final IMaven maven, final MavenSession session,
final MavenProject mavenProject, final MojoExecution execution, final IProject project,
final IProgressMonitor monitor) throws CoreException {
super(maven, session, mavenProject, execution, project, monitor);
this.imaven = maven;
}

public boolean isSkip() throws CoreException {
Expand Down Expand Up @@ -245,16 +243,16 @@ private ImmutableList<String> getConfiguredPlugins() {

private String normalized(IProject project, String pluginFilePath) {

final IPath workspaceLocation = project.getWorkspace().getRoot().getLocation();
final String path = isAbsolute(pluginFilePath) ? pluginFilePath
: project.getLocation().toString() + "/" + pluginFilePath;
: workspaceLocation.toString() + "/" + pluginFilePath;
final String absolutePluginPath = FilenameUtils.normalize(path, true);

final IPath workspaceLocation = project.getWorkspace().getRoot().getLocation();
final String workspaceRelativePath = new org.eclipse.core.runtime.Path(absolutePluginPath)
.makeRelativeTo(workspaceLocation).toString();

LOG.debug("{} {} => {}", workspaceLocation, path,
path.equals(workspaceRelativePath) ? "(same)" : workspaceRelativePath);
LOG.debug("NORMALIZATION workspace={} path={} => relative to workspace={}", workspaceLocation, path,
workspaceRelativePath);
return workspaceRelativePath;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.m2e.core.embedder.IMaven;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.basistech.m2e.code.quality.spotbugs.data.JarMavenArtifact;

public class MavenArtifactResolver {

private IMaven maven;
private static final Logger LOG = LoggerFactory.getLogger(MavenArtifactResolver.class);

private IProgressMonitor monitor;

private IMaven maven;

public MavenArtifactResolver(IMaven maven, IProgressMonitor monitor) {
this.maven = maven;
this.monitor = monitor;
Expand All @@ -42,6 +47,8 @@ public Path resolve(JarMavenArtifact artifact) {
if (!Files.exists(artifactPath)) {
throw new MavenArtifactDownloadException("Unable to resolve the artifact " + artifact);
}

LOG.debug("RESOLVED " + artifactPath);
return artifactPath;

}
Expand Down

0 comments on commit 16158d3

Please sign in to comment.