rfscholte commented on a change in pull request #286: [MNG-6656] Introduce base 
for build/consumer process
URL: https://github.com/apache/maven/pull/286#discussion_r330386987
 
 

 ##########
 File path: 
maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java
 ##########
 @@ -238,9 +263,83 @@ else if ( request.isUpdateSnapshots() )
         mavenRepositorySystem.injectProxy( session, 
request.getPluginArtifactRepositories() );
         mavenRepositorySystem.injectAuthentication( session, 
request.getPluginArtifactRepositories() );
 
+        if ( Boolean.getBoolean( "maven.experimental.buildconsumer" ) )
+        {
+            session.setFileTransformerManager( newFileTransformerManager() );
+        }
         return session;
     }
 
+    private FileTransformerManager newFileTransformerManager()
+    {
+        return new FileTransformerManager()
+        {
+            @Override
+            public Collection<FileTransformer> getTransformersForArtifact( 
final Artifact artifact )
+            {
+                Collection<FileTransformer> transformers = new ArrayList<>();
+                if ( "pom".equals( artifact.getExtension() ) )
+                {
+                    final TransformerFactory transformerFactory = 
TransformerFactory.newInstance();
 
 Review comment:
   Wasn't aware of this sheet. I think it is good to apply them. Only thing I 
want to add: the way I constructed the classes is in a way that nobody else can 
manipulate it, Maven stays in full control. We shouldn't be more vulnerable, 
unless we take classloading order into account.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to