当前位置: 首页>>代码示例>>Java>>正文


Java SecDispatcher类代码示例

本文整理汇总了Java中org.sonatype.plexus.components.sec.dispatcher.SecDispatcher的典型用法代码示例。如果您正苦于以下问题:Java SecDispatcher类的具体用法?Java SecDispatcher怎么用?Java SecDispatcher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SecDispatcher类属于org.sonatype.plexus.components.sec.dispatcher包,在下文中一共展示了SecDispatcher类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MavenEnvironment

import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
public MavenEnvironment(MavenSession aMavenSession, BuildPluginManager aBuildPluginManager, Log aLog,
        DependencyTreeBuilder aDependencyTreeBuilder, ArtifactRepository aLocalRepository,
        SecDispatcher aSecurityDispatcher, MavenProjectBuilder aProjectBuilder,
        LifecycleExecutor aLifecycleExecutor, ArtifactFactory aArtifactFactory,
        ArtifactMetadataSource aArtifactMetadataSource, ArtifactCollector aArtifactCollector, RuntimeInformation aRuntimeInformation,
        MojoExecution aExecution) {
    mavenSession = aMavenSession;
    buildPluginManager = aBuildPluginManager;
    log = aLog;
    dependencyTreeBuilder = aDependencyTreeBuilder;
    localRepository = aLocalRepository;
    securityDispatcher = aSecurityDispatcher;
    projectBuilder = aProjectBuilder;
    lifecycleExecutor = aLifecycleExecutor;
    artifactFactory = aArtifactFactory;
    artifactMetadataSource = aArtifactMetadataSource;
    artifactCollector = aArtifactCollector;
    runtimeInformation = aRuntimeInformation;
    mojoExecution = aExecution;
}
 
开发者ID:mirkosertic,项目名称:mavensonarsputnik,代码行数:21,代码来源:MavenEnvironment.java

示例2: setUp

import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
@Before
public void setUp() {
  logOutput = mock(LogOutput.class);
  runtimeInformation = mock(RuntimeInformation.class, Mockito.RETURNS_DEEP_STUBS);
  mavenSession = mock(MavenSession.class);
  rootProject = mock(MavenProject.class);
  mojoExecution = mock(MojoExecution.class);
  envProps = new Properties();

  Properties system = new Properties();
  system.put("system", "value");
  system.put("user", "value");
  Properties root = new Properties();
  root.put("root", "value");
  envProps.put("env", "value");

  when(mojoExecution.getVersion()).thenReturn("2.0");
  when(runtimeInformation.getMavenVersion()).thenReturn("1.0");
  when(mavenSession.getSystemProperties()).thenReturn(system);
  when(mavenSession.getUserProperties()).thenReturn(new Properties());
  when(mavenSession.getSettings()).thenReturn(new Settings());
  when(rootProject.getProperties()).thenReturn(root);
  when(mavenSession.getCurrentProject()).thenReturn(rootProject);
  propertyDecryptor = new PropertyDecryptor(mock(Log.class), mock(SecDispatcher.class));
}
 
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:26,代码来源:ScannerFactoryTest.java

示例3: aetherContainer

import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
@Provides @Aether @Singleton
public PlexusContainer aetherContainer() {
    try {
        return new DefaultPlexusContainer(
            new DefaultContainerConfiguration(),
            new AbstractModule() {
                @Override
                protected void configure() {
                    bind(VersionResolver.class).to(VersionResolverImpl.class);
                }

                // DefaultSettingSettingsDecrypter looks for the "maven" name
                @Provides @Singleton @Named("maven")
                public SecDispatcher getDispatcher(DefaultSecDispatcher base) {
                    base.setConfigurationFile("~/.m2/settings-security.xml");
                    return base;
                }
            }
        );
    } catch (PlexusContainerException e) {
        throw new RuntimeException("Unable to load RepositorySystem component by Plexus, cannot establish Aether dependency resolver.", e);
    }
}
 
开发者ID:cloudbees,项目名称:bees-maven-components,代码行数:24,代码来源:RepositorySystemModule.java

示例4: initialize

import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
public static void initialize(MavenSession aMavenSession, BuildPluginManager aBuildPluginManager, Log aLog,
        DependencyTreeBuilder aDependencyTreeBuilder, ArtifactRepository aLocalRepository,
        SecDispatcher aSecurityDispatcher, MavenProjectBuilder aProjectBuilder,
        LifecycleExecutor aLifecycleExecutor, ArtifactFactory aArtifactFactory,
        ArtifactMetadataSource aArtifactMetadataSource, ArtifactCollector aArtifactCollector, RuntimeInformation aRuntimeInformation, MojoExecution aExecution) {
    ENVIRONMENT.set(new MavenEnvironment(aMavenSession, aBuildPluginManager, aLog,
            aDependencyTreeBuilder, aLocalRepository,
            aSecurityDispatcher, aProjectBuilder,
            aLifecycleExecutor, aArtifactFactory,
            aArtifactMetadataSource, aArtifactCollector, aRuntimeInformation, aExecution));
}
 
开发者ID:mirkosertic,项目名称:mavensonarsputnik,代码行数:12,代码来源:MavenEnvironment.java

示例5: decrypt

import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
private String decrypt(String pass) {
  try {
    pass = getComponent(SecDispatcher.class, "maven").decrypt(pass);
  }
  catch (SecDispatcherException e) {
    MavenEmbedderLog.LOG.warn(e);
  }
  return pass;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:MavenEmbedder.java

示例6: setUp

import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
public void setUp()
    throws Exception
{
    super.setUp();
    p = new Properties();
    p.load( getClass().getResourceAsStream( "/test.properties" ) );

    mojo = new SqlExecMojo();

    // populate parameters
    mojo.setDriver( p.getProperty( "driver" ) );
    mojo.setUsername( p.getProperty( "user" ) );
    mojo.setPassword( p.getProperty( "password" ) );
    mojo.setUrl( p.getProperty( "url" ) );
    mojo.setDriverProperties( p.getProperty( "driverProperties" ) );
    mojo.setSqlCommand( null );
    mojo.setDelimiter( SqlExecMojo.DEFAULT_DELIMITER );// This will simulate the defaultValue of @Parameter (...)
    mojo.setOnError( SqlExecMojo.ON_ERROR_ABORT );
    mojo.setDelimiterType( DelimiterType.NORMAL );
    mojo.setEscapeProcessing( true );

    MavenFileFilter filter =
        (MavenFileFilter) lookup( "org.apache.maven.shared.filtering.MavenFileFilter", "default" );
    mojo.setFileFilter( filter );

    SecDispatcher securityDispatcher =
        (SecDispatcher) lookup( "org.sonatype.plexus.components.sec.dispatcher.SecDispatcher", "default" );
    mojo.setSecurityDispatcher( securityDispatcher );

    MavenProject project = new MavenProjectStub();
    setVariableValueToObject( mojo, "project", project );
}
 
开发者ID:mojohaus,项目名称:sql-maven-plugin,代码行数:33,代码来源:SqlExecMojoTest.java

示例7: setUp

import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
@Override
@Before(order = 2)
public void setUp() throws Exception {
	super.setUp();
	SecDispatcher securityDispatcher = (SecDispatcher) lookup(
			"org.sonatype.plexus.components.sec.dispatcher.SecDispatcher",
			"default");
	setVariableValueToObject(mojo, "securityDispatcher", securityDispatcher);
	securityDispatcher.decrypt("");
	properties = new Properties();
	project = new MavenProjectStub() {
		@Override
		public Properties getProperties() {
			return properties;
		}
	};
	setVariableValueToObject(mojo, "project", project);

	settings = new Settings();
	setVariableValueToObject(mojo, "settings", settings);
	systemProperties = new ArrayList<String>();

	mojo.setLog(new SystemStreamLog() {
		@Override
		public boolean isDebugEnabled() {
			return true;
		}
	});
}
 
开发者ID:genthaler,项目名称:credentials-maven-plugin,代码行数:30,代码来源:MojoTestSteps.java

示例8: getSecurityDispatcher

import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
public SecDispatcher getSecurityDispatcher() {
    return securityDispatcher;
}
 
开发者ID:mirkosertic,项目名称:mavensonarsputnik,代码行数:4,代码来源:MavenEnvironment.java

示例9: testInitialize

import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
@Test
public void testInitialize() {
    assertNull(MavenEnvironment.get());

    MavenSession aMavenSession = mock(MavenSession.class);
    BuildPluginManager aBuildPluginManager = mock(BuildPluginManager.class);
    Log aLog = mock(Log.class);
    DependencyTreeBuilder aDependencyTreeBuilder = mock(DependencyTreeBuilder.class);
    ArtifactRepository aLocalRepository = mock(ArtifactRepository.class);
    SecDispatcher aSecurityDispatcher = mock(SecDispatcher.class);
    MavenProjectBuilder aProjectBuilder = mock(MavenProjectBuilder.class);
    LifecycleExecutor aLifecycleExecutor = mock(LifecycleExecutor.class);
    ArtifactFactory aArtifactFactory = mock(ArtifactFactory.class);
    ArtifactMetadataSource aArtifactMetadataSource = mock(ArtifactMetadataSource.class);
    ArtifactCollector aArtifactCollector = mock(ArtifactCollector.class);
    RuntimeInformation aRuntimeInformation = mock(RuntimeInformation.class);
    MojoExecution theExecution = mock(MojoExecution.class);

    MavenEnvironment.initialize(aMavenSession, aBuildPluginManager, aLog,
            aDependencyTreeBuilder, aLocalRepository,
            aSecurityDispatcher, aProjectBuilder,
            aLifecycleExecutor, aArtifactFactory,
            aArtifactMetadataSource, aArtifactCollector, aRuntimeInformation, theExecution);

    MavenEnvironment theMavenEnvironment = MavenEnvironment.get();
    assertNotNull(theMavenEnvironment);

    assertSame(aMavenSession, theMavenEnvironment.getMavenSession());
    assertSame(aBuildPluginManager, theMavenEnvironment.getBuildPluginManager());
    assertSame(aLog, theMavenEnvironment.getLog());
    assertSame(aDependencyTreeBuilder, theMavenEnvironment.getDependencyTreeBuilder());
    assertSame(aLocalRepository, theMavenEnvironment.getLocalRepository());
    assertSame(aSecurityDispatcher, theMavenEnvironment.getSecurityDispatcher());
    assertSame(aProjectBuilder, theMavenEnvironment.getProjectBuilder());
    assertSame(aLifecycleExecutor, theMavenEnvironment.getLifecycleExecutor());
    assertSame(aArtifactFactory, theMavenEnvironment.getArtifactFactory());
    assertSame(aArtifactMetadataSource, theMavenEnvironment.getArtifactMetadataSource());
    assertSame(aArtifactCollector, theMavenEnvironment.getArtifactCollector());
    assertSame(aRuntimeInformation, theMavenEnvironment.getRuntimeInformation());

    MavenEnvironment.cleanUp();;
    assertNull(MavenEnvironment.get());
}
 
开发者ID:mirkosertic,项目名称:mavensonarsputnik,代码行数:44,代码来源:MavenEnvironmentTest.java

示例10: PropertyDecryptor

import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
public PropertyDecryptor(Log log, SecDispatcher securityDispatcher) {
  this.log = log;
  this.securityDispatcher = securityDispatcher;
}
 
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:5,代码来源:PropertyDecryptor.java

示例11: setSecurityDispatcher

import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
public void setSecurityDispatcher( SecDispatcher securityDispatcher )
{
    this.securityDispatcher = securityDispatcher;
}
 
开发者ID:mojohaus,项目名称:sql-maven-plugin,代码行数:5,代码来源:SqlExecMojo.java

示例12: SettingsDecrypter

import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
/**
 * Default constructor.
 *
 * @param securityDispatcher the Maven infrastructure to decrypt passwords
 *          from the settings.
 * @param settingsSecurityLocation the location of the
 *          <code>settings-security</code>.
 */
public SettingsDecrypter(final SecDispatcher securityDispatcher,
    final String settingsSecurityLocation)
{
  this.securityDispatcher = securityDispatcher;
  this.settingsSecurityLocation = init(settingsSecurityLocation);
}
 
开发者ID:release-engineering,项目名称:buildmetadata-maven-plugin,代码行数:15,代码来源:SettingsDecrypter.java


注:本文中的org.sonatype.plexus.components.sec.dispatcher.SecDispatcher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。