public void onEvent()

in flex-maven-tools/flex-sdk-converter/maven-extension/src/main/java/org/apache/flex/utilities/converter/mavenextension/FlexEventSpy.java [79:172]


    public void onEvent(Object o) throws Exception {
        if(o instanceof ExecutionEvent) {
            mavenSession = ((ExecutionEvent) o).getSession();

            // Get proxy settings from the maven settings and save them in the
            // ProxySettings "singleton".
            org.apache.maven.settings.Proxy settingsProxy = mavenSession.getSettings().getActiveProxy();
            if(settingsProxy != null) {
                String protocol = settingsProxy.getProtocol();
                String host = settingsProxy.getHost();
                int port = settingsProxy.getPort();
                String nonProxyHost = settingsProxy.getNonProxyHosts();
                final String username = settingsProxy.getUsername();
                final String password = settingsProxy.getPassword();
                proxySettings = new ProxySettings(protocol, host, port, nonProxyHost, username, password);
                ProxySettings.setProxySettings(proxySettings);
                if (!StringUtils.isEmpty(proxySettings.getUsername()) &&
                        !StringUtils.isEmpty(proxySettings.getPassword())) {
                    Authenticator authenticator = new Authenticator() {
                        @Override
                        protected PasswordAuthentication getPasswordAuthentication() {
                            return new PasswordAuthentication(proxySettings.getUsername(),
                                    proxySettings.getPassword().toCharArray());
                        }
                    };
                    Authenticator.setDefault(authenticator);
                }
            }
        } else if(o instanceof RepositoryEvent) {
            RepositoryEvent repositoryEvent = (RepositoryEvent) o;
            if(repositoryEvent.getType() == RepositoryEvent.EventType.ARTIFACT_RESOLVING) {
                if(!internalLookup) {
                    try {
                        internalLookup = true;
                        Artifact artifact = repositoryEvent.getArtifact();

                        if (artifact.getGroupId().startsWith("org.apache.flex") &&
                                !artifact.getGroupId().contains(".flexjs") &&
                                !"rb.swc".equals(artifact.getExtension())) {
                            // Output a cool splash-screen ... sorry for that ... couldn't resist :-)
                            if(!flexSplashScreenShown) {
                                showFlexSplashScreen();
                            }

                            if("org.apache.flex.compiler".equals(artifact.getGroupId()) &&
                                    artifact.getArtifactId().startsWith("falcon-")) {
/*                                logger.info("Falcon artifacts are publicly available as Maven artifacts. " +
                                        "Please setup your Maven configuration.\nFor more information please visit: " +
                                        "https://cwiki.apache.org/confluence/display/FLEX/Building+Flex+applications+with+Maven");*/
                            }
                            else if("org.apache.flex.flexjs.framework".equals(artifact.getGroupId())) {
/*                                logger.info("FlexJS artifacts are publicly available as Maven artifacts. " +
                                        "Please setup your Maven configuration.\nFor more information please visit: " +
                                        "https://cwiki.apache.org/confluence/display/FLEX/Building+Flex+applications+with+Maven");*/
                            }
                            else if(!canResolve(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
                                    artifact.getExtension(), artifact.getClassifier())) {
                                logger.info("Couldn't find artifact: " + artifact.getGroupId() + ":" +
                                        artifact.getBaseVersion() + ":" + artifact.getArtifactId() + ":" +
                                        artifact.getExtension());
                                initFlex(artifact.getVersion());
                            }
                        } else if (artifact.getGroupId().startsWith("com.adobe.flash")) {
                            if(!canResolve(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
                                    artifact.getExtension(), artifact.getClassifier())) {
                                logger.info("Couldn't find artifact: " + artifact.getGroupId() + ":" +
                                        artifact.getBaseVersion() + ":" + artifact.getArtifactId() + ":" +
                                        artifact.getExtension());
                                initFlash(artifact.getVersion());
                            }
                        } else if (artifact.getGroupId().startsWith("com.adobe.air")) {
                            if(!canResolve(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
                                    artifact.getExtension(), artifact.getClassifier())) {
                                logger.info("Couldn't find artifact: " + artifact.getGroupId() + ":" +
                                        artifact.getBaseVersion() + ":" + artifact.getArtifactId() + ":" +
                                        artifact.getExtension());
                                initAir(artifact.getVersion());
                            }
                        } else if (artifact.getGroupId().equals("com.adobe") && artifact.getArtifactId().equals("fontkit")) {
                            if(!canResolve(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
                                    artifact.getExtension(), artifact.getClassifier())) {
                                logger.info("Couldn't find artifact: " + artifact.getGroupId() + ":" +
                                        artifact.getBaseVersion() + ":" + artifact.getArtifactId() + ":" +
                                        artifact.getExtension());
                                initFontkit();
                            }
                        }
                    } finally {
                        internalLookup = false;
                    }
                }
            }
        }
    }