import org.opendaylight.yangtools.yang2sources.plugin.ConfigArg.CodeGeneratorArg;
import org.opendaylight.yangtools.yang2sources.spi.CodeGenerator;
import org.slf4j.impl.StaticLoggerBinder;
+import org.sonatype.aether.RepositorySystem;
+import org.sonatype.aether.RepositorySystemSession;
+import org.sonatype.aether.repository.RemoteRepository;
import org.sonatype.plexus.build.incremental.BuildContext;
import com.google.common.annotations.VisibleForTesting;
*/
@Mojo(name = "generate-sources", defaultPhase = LifecyclePhase.GENERATE_SOURCES, requiresDependencyResolution = ResolutionScope.COMPILE, requiresProject = true)
public final class YangToSourcesMojo extends AbstractMojo {
+ public static final String PLUGIN_NAME = "org.opendaylight.yangtools:yang-maven-plugin";
/**
* Classes implementing {@link CodeGenerator} interface. An instance will be
private YangToSourcesProcessor yangToSourcesProcessor;
+ @Component
+ private RepositorySystem repoSystem;
+
+ @Parameter( readonly = true, defaultValue = "${repositorySystemSession}" )
+ private RepositorySystemSession repoSession;
+
+ @Parameter( readonly = true, defaultValue = "${project.remoteProjectRepositories}" )
+ private List<RemoteRepository> remoteRepos;
+
+
public YangToSourcesMojo() {
}
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
StaticLoggerBinder.getSingleton().setMavenLog(this.getLog());
+
+ Util.checkClasspath(project, getLog(), repoSystem, repoSession, remoteRepos);
+
if (yangToSourcesProcessor == null) {
List<CodeGeneratorArg> codeGeneratorArgs = processCodeGenerators(codeGenerators);