本文整理汇总了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;
}
示例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));
}
示例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);
}
}
示例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));
}
示例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;
}
示例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 );
}
示例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;
}
});
}
示例8: getSecurityDispatcher
import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
public SecDispatcher getSecurityDispatcher() {
return securityDispatcher;
}
示例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());
}
示例10: PropertyDecryptor
import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
public PropertyDecryptor(Log log, SecDispatcher securityDispatcher) {
this.log = log;
this.securityDispatcher = securityDispatcher;
}
示例11: setSecurityDispatcher
import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; //导入依赖的package包/类
public void setSecurityDispatcher( SecDispatcher securityDispatcher )
{
this.securityDispatcher = securityDispatcher;
}
示例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);
}