maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r1036433 - /maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Date Thu, 18 Nov 2010 12:25:06 GMT
Author: bentmann
Date: Thu Nov 18 12:25:06 2010
New Revision: 1036433

URL: http://svn.apache.org/viewvc?rev=1036433&view=rev
Log:
[MNG-4900] "Unresolveable build extension" when using shade plugin and repositories in profile

Modified:
    maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java

Modified: maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=1036433&r1=1036432&r2=1036433&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
(original)
+++ maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Thu Nov 18 12:25:06 2010
@@ -85,6 +85,26 @@ public class DefaultMavenProjectBuilder
             request.setActiveProfileIds( profileManager.getExplicitlyActivatedIds() );
             request.setInactiveProfileIds( profileManager.getExplicitlyDeactivatedIds() );
         }
+        else
+        {
+            /*
+             * MNG-4900: Hack to workaround deficiency of legacy API which makes it impossible
for plugins to access the
+             * global profile manager which is required to build a POM like a CLI invocation
does. Failure to consider
+             * the activated profiles can cause repo declarations to be lost which in turn
will result in artifact
+             * resolution failures, in particular when using the enhanced local repo which
guards access to local files
+             * based on the configured remote repos.
+             */
+            MavenSession session = legacySupport.getSession();
+            if ( session != null )
+            {
+                MavenExecutionRequest req = session.getRequest();
+                if ( req != null )
+                {
+                    request.setActiveProfileIds( req.getActiveProfiles() );
+                    request.setInactiveProfileIds( req.getInactiveProfiles() );
+                }
+            }
+        }
 
         return request;
     }



Mime
View raw message