You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2015/04/19 11:52:26 UTC

git commit: [flex-utilities] [refs/heads/develop] - - Applied some changes to make the FlexEventSpy working with older Maven versions.

Repository: flex-utilities
Updated Branches:
  refs/heads/develop 95af18d9f -> 34ba2e8eb


- Applied some changes to make the FlexEventSpy working with older Maven versions.


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/34ba2e8e
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/34ba2e8e
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/34ba2e8e

Branch: refs/heads/develop
Commit: 34ba2e8eb8133d94514816f3893f93d391a291e6
Parents: 95af18d
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Sun Apr 19 11:52:11 2015 +0200
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Sun Apr 19 11:52:11 2015 +0200

----------------------------------------------------------------------
 .../converter/mavenextension/FlexEventSpy.java        | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/34ba2e8e/mavenizer/maven-extension/src/main/java/org/apache/flex/utilities/converter/mavenextension/FlexEventSpy.java
----------------------------------------------------------------------
diff --git a/mavenizer/maven-extension/src/main/java/org/apache/flex/utilities/converter/mavenextension/FlexEventSpy.java b/mavenizer/maven-extension/src/main/java/org/apache/flex/utilities/converter/mavenextension/FlexEventSpy.java
index 8c62236..a378f98 100644
--- a/mavenizer/maven-extension/src/main/java/org/apache/flex/utilities/converter/mavenextension/FlexEventSpy.java
+++ b/mavenizer/maven-extension/src/main/java/org/apache/flex/utilities/converter/mavenextension/FlexEventSpy.java
@@ -11,9 +11,9 @@ import org.apache.maven.MavenExecutionException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
 import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
 import org.apache.maven.eventspy.AbstractEventSpy;
+import org.apache.maven.execution.ExecutionEvent;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.repository.RepositorySystem;
-import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.logging.Logger;
 import org.eclipse.aether.RepositoryEvent;
 import org.eclipse.aether.artifact.Artifact;
@@ -36,8 +36,7 @@ public class FlexEventSpy extends AbstractEventSpy {
     @Inject
     protected Logger logger;
 
-    @Inject
-    protected PlexusContainer plexusContainer;
+    protected MavenSession mavenSession;
 
     protected boolean internalLookup = false;
     protected boolean flexSplashScreenShown = false;
@@ -51,7 +50,9 @@ public class FlexEventSpy extends AbstractEventSpy {
 
     @Override
     public void onEvent(Object o) throws Exception {
-        if(o instanceof RepositoryEvent) {
+        if(o instanceof ExecutionEvent) {
+            mavenSession = ((ExecutionEvent) o).getSession();
+        } else if(o instanceof RepositoryEvent) {
             RepositoryEvent repositoryEvent = (RepositoryEvent) o;
             if(repositoryEvent.getType() == RepositoryEvent.EventType.ARTIFACT_RESOLVING) {
                 if(!internalLookup) {
@@ -100,7 +101,6 @@ public class FlexEventSpy extends AbstractEventSpy {
         }
         if (!artifact.isResolved()) {
             try {
-                MavenSession mavenSession = plexusContainer.lookup(MavenSession.class);
                 ArtifactResolutionRequest req = new ArtifactResolutionRequest();
                 req.setArtifact(artifact);
                 req.setLocalRepository(mavenSession.getLocalRepository());
@@ -120,7 +120,6 @@ public class FlexEventSpy extends AbstractEventSpy {
         logger.info("===========================================================");
         logger.info(" - Installing Apache Flex SDK " + version);
         try {
-            MavenSession mavenSession = plexusContainer.lookup(MavenSession.class);
             File localRepoBaseDir = new File(mavenSession.getLocalRepository().getBasedir());
             DownloadRetriever downloadRetriever = new DownloadRetriever();
             File sdkRoot = downloadRetriever.retrieve(SdkType.FLEX, version);
@@ -146,7 +145,6 @@ public class FlexEventSpy extends AbstractEventSpy {
         logger.info("===========================================================");
         logger.info(" - Installing Adobe Flash SDK " + version);
         try {
-            MavenSession mavenSession = plexusContainer.lookup(MavenSession.class);
             File localRepoBaseDir = new File(mavenSession.getLocalRepository().getBasedir());
             DownloadRetriever downloadRetriever = new DownloadRetriever();
             File sdkRoot = downloadRetriever.retrieve(SdkType.FLASH, version);
@@ -163,7 +161,6 @@ public class FlexEventSpy extends AbstractEventSpy {
         logger.info("===========================================================");
         logger.info(" - Installing Adobe AIR SDK " + version);
         try {
-            MavenSession mavenSession = plexusContainer.lookup(MavenSession.class);
             File localRepoBaseDir = new File(mavenSession.getLocalRepository().getBasedir());
             DownloadRetriever downloadRetriever = new DownloadRetriever();
             File sdkRoot = downloadRetriever.retrieve(SdkType.AIR, version);
@@ -180,7 +177,6 @@ public class FlexEventSpy extends AbstractEventSpy {
         logger.info("===========================================================");
         logger.info(" - Installing Adobe Fontkit libraries");
         try {
-            MavenSession mavenSession = plexusContainer.lookup(MavenSession.class);
             File localRepoBaseDir = new File(mavenSession.getLocalRepository().getBasedir());
             DownloadRetriever downloadRetriever = new DownloadRetriever();
             File sdkRoot = downloadRetriever.retrieve(SdkType.FONTKIT);