Package org.sonatype.plexus.components.sec.dispatcher

Examples of org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher


                showFatalError( "Unable to read settings.xml", e, showErrors );

                return 1;
            }

            DefaultSecDispatcher dispatcher;
            try
            {
                if ( commandLine.hasOption( CLIManager.ENCRYPT_MASTER_PASSWORD ) )
                {
                    String passwd = commandLine.getOptionValue( CLIManager.ENCRYPT_MASTER_PASSWORD );

                    DefaultPlexusCipher cipher = new DefaultPlexusCipher();

                    System.out.println( cipher.encryptAndDecorate( passwd,
                                                                   DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ) );
                   
                    return 0;
                }
                else if ( commandLine.hasOption( CLIManager.ENCRYPT_PASSWORD ) )
                {
                    String passwd = commandLine.getOptionValue( CLIManager.ENCRYPT_PASSWORD );
                   
                    dispatcher = (DefaultSecDispatcher) embedder.lookup( SecDispatcher.ROLE );
                    String configurationFile = dispatcher.getConfigurationFile();
                    if ( configurationFile.startsWith( "~" ) )
                    {
                        configurationFile = System.getProperty( "user.home" ) + configurationFile.substring( 1 );
                    }
                    String file = System.getProperty( DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION, configurationFile );
View Full Code Here


                showFatalError( "Unable to read settings.xml", e, showErrors );

                return 1;
            }

            DefaultSecDispatcher dispatcher;
            try
            {
                if ( commandLine.hasOption( CLIManager.ENCRYPT_MASTER_PASSWORD ) )
                {
                    String passwd = commandLine.getOptionValue( CLIManager.ENCRYPT_MASTER_PASSWORD );

                    DefaultPlexusCipher cipher = new DefaultPlexusCipher();

                    System.out.println( cipher.encryptAndDecorate( passwd,
                                                                   DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ) );
                   
                    return 0;
                }
                else if ( commandLine.hasOption( CLIManager.ENCRYPT_PASSWORD ) )
                {
                    String passwd = commandLine.getOptionValue( CLIManager.ENCRYPT_PASSWORD );
                   
                    dispatcher = (DefaultSecDispatcher) embedder.lookup( SecDispatcher.ROLE );
                    String configurationFile = dispatcher.getConfigurationFile();
                    if ( configurationFile.startsWith( "~" ) )
                    {
                        configurationFile = System.getProperty( "user.home" ) + configurationFile.substring( 1 );
                    }
                    String file = System.getProperty( DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION, configurationFile );
View Full Code Here

        /*
         * see:
         * http://git.eclipse.org/c/aether/aether-ant.git/tree/src/main/java/org/eclipse/aether/internal/ant/AntSettingsDecryptorFactory.java
         * http://git.eclipse.org/c/aether/aether-ant.git/tree/src/main/java/org/eclipse/aether/internal/ant/AntSecDispatcher.java
         */
        DefaultSecDispatcher secDispatcher = new DefaultSecDispatcher() {
            {
                _configurationFile = "~/.m2/settings-security.xml";
                try {
                    _cipher = new DefaultPlexusCipher();
                } catch (PlexusCipherException e) {
View Full Code Here

        // HACK: Put all props into System, the security muck needs it
        if (props != null) {
            System.getProperties().putAll(props);
        }

        DefaultSecDispatcher dispatcher = (DefaultSecDispatcher) plexus.lookup(SecDispatcher.class, "maven");
        String result;

        if (master) {
            DefaultPlexusCipher cipher = new DefaultPlexusCipher();
            result = cipher.encryptAndDecorate(password, DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION);
        }
        else {
            String configurationFile = dispatcher.getConfigurationFile();

            if (configurationFile.startsWith("~")) {
                configurationFile = System.getProperty("user.home") + configurationFile.substring(1);
            }
View Full Code Here

TOP

Related Classes of org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.