この例に従って、必要な依存関係をAbtractMavenLifecyleParticipantに注入しました。
http://www.sonatype.com/people/2011/01/how-to-use-aether-in-maven-plugins/
http://maven.apache.org/examples/maven-3-lifecycle-extensions.html
'afterProjectsRead'は完全に呼び出されますが、repoSystem、repoSession、およびremoteReposは常に'null'です。
AbstractMavenLifecyleParticipant内からこれらのオブジェクトを取得するにはどうすればよいですか?
import org.apache.maven.AbstractMavenLifecycleParticipant;
import org.apache.maven.MavenExecutionException;
import org.apache.maven.execution.MavenSession;
import org.codehaus.plexus.component.annotations.Component;
import org.sonatype.aether.RepositorySystem;
import org.sonatype.aether.RepositorySystemSession;
import org.sonatype.aether.repository.RemoteRepository;
@Component(role = AbstractMavenLifecycleParticipant.class, hint = "skipper")
public class ModuleSkipperLifecycleParticipant extends AbstractMavenLifecycleParticipant {
/**
* @component
*/
private RepositorySystem repoSystem;
/**
* @parameter default-value="${repositorySystemSession}"
* @readonly
*/
private RepositorySystemSession repoSession;
/**
* @parameter default-value="${project.remotePluginRepositories}"
* @readonly
*/
private List<RemoteRepository> remoteRepos;
@Override
public void afterProjectsRead(MavenSession session) throws MavenExecutionException {
super.afterProjectsRead(session);
System.out.println("repoSession: " + repoSession);
System.out.println("repoSystem: " + repoSystem);
System.out.println("remoteRepos: " + remoteRepos);
}
}