gnodet commented on code in PR #26:
URL:
https://github.com/apache/maven-remote-resources-plugin/pull/26#discussion_r1130995411
##########
src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java:
##########
@@ -445,40 +371,69 @@
@Parameter( defaultValue = "${project.build.outputTimestamp}" )
private String outputTimestamp;
+ @Component
+ protected RepositorySystem repositorySystem;
+
/**
+ * Filtering support, for local resources that override those in the
remote bundle.
*/
- @Component( hint = "default" )
- protected ProjectDependenciesResolver dependencyResolver;
+ @Component
+ private MavenFileFilter fileFilter;
+
+ @Component
+ private ResourceManager locator;
+
+ @Component
+ private ProjectBuilder projectBuilder;
+
+ @Component
+ private ArtifactHandlerManager artifactHandlerManager;
+
+ /**
+ * TODO: move off this deprecated component.
+ */
+ @Component
+ private ArtifactFactory artifactFactory;
+
+ /**
+ * Map of artifacts to supplemental project object models.
+ */
+ private Map<String, Model> supplementModels;
+
+ /**
+ * Merges supplemental data model with artifact metadata. Useful when
processing artifacts with
+ * incomplete POM metadata.
+ */
+ private final ModelInheritanceAssembler inheritanceAssembler = new
ModelInheritanceAssembler();
private VelocityEngine velocity;
@Override
- @SuppressWarnings( "unchecked" )
public void execute()
throws MojoExecutionException
{
if ( skip )
{
- getLog().info( "Skipping remote resources execution." );
+ LOGGER.info( "Skipping remote resources execution." );
Review Comment:
I thought slf4j was for maven components, not for plugins... ?
##########
src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java:
##########
@@ -445,40 +371,69 @@
@Parameter( defaultValue = "${project.build.outputTimestamp}" )
private String outputTimestamp;
+ @Component
+ protected RepositorySystem repositorySystem;
+
/**
+ * Filtering support, for local resources that override those in the
remote bundle.
*/
- @Component( hint = "default" )
- protected ProjectDependenciesResolver dependencyResolver;
+ @Component
+ private MavenFileFilter fileFilter;
+
+ @Component
+ private ResourceManager locator;
+
+ @Component
+ private ProjectBuilder projectBuilder;
+
+ @Component
+ private ArtifactHandlerManager artifactHandlerManager;
+
+ /**
+ * TODO: move off this deprecated component.
+ */
+ @Component
+ private ArtifactFactory artifactFactory;
+
+ /**
+ * Map of artifacts to supplemental project object models.
+ */
+ private Map<String, Model> supplementModels;
+
+ /**
+ * Merges supplemental data model with artifact metadata. Useful when
processing artifacts with
+ * incomplete POM metadata.
+ */
+ private final ModelInheritanceAssembler inheritanceAssembler = new
ModelInheritanceAssembler();
private VelocityEngine velocity;
@Override
- @SuppressWarnings( "unchecked" )
public void execute()
throws MojoExecutionException
{
if ( skip )
{
- getLog().info( "Skipping remote resources execution." );
+ LOGGER.info( "Skipping remote resources execution." );
return;
}
if ( StringUtils.isEmpty( encoding ) )
{
- getLog().warn( "File encoding has not been set, using platform
encoding " + ReaderFactory.FILE_ENCODING
+ LOGGER.warn( "File encoding has not been set, using platform
encoding " + ReaderFactory.FILE_ENCODING
+ ", i.e. build is platform dependent!" );
}
- if ( runOnlyAtExecutionRoot && !project.isExecutionRoot() )
+ if ( runOnlyAtExecutionRoot &&
!mavenSession.getCurrentProject().isExecutionRoot() )
Review Comment:
I don't think using `session.getCurrentProject()` is a good idea. This
value is mutable and should be avoided. Using the injected `${project}` makes
more sense imho.
##########
src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java:
##########
@@ -598,34 +552,34 @@ private void configureLocator()
}
- locator.addSearchPath( FileResourceLoader.ID,
project.getFile().getParentFile().getAbsolutePath() );
+ locator.addSearchPath( FileResourceLoader.ID,
mavenSession.getCurrentProject()
+ .getFile().getParentFile().getAbsolutePath() );
if ( appendedResourcesDirectory != null )
{
locator.addSearchPath( FileResourceLoader.ID,
appendedResourcesDirectory.getAbsolutePath() );
}
locator.addSearchPath( "url", "" );
- locator.setOutputDirectory( new File(
project.getBuild().getDirectory() ) );
+ locator.setOutputDirectory( new File(
mavenSession.getCurrentProject().getBuild().getDirectory() ) );
}
- @SuppressWarnings( "unchecked" )
protected List<MavenProject> getProjects()
{
List<MavenProject> projects = new ArrayList<>();
// add filters in well known order, least specific to most specific
FilterArtifacts filter = new FilterArtifacts();
- Set<Artifact> artifacts = resolveProjectArtifacts();
+ Set<org.apache.maven.artifact.Artifact> artifacts =
resolveProjectArtifacts();
Review Comment:
`Artifact` is not imported afaik, so maybe we can import
`org.apache.maven.artifact.Artifact` and avoir the qualifier ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]