Skip to content

Commit

Permalink
Used javax.inject.Inject
Browse files Browse the repository at this point in the history
  • Loading branch information
ckunki committed Oct 15, 2024
1 parent 90b3c1d commit 4cfc0e4
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.exasol.projectkeeper;

import javax.inject.Inject;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
Expand All @@ -9,7 +10,7 @@
import org.apache.maven.plugins.annotations.*;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.project.DefaultProjectBuilder; // new
// import org.apache.maven.project.DefaultProjectBuilder; // new
import org.apache.maven.repository.RepositorySystem;

import com.exasol.errorreporting.ExaError;
Expand All @@ -26,20 +27,30 @@
*/
@Mojo(name = "crawl", requiresProject = false)
public class MavenProjectCrawlerMojo extends AbstractMojo {

private static final String PROPERTY_PROJECTS_TO_CRAWL = "projectsToCrawl";

@Parameter(property = "repositorySystem")
// @Component
// @Parameter(property = "repositorySystem")
RepositorySystem repositorySystem;

@Parameter(property = PROPERTY_PROJECTS_TO_CRAWL, required = true)
private String projectsToCrawl;

// @Component
// @Parameter(property = "projectBuilder", required = true)
private ProjectBuilder mavenProjectBuilder = new DefaultProjectBuilder();
// private ProjectBuilder mavenProjectBuilder = new DefaultProjectBuilder();
private ProjectBuilder mavenProjectBuilder;

@Parameter(defaultValue = "${session}", readonly = true)
private MavenSession session;

@Inject
public MavenProjectCrawlerMojo(RepositorySystem repositorySystem, ProjectBuilder mavenProjectBuilder) {
this.repositorySystem = repositorySystem;
this.mavenProjectBuilder = mavenProjectBuilder;
}

// [impl -> dsn~eclipse-prefs-java-version~1]
@Override
public void execute() {
Expand Down

0 comments on commit 4cfc0e4

Please sign in to comment.