Skip to content

Commit

Permalink
[OpenLiberty#1651] remove deprecated artifactRepository/.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarwell committed Mar 23, 2023
1 parent b8803c3 commit eccc148
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit eccc148

Please sign in to comment.