You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/06/14 19:51:45 UTC

[GitHub] [maven] pzygielo commented on a change in pull request #286: [MNG-6656] Introduce base for build/consumer process

pzygielo commented on a change in pull request #286:
URL: https://github.com/apache/maven/pull/286#discussion_r439862107



##########
File path: maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java
##########
@@ -266,5 +279,41 @@ private String getMavenVersion()
 
         return props.getProperty( "version", "unknown-version" );
     }
+    
+    private Collection<FileTransformer> getTransformersForArtifact( final org.eclipse.aether.artifact.Artifact artifact,
+                                                                    final SessionData sessionData )
+    {
+        TransformerContext context = (TransformerContext) sessionData.get( TransformerContext.KEY );
+        Collection<FileTransformer> transformers = new ArrayList<>();
+        
+        // In case of install:install-file there's no transformer context, as the goal is unrelated to the lifecycle. 
+        if ( "pom".equals( artifact.getExtension() ) && context != null )
+        {
+            transformers.add( new FileTransformer()
+            {
+                @Override
+                public InputStream transformData( File pomFile )
+                    throws IOException, TransformException
+                {
+                    try
+                    {
+                        return new ConsumerModelSourceTransformer().transform( pomFile.toPath(), context );
+                    }
+                    catch ( org.apache.maven.model.building.TransformerException e )

Review comment:
       Could this type be imported? And `Artifact` at ll. 309-310.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org