Permalink
Browse files

Fix: use activated profile for copy-flex-resource project resolution

  • Loading branch information...
1 parent cc3999b commit 0a43af06240d5cb7acf52ce38503e972a9a22fba Frédéric Vauchelles committed Apr 12, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 flexmojos-maven-plugin/src/main/java/net/flexmojos/oss/plugin/war/CopyMojo.java
@@ -32,6 +32,7 @@
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.DefaultProjectBuildingRequest;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.model.Profile;
import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.project.ProjectBuildingRequest;
@@ -234,6 +235,11 @@ private MavenProject getProject( Artifact artifact )
request.setLocalRepository( localRepository );
request.setRemoteRepositories( remoteRepositories );
request.setResolveDependencies( true );
+ ArrayList<String> ids = new ArrayList<String>();
+ for(Profile profile : project.getActiveProfiles()){
+ ids.add(profile.getId());
+ }
+ request.setActiveProfileIds(ids);
request.setRepositorySession( session.getRepositorySession() );
return projectBuilder.build( artifact, request ).getProject();
}

0 comments on commit 0a43af0

Please sign in to comment.