diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/AbstractLibertySupport.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/AbstractLibertySupport.java index c3f8b9f43..6af0181c9 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/AbstractLibertySupport.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/AbstractLibertySupport.java @@ -59,10 +59,7 @@ public abstract class AbstractLibertySupport extends MojoSupport { */ @Parameter(defaultValue = "${project}", required = true, readonly = true) protected MavenProject project = null; - - @Parameter(defaultValue = "${localRepository}", required = true, readonly = true) - protected ArtifactRepository artifactRepository = null; - + /** * The build settings. */ @@ -97,10 +94,10 @@ protected MavenProject getProject() { return project; } - protected ArtifactRepository getArtifactRepository() { - return artifactRepository; + public RepositorySystemSession getRepoSession() { + return repoSession; } - + protected void init() throws MojoExecutionException, MojoFailureException { super.init(); // Initialize ant helper instance @@ -561,7 +558,7 @@ private Artifact resolveArtifactItem(final ArtifactItem item) throws MojoExecuti if (artifactFile != null && artifactFile.exists()) { String pathToLocalArtifact = this.repoSession.getLocalRepositoryManager().getPathForLocalArtifact(aetherArtifact); - File localArtifactFile = new File (this.artifactRepository.getBasedir() ,pathToLocalArtifact); + File localArtifactFile = new File (this.repoSession.getLocalRepository().getBasedir() ,pathToLocalArtifact); //sometimes variable artifactFile has a path of a build output folder(target). Setting the artifact file path that corresponds to Maven coord. if(localArtifactFile.exists()) { diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/BasicSupport.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/BasicSupport.java index 197256d04..9d7723450 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/BasicSupport.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/BasicSupport.java @@ -504,7 +504,7 @@ protected void installFromArchive() throws Exception { String cacheDir = install.getCacheDirectory(); if (cacheDir == null) { - File dir = new File(artifactRepository.getBasedir(), "wlp-cache"); + File dir = new File(getRepoSession().getLocalRepository().getBasedir(), "wlp-cache"); installTask.setCacheDir(dir.getAbsolutePath()); } else { installTask.setCacheDir(cacheDir);