• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java InvalidRepositoryException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createLocalRepository

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
private ArtifactRepository createLocalRepository() {
  try {
    return getComponent(RepositorySystem.class).createLocalRepository(new File(myMavenSettings.getLocalRepository()));
  }
  catch (InvalidRepositoryException e) {
    throw new RuntimeException(e);
    // Legacy code.
  }
  //ArtifactRepositoryLayout layout = getComponent(ArtifactRepositoryLayout.class, "default");
  //ArtifactRepositoryFactory factory = getComponent(ArtifactRepositoryFactory.class);
  //
  //String url = myMavenSettings.getLocalRepository();
  //if (!url.startsWith("file:")) url = "file://" + url;
  //
  //ArtifactRepository localRepository = factory.createArtifactRepository("local", url, layout, null, null);
  //
  //boolean snapshotPolicySet = myMavenSettings.isOffline();
  //if (!snapshotPolicySet && snapshotUpdatePolicy == MavenServerSettings.UpdatePolicy.ALWAYS_UPDATE) {
  //  factory.setGlobalUpdatePolicy(ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS);
  //}
  //factory.setGlobalChecksumPolicy(ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN);
  //
  //return localRepository;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:Maven3ServerEmbedderImpl.java


示例2: buildArtifactRepository

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
public static ArtifactRepository buildArtifactRepository( Repository repo,
                                                          ArtifactRepositoryFactory artifactRepositoryFactory,
                                                          PlexusContainer c )
    throws InvalidRepositoryException
{
    RepositorySystem repositorySystem = rs( c );
    RepositorySystemSession session = rss( c );

    ArtifactRepository repository = repositorySystem.buildArtifactRepository( repo );

    if ( session != null )
    {
        repositorySystem.injectMirror( session, Arrays.asList( repository ) );
        repositorySystem.injectProxy( session, Arrays.asList( repository ) );
        repositorySystem.injectAuthentication( session, Arrays.asList( repository ) );
    }

    return repository;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:20,代码来源:ProjectUtils.java


示例3: injectDefaultRepositories

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
private void injectDefaultRepositories( MavenExecutionRequest request )
    throws MavenExecutionRequestPopulationException
{
    Set<String> definedRepositories = getRepoIds( request.getRemoteRepositories() );

    if ( !definedRepositories.contains( RepositorySystem.DEFAULT_REMOTE_REPO_ID ) )
    {
        try
        {
            request.addRemoteRepository( repositorySystem.createDefaultRemoteRepository() );
        }
        catch ( InvalidRepositoryException e )
        {
            throw new MavenExecutionRequestPopulationException( "Cannot create default remote repository.", e );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:18,代码来源:DefaultMavenExecutionRequestPopulator.java


示例4: injectDefaultPluginRepositories

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
private void injectDefaultPluginRepositories( MavenExecutionRequest request )
    throws MavenExecutionRequestPopulationException
{
    Set<String> definedRepositories = getRepoIds( request.getPluginArtifactRepositories() );

    if ( !definedRepositories.contains( RepositorySystem.DEFAULT_REMOTE_REPO_ID ) )
    {
        try
        {
            request.addPluginArtifactRepository( repositorySystem.createDefaultRemoteRepository() );
        }
        catch ( InvalidRepositoryException e )
        {
            throw new MavenExecutionRequestPopulationException( "Cannot create default remote repository.", e );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:18,代码来源:DefaultMavenExecutionRequestPopulator.java


示例5: createLocalRepository

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
public ArtifactRepository createLocalRepository( MavenExecutionRequest request )
    throws MavenExecutionRequestPopulationException
{
    String localRepositoryPath = null;

    if ( request.getLocalRepositoryPath() != null )
    {
        localRepositoryPath = request.getLocalRepositoryPath().getAbsolutePath();
    }

    if ( StringUtils.isEmpty( localRepositoryPath ) )
    {
        localRepositoryPath = RepositorySystem.defaultUserLocalRepository.getAbsolutePath();
    }

    try
    {
        return repositorySystem.createLocalRepository( new File( localRepositoryPath ) );
    }
    catch ( InvalidRepositoryException e )
    {
        throw new MavenExecutionRequestPopulationException( "Cannot create local repository.", e );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:25,代码来源:DefaultMavenExecutionRequestPopulator.java


示例6: getRemoteRepositories

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
protected List<ArtifactRepository> getRemoteRepositories()
    throws InvalidRepositoryException
{
    File repoDir = new File( getBasedir(), "src/test/remote-repo" ).getAbsoluteFile();

    RepositoryPolicy policy = new RepositoryPolicy();
    policy.setEnabled( true );
    policy.setChecksumPolicy( "ignore" );
    policy.setUpdatePolicy( "always" );

    Repository repository = new Repository();
    repository.setId( RepositorySystem.DEFAULT_REMOTE_REPO_ID );
    repository.setUrl( "file://" + repoDir.toURI().getPath() );
    repository.setReleases( policy );
    repository.setSnapshots( policy );

    return Arrays.asList( repositorySystem.buildArtifactRepository( repository ) );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:19,代码来源:AbstractCoreMavenComponentTestCase.java


示例7: getLocalRepository

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
public ArtifactRepository getLocalRepository() {
    try {
        String localRepositoryPath = getSettings().getLocalRepository();
        if (localRepositoryPath != null) {
            return repositorySystem.createLocalRepository(FileUtil.normalizeFile(new File(localRepositoryPath)));
        }
        return repositorySystem.createDefaultLocalRepository();
    } catch (InvalidRepositoryException ex) {
        // can't happen
        throw new IllegalStateException(ex);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:MavenEmbedder.java


示例8: createLocalRepository

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
private ArtifactRepository createLocalRepository() {
  try {
    final ArtifactRepository localRepository =
      getComponent(RepositorySystem.class).createLocalRepository(new File(myMavenSettings.getLocalRepository()));
    final String customRepoId = System.getProperty("maven3.localRepository.id", "localIntelliJ");
    if (customRepoId != null) {
      // see details at https://youtrack.jetbrains.com/issue/IDEA-121292
      localRepository.setId(customRepoId);
    }
    return localRepository;
  }
  catch (InvalidRepositoryException e) {
    throw new RuntimeException(e);
    // Legacy code.
  }
  //ArtifactRepositoryLayout layout = getComponent(ArtifactRepositoryLayout.class, "default");
  //ArtifactRepositoryFactory factory = getComponent(ArtifactRepositoryFactory.class);
  //
  //String url = myMavenSettings.getLocalRepository();
  //if (!url.startsWith("file:")) url = "file://" + url;
  //
  //ArtifactRepository localRepository = factory.createArtifactRepository("local", url, layout, null, null);
  //
  //boolean snapshotPolicySet = myMavenSettings.isOffline();
  //if (!snapshotPolicySet && snapshotUpdatePolicy == MavenServerSettings.UpdatePolicy.ALWAYS_UPDATE) {
  //  factory.setGlobalUpdatePolicy(ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS);
  //}
  //factory.setGlobalChecksumPolicy(ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN);
  //
  //return localRepository;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:Maven30ServerEmbedderImpl.java


示例9: convertRepositories

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
@NotNull
protected List<ArtifactRepository> convertRepositories(List<MavenRemoteRepository> repositories) throws RemoteException {
  List<ArtifactRepository> result = new ArrayList<ArtifactRepository>();
  for (MavenRemoteRepository each : repositories) {
    try {
      ArtifactRepositoryFactory factory = getComponent(ArtifactRepositoryFactory.class);
      result.add(ProjectUtils.buildArtifactRepository(MavenModelConverter.toNativeRepository(each), factory, myContainer));
    }
    catch (InvalidRepositoryException e) {
      Maven3ServerGlobals.getLogger().warn(e);
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:Maven30ServerEmbedderImpl.java


示例10: convertRepositories

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
private List<ArtifactRepository> convertRepositories(List<MavenRemoteRepository> repositories) throws RemoteException {
  List<ArtifactRepository> result = new ArrayList<ArtifactRepository>();
  for (MavenRemoteRepository each : repositories) {
    try {
      ArtifactRepositoryFactory factory = getComponent(ArtifactRepositoryFactory.class);
      result.add(ProjectUtils.buildArtifactRepository(Maven2ModelConverter.toNativeRepository(each), factory, getContainer()));
    }
    catch (InvalidRepositoryException e) {
      Maven2ServerGlobals.getLogger().warn(e);
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:Maven2ServerEmbedderImpl.java


示例11: repositoriesLegacy

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
private static List<ArtifactRepository> repositoriesLegacy(LegacyRepositorySystem legacy, Settings settings)
        throws InvalidRepositoryException {
    boolean central;
    List<ArtifactRepository> result;
    List<String> actives;
    ArtifactRepository artifactRepository;

    central = false;
    result = new ArrayList<>();
    actives = settings.getActiveProfiles();
    for (Profile profile : settings.getProfiles()) {
        if (actives.contains(profile.getId()) || (profile.getActivation() != null && profile.getActivation().isActiveByDefault())) {
            for (org.apache.maven.model.Repository repository : SettingsUtils.convertFromSettingsProfile(profile).getRepositories()) {
                artifactRepository = legacy.buildArtifactRepository(repository);
                if ("central".equals(artifactRepository.getId())) {
                    central = true;
                }
                result.add(artifactRepository);
            }
        }
    }
    if (!central) {
        /* Maven defines the default central repository in its master parent - and not in the default settings, which I'd prefer.
           As a consequent, central is not always defined when loading the settings.
           I first added central to repositories only, because legacy repositories are used to load poms which ultimatly load the
           master parent with it's repository definition. However, the parent might have to be loaded from central, so repositories
           also need a central definition. */
        result.add(legacy.createDefaultRemoteRepository());
    }
    return result;
}
 
开发者ID:mlhartme,项目名称:maven-embedded,代码行数:32,代码来源:Maven.java


示例12: convertRepositories

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
private List<ArtifactRepository> convertRepositories(List<MavenRemoteRepository> repositories) throws RemoteException {
  List<ArtifactRepository> result = new ArrayList<ArtifactRepository>();
  for (MavenRemoteRepository each : repositories) {
    try {
      ArtifactRepositoryFactory factory = getComponent(ArtifactRepositoryFactory.class);
      result.add(ProjectUtils.buildArtifactRepository(MavenModelConverter.toNativeRepository(each), factory, myContainer));
    }
    catch (InvalidRepositoryException e) {
      Maven3ServerGlobals.getLogger().warn(e);
    }
  }
  return result;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:Maven3ServerEmbedderImpl.java


示例13: getReleaseRepo

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
private ArtifactRepository getReleaseRepo() {
	DistributionManagement distributionManagement = project.getDistributionManagement();
       if ( distributionManagement != null && distributionManagement.getRepository() != null ) {        	
       	try {
       		ArtifactRepository repo = repositorySystem.buildArtifactRepository(distributionManagement.getRepository());

               repositorySystem.injectProxy( projectBuilderConfiguration.getRepositorySession(), Arrays.asList( repo ) );
               repositorySystem.injectAuthentication( projectBuilderConfiguration.getRepositorySession(),
                                                      Arrays.asList( repo ) );
               return repo;
       	} catch (InvalidRepositoryException e) {}
       }
       return null;
}
 
开发者ID:johnoliver,项目名称:git-rollback-maven-plugin,代码行数:15,代码来源:GitReleaseRollback.java


示例14: buildArtifactRepositories

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
public static List<ArtifactRepository> buildArtifactRepositories( List<Repository> repositories,
                                                                  ArtifactRepositoryFactory artifactRepositoryFactory,
                                                                  PlexusContainer c )
    throws InvalidRepositoryException
{

    List<ArtifactRepository> remoteRepositories = new ArrayList<ArtifactRepository>();

    for ( Repository r : repositories )
    {
        remoteRepositories.add( buildArtifactRepository( r, artifactRepositoryFactory, c ) );
    }

    return remoteRepositories;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:16,代码来源:ProjectUtils.java


示例15: buildDeploymentArtifactRepository

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
public static ArtifactRepository buildDeploymentArtifactRepository( DeploymentRepository repo,
                                                                    ArtifactRepositoryFactory artifactRepositoryFactory,
                                                                    PlexusContainer c )
    throws InvalidRepositoryException
{
    return buildArtifactRepository( repo, artifactRepositoryFactory, c );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:8,代码来源:ProjectUtils.java


示例16: createLocalRepository

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
public ArtifactRepository createLocalRepository( File localRepository )
    throws InvalidRepositoryException
{
    return createRepository( "file://" + localRepository.toURI().getRawPath(),
                             RepositorySystem.DEFAULT_LOCAL_REPO_ID, true,
                             ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, true,
                             ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS,
                             ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:10,代码来源:LegacyRepositorySystem.java


示例17: createDefaultRemoteRepository

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
public ArtifactRepository createDefaultRemoteRepository()
    throws InvalidRepositoryException
{
    return createRepository( RepositorySystem.DEFAULT_REMOTE_REPO_URL, RepositorySystem.DEFAULT_REMOTE_REPO_ID,
                             true, ArtifactRepositoryPolicy.UPDATE_POLICY_DAILY, false,
                             ArtifactRepositoryPolicy.UPDATE_POLICY_DAILY,
                             ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:9,代码来源:LegacyRepositorySystem.java


示例18: buildArtifactRepository

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
public ArtifactRepository buildArtifactRepository( Repository repo )
    throws InvalidRepositoryException
{
    if ( repo != null )
    {
        String id = repo.getId();

        if ( StringUtils.isEmpty( id ) )
        {
            throw new InvalidRepositoryException( "Repository identifier missing", "" );
        }

        String url = repo.getUrl();

        if ( StringUtils.isEmpty( url ) )
        {
            throw new InvalidRepositoryException( "URL missing for repository " + id, id );
        }

        ArtifactRepositoryPolicy snapshots = buildArtifactRepositoryPolicy( repo.getSnapshots() );

        ArtifactRepositoryPolicy releases = buildArtifactRepositoryPolicy( repo.getReleases() );

        return createArtifactRepository( id, url, getLayout( repo.getLayout() ), snapshots, releases );
    }
    else
    {
        return null;
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:31,代码来源:LegacyRepositorySystem.java


示例19: getReleaseArtifactRepository

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
protected ArtifactRepository getReleaseArtifactRepository()
{
    if ( releaseArtifactRepository == null )
    {
        if ( getDistributionManagement() != null && getDistributionManagement().getRepository() != null )
        {
            checkProjectBuildingRequest();
            try
            {
                ArtifactRepository repo =
                    repositorySystem.buildArtifactRepository( getDistributionManagement().getRepository() );
                repositorySystem.injectProxy( projectBuilderConfiguration.getRepositorySession(),
                                              Arrays.asList( repo ) );
                repositorySystem.injectAuthentication( projectBuilderConfiguration.getRepositorySession(),
                                                       Arrays.asList( repo ) );
                setReleaseArtifactRepository( repo );
            }
            catch ( InvalidRepositoryException e )
            {
                throw new IllegalStateException( "Failed to create release distribution repository for " + getId(),
                                                 e );
            }
        }
    }

    return releaseArtifactRepository;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:28,代码来源:MavenProject.java


示例20: getSnapshotArtifactRepository

import org.apache.maven.artifact.InvalidRepositoryException; //导入依赖的package包/类
protected ArtifactRepository getSnapshotArtifactRepository()
{
    if ( snapshotArtifactRepository == null )
    {
        if ( getDistributionManagement() != null && getDistributionManagement().getSnapshotRepository() != null )
        {
            checkProjectBuildingRequest();
            try
            {
                ArtifactRepository repo =
                    repositorySystem.buildArtifactRepository( getDistributionManagement().getSnapshotRepository() );
                repositorySystem.injectProxy( projectBuilderConfiguration.getRepositorySession(),
                                              Arrays.asList( repo ) );
                repositorySystem.injectAuthentication( projectBuilderConfiguration.getRepositorySession(),
                                                       Arrays.asList( repo ) );
                setSnapshotArtifactRepository( repo );
            }
            catch ( InvalidRepositoryException e )
            {
                throw new IllegalStateException(
                                                 "Failed to create snapshot distribution repository for " + getId(),
                                                 e );
            }
        }
    }

    return snapshotArtifactRepository;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:29,代码来源:MavenProject.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TimeTableXYDataset类代码示例发布时间:2022-05-23
下一篇:
Java SafetyNetApi类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap