本文整理汇总了Java中org.apache.maven.repository.internal.MavenRepositorySystemSession类的典型用法代码示例。如果您正苦于以下问题:Java MavenRepositorySystemSession类的具体用法?Java MavenRepositorySystemSession怎么用?Java MavenRepositorySystemSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MavenRepositorySystemSession类属于org.apache.maven.repository.internal包,在下文中一共展示了MavenRepositorySystemSession类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: newRepositorySystemSession
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
public static RepositorySystemSession newRepositorySystemSession(
RepositorySystem system, String localRepoPath) {
Validate.notNull(localRepoPath, "localRepoPath should have a value");
MavenRepositorySystemSession session = new MavenRepositorySystemSession();
LocalRepository localRepo = new LocalRepository(resolveLocalRepoPath(localRepoPath));
session.setLocalRepositoryManager(system.newLocalRepositoryManager(localRepo));
if (logger.isDebugEnabled()) {
session.setTransferListener(new TransferListener());
session.setRepositoryListener(new RepositoryListener());
}
// uncomment to generate dirty trees
// session.setDependencyGraphTransformer( null );
return session;
}
开发者ID:apache,项目名称:zeppelin,代码行数:19,代码来源:Booter.java
示例2: ArtifactResolver
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
public ArtifactResolver(String localRepositoryDir, List<String> remoteRepositoryUris)
{
MavenServiceLocator locator = new MavenServiceLocator();
locator.addService(RepositoryConnectorFactory.class, FileRepositoryConnectorFactory.class);
locator.addService(RepositoryConnectorFactory.class, AsyncRepositoryConnectorFactory.class);
repositorySystem = locator.getService(RepositorySystem.class);
repositorySystemSession = new MavenRepositorySystemSession();
LocalRepositoryManager localRepositoryManager = new SimpleLocalRepositoryManager(localRepositoryDir);
repositorySystemSession.setLocalRepositoryManager(localRepositoryManager);
repositorySystemSession.setTransferListener(new ConsoleTransferListener());
repositorySystemSession.setRepositoryListener(new ConsoleRepositoryListener());
List<RemoteRepository> repositories = new ArrayList<>(remoteRepositoryUris.size());
int index = 0;
for (String repositoryUri : remoteRepositoryUris) {
repositories.add(new RemoteRepository("repo-" + index++, "default", repositoryUri));
}
this.repositories = Collections.unmodifiableList(repositories);
}
开发者ID:airlift,项目名称:resolver,代码行数:23,代码来源:ArtifactResolver.java
示例3: AbstractMavenPublishAction
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
protected AbstractMavenPublishAction(File pomFile, List<File> wagonJars) {
container = newPlexusContainer(wagonJars);
session = new MavenRepositorySystemSession();
session.setTransferListener(new LoggingMavenTransferListener());
session.getConfigProperties().put("maven.metadata.legacy", "true");
Model pom = parsePom(pomFile);
pomArtifact = new DefaultArtifact(pom.getGroupId(), pom.getArtifactId(), "pom", pom.getVersion()).setFile(pomFile);
mainArtifact = createTypedArtifact(pom.getPackaging(), null);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:AbstractMavenPublishAction.java
示例4: newRepositorySystemSession
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
private RepositorySystemSession newRepositorySystemSession( RepositorySystem system, String localRepoDir )
{
MavenRepositorySystemSession session = new MavenRepositorySystemSession();
DependencySelector depFilter = new AndDependencySelector( new ExclusionDependencySelector() );
session.setDependencySelector( depFilter );
session.setLocalRepositoryManager(
new SimpleLocalRepositoryManager( localRepoDir ) );
return session;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:13,代码来源:Maven3DependencyTreeBuilder.java
示例5: newRepositorySystemSession
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
public static RepositorySystemSession newRepositorySystemSession(
RepositorySystem system, String localRepoPath) {
MavenRepositorySystemSession session = new MavenRepositorySystemSession();
// find homedir
String home = System.getenv("ZEPPELIN_HOME");
if (home == null) {
home = System.getProperty("zeppelin.home");
}
if (home == null) {
home = "..";
}
String path = home + "/" + localRepoPath;
LocalRepository localRepo =
new LocalRepository(new File(path).getAbsolutePath());
session.setLocalRepositoryManager(system.newLocalRepositoryManager(localRepo));
// session.setTransferListener(new ConsoleTransferListener());
// session.setRepositoryListener(new ConsoleRepositoryListener());
// uncomment to generate dirty trees
// session.setDependencyGraphTransformer( null );
return session;
}
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:28,代码来源:Booter.java
示例6: repositorySystemSession
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
public static RepositorySystemSession repositorySystemSession(RepositorySystem system)
{
MavenRepositorySystemSession session = new MavenRepositorySystemSession();
session.setLocalRepositoryManager(system.newLocalRepositoryManager(LOCAL_REPO));
session.setTransferListener(new LoggingTransferListener());
session.setRepositoryListener(new LoggingRepositoryListener());
session.setChecksumPolicy(RepositoryPolicy.CHECKSUM_POLICY_WARN);
return session;
}
开发者ID:bnavetta,项目名称:tycho-gen,代码行数:13,代码来源:Maven.java
示例7: newRepositorySystemSession
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
public static RepositorySystemSession newRepositorySystemSession( RepositorySystem system, File localRepoDir )
{
MavenRepositorySystemSession session = new MavenRepositorySystemSession();
LocalRepository localRepo = new LocalRepository(localRepoDir);
session.setLocalRepositoryManager( system.newLocalRepositoryManager( localRepo ) );
session.setTransferListener( new TransferListener() );
session.setRepositoryListener( new RepositoryListener() );
return session;
}
开发者ID:terraframe,项目名称:Runway-SDK,代码行数:13,代码来源:MavenClasspathBuilder.java
示例8: initRepoSession
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
protected void initRepoSession( ProjectBuildingRequest request )
{
File localRepo = new File( request.getLocalRepository().getBasedir() );
MavenRepositorySystemSession session = new MavenRepositorySystemSession( true );
session.setLocalRepositoryManager( new LegacyLocalRepositoryManager( localRepo ) );
request.setRepositorySession( session );
}
开发者ID:gems-uff,项目名称:oceano,代码行数:8,代码来源:AbstractMavenProjectTestCase.java
示例9: initRepoSession
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
protected void initRepoSession( ProjectBuildingRequest request )
{
File localRepo = new File( request.getLocalRepository().getBasedir() );
MavenRepositorySystemSession repoSession = new MavenRepositorySystemSession( true );
repoSession.setLocalRepositoryManager( new LegacyLocalRepositoryManager( localRepo ) );
request.setRepositorySession( repoSession );
}
开发者ID:gems-uff,项目名称:oceano,代码行数:8,代码来源:AbstractMavenProjectTestCase.java
示例10: buildPom
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
private PomTestWrapper buildPom( String pomPath, boolean lenientValidation, Properties executionProperties,
String... profileIds )
throws ProjectBuildingException
{
File pomFile = new File( testDirectory, pomPath );
if ( pomFile.isDirectory() )
{
pomFile = new File( pomFile, "pom.xml" );
}
ProjectBuildingRequest config = new DefaultProjectBuildingRequest();
String localRepoUrl =
System.getProperty( "maven.repo.local", System.getProperty( "user.home" ) + "/.m2/repository" );
localRepoUrl = "file://" + localRepoUrl;
config.setLocalRepository( repositorySystem.createArtifactRepository( "local", localRepoUrl, new DefaultRepositoryLayout(), null, null ) );
config.setActiveProfileIds( Arrays.asList( profileIds ) );
config.setSystemProperties( executionProperties );
config.setUserProperties( executionProperties );
config.setValidationLevel( lenientValidation ? ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0
: ModelBuildingRequest.VALIDATION_LEVEL_STRICT );
MavenRepositorySystemSession repoSession = new MavenRepositorySystemSession( true );
repoSession.setLocalRepositoryManager( new SimpleLocalRepositoryManager(
new File(
config.getLocalRepository().getBasedir() ) ) );
config.setRepositorySession( repoSession );
return new PomTestWrapper( pomFile, projectBuilder.build( pomFile, config ).getProject() );
}
开发者ID:gems-uff,项目名称:oceano,代码行数:30,代码来源:PomConstructionTest.java
示例11: initRepoSession
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
protected void initRepoSession( ProjectBuildingRequest request )
{
File localRepo = new File( request.getLocalRepository().getBasedir() );
MavenRepositorySystemSession session = new MavenRepositorySystemSession( true );
session.setLocalRepositoryManager( new SimpleLocalRepositoryManager( localRepo ) );
request.setRepositorySession( session );
}
开发者ID:gems-uff,项目名称:oceano,代码行数:8,代码来源:AbstractCoreMavenComponentTestCase.java
示例12: buildPom
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
private PomTestWrapper buildPom( String pomPath )
throws Exception
{
File pomFile = new File( testDirectory + File.separator + pomPath, "pom.xml" );
File settingsFile = new File( testDirectory + File.separator + pomPath, "settings.xml" );
Settings settings = readSettingsFile( settingsFile );
ProjectBuildingRequest config = new DefaultProjectBuildingRequest();
for ( org.apache.maven.settings.Profile rawProfile : settings.getProfiles() )
{
Profile profile = SettingsUtils.convertFromSettingsProfile( rawProfile );
config.addProfile( profile );
}
String localRepoUrl =
System.getProperty( "maven.repo.local", System.getProperty( "user.home" ) + "/.m2/repository" );
localRepoUrl = "file://" + localRepoUrl;
config.setLocalRepository( repositorySystem.createArtifactRepository( "local", localRepoUrl,
new DefaultRepositoryLayout(), null, null ) );
config.setActiveProfileIds( settings.getActiveProfiles() );
MavenRepositorySystemSession repoSession = new MavenRepositorySystemSession( true );
repoSession.setLocalRepositoryManager( new SimpleLocalRepositoryManager(
new File(
config.getLocalRepository().getBasedir() ) ) );
config.setRepositorySession( repoSession );
return new PomTestWrapper( pomFile, projectBuilder.build( pomFile, config ).getProject() );
}
开发者ID:gems-uff,项目名称:oceano,代码行数:30,代码来源:PomConstructionWithSettingsTest.java
示例13: decorate
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
@Override
public MavenRepositorySystemSession decorate(MavenRepositorySystemSession session) {
if (verbose) {
session.setTransferListener(new ConsoleTransferListener());
session.setRepositoryListener(new ConsoleRepositoryListener());
}
return session;
}
开发者ID:ndeloof,项目名称:bees-cli-bootstrap,代码行数:9,代码来源:BootMavenRepositorySystemSessionDecorator.java
示例14: configure
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
@Override
protected void configure() {
// NettyAsyncHttpProvider prints some INFO-level messages. suppress them
Logger.getLogger("com.ning.http.client.providers.netty.NettyAsyncHttpProvider").setLevel(Level.WARNING);
LoggerFactory.getLogger(NettyAsyncHttpProvider.class);
bind(LocalRepository.class).toProvider(LocalRepositorySetting.class);
bind(MavenRepositorySystemSession.class).toProvider(MavenRepositorySystemSessionFactory.class);
}
开发者ID:cloudbees,项目名称:bees-maven-components,代码行数:10,代码来源:RepositorySystemModule.java
示例15: get
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
public MavenRepositorySystemSession get() {
MavenRepositorySystemSession session = new MavenRepositorySystemSession();
session.setLocalRepositoryManager(rs.newLocalRepositoryManager(localRepository.get()));
for (MavenRepositorySystemSessionDecorator d : decorators) {
session = d.decorate(session);
}
return session;
}
开发者ID:cloudbees,项目名称:bees-maven-components,代码行数:9,代码来源:MavenRepositorySystemSessionFactory.java
示例16: getSession
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
/**
* Provides access to the underlying session.
*/
public MavenRepositorySystemSession getSession() {
return session;
}
开发者ID:cloudbees,项目名称:bees-maven-components,代码行数:7,代码来源:RepositoryService.java
示例17: decorate
import org.apache.maven.repository.internal.MavenRepositorySystemSession; //导入依赖的package包/类
public abstract MavenRepositorySystemSession decorate(MavenRepositorySystemSession session);
开发者ID:cloudbees,项目名称:bees-maven-components,代码行数:2,代码来源:MavenRepositorySystemSessionDecorator.java
注:本文中的org.apache.maven.repository.internal.MavenRepositorySystemSession类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论