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

Java DefaultRepositoryLayout类代码示例

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

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



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

示例1: provideLocalRepository

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
/**
 * maven-plugin-testing-harness can not inject local repositories (though the real runtime supports it).
 * and the default stubs have no sufficient implementation of getPath(): 
 * @see "http://maven.apache.org/plugin-testing/maven-plugin-testing-harness/examples/repositories.html"
 */
private ArtifactRepository provideLocalRepository() throws IllegalAccessException
{
  DefaultArtifactRepositoryFactory factory = new DefaultArtifactRepositoryFactory();
  setVariableValueToObject(factory, "factory", new org.apache.maven.repository.legacy.repository.DefaultArtifactRepositoryFactory());
  
  LegacySupport legacySupport = new DefaultLegacySupport();
  setVariableValueToObject(factory, "legacySupport", legacySupport);
  
  ArtifactRepository localRepository = factory.createArtifactRepository("local", "http://localhost", 
          new DefaultRepositoryLayout(), new ArtifactRepositoryPolicy(), new ArtifactRepositoryPolicy());
  
  setVariableValueToObject(localRepository, "basedir", LOCAL_REPOSITORY);
  
  return localRepository;
}
 
开发者ID:axonivy,项目名称:project-build-plugin,代码行数:21,代码来源:BaseEngineProjectMojoTest.java


示例2: createHelper

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
private DefaultVersionsHelper createHelper( String rulesUri, ArtifactMetadataSource metadataSource )
    throws MojoExecutionException
{
    final DefaultWagonManager wagonManager = new DefaultWagonManager()
    {
        public Wagon getWagon( Repository repository )
            throws UnsupportedProtocolException, WagonConfigurationException
        {
            return new FileWagon();
        }
    };

    DefaultVersionsHelper helper =
        new DefaultVersionsHelper( new DefaultArtifactFactory(), new DefaultArtifactResolver(), metadataSource, new ArrayList(),
                                   new ArrayList(),
                                   new DefaultArtifactRepository( "", "", new DefaultRepositoryLayout() ),
                                   wagonManager, new Settings(), "", rulesUri, mock( Log.class ), mock( MavenSession.class ),
                                   new DefaultPathTranslator());
    return helper;
}
 
开发者ID:mojohaus,项目名称:versions-maven-plugin,代码行数:21,代码来源:DefaultVersionsHelperTest.java


示例3: testFindArtifactInRepository

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
@Test
public void testFindArtifactInRepository() throws MojoExecutionException {
    GenerateMojo mojo = new GenerateMojo();
    mojo.setLog(new SystemStreamLog());

    Dependency dependency = mojo.findArtifactInRepository(
            new DefaultArtifact("org.spigotmc", "spigot-api", "1.8-R0.1-SNAPSHOT",
                                "compile", "jar", "jar", new DefaultArtifactHandler()),
            new MavenArtifactRepository("yawkat",
                                        "http://mvn.yawk.at",
                                        new DefaultRepositoryLayout(),
                                        new ArtifactRepositoryPolicy(),
                                        new ArtifactRepositoryPolicy())
    );
    Assert.assertNotNull(dependency);
}
 
开发者ID:yawkat,项目名称:mdep,代码行数:17,代码来源:GenerateMojoTest.java


示例4: setUpProject

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
private void setUpProject( File pomFile, AbstractMojo mojo )
    throws Exception
{
    MavenProjectBuilder projectBuilder = (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE );

    ArtifactRepositoryFactory artifactRepositoryFactory =
        (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE );

    ArtifactRepositoryPolicy policy = new ArtifactRepositoryPolicy( true, "never", "never" );

    String localRepoUrl = "file://" + System.getProperty( "user.home" ) + "/.m2/repository";

    ArtifactRepository localRepository =
        artifactRepositoryFactory.createArtifactRepository( "local", localRepoUrl, new DefaultRepositoryLayout(),
                                                            policy, policy );

    ProfileManager profileManager = new DefaultProfileManager( getContainer() );

    MavenProject project = projectBuilder.buildWithDependencies( pomFile, localRepository, profileManager );

    //this gets the classes for these tests of this mojo (exec plugin) onto the project classpath for the test
    project.getBuild().setOutputDirectory( new File( "target/test-classes" ).getAbsolutePath() );
    setVariableValueToObject( mojo, "project", project );
}
 
开发者ID:mojohaus,项目名称:webstart,代码行数:25,代码来源:AbstractJnlpMojoTest.java


示例5: createHelper

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
private VersionsHelper createHelper( String rulesUri, ArtifactMetadataSource metadataSource )
    throws MojoExecutionException
{
    final DefaultWagonManager wagonManager = new DefaultWagonManager()
    {
        public Wagon getWagon( Repository repository )
            throws UnsupportedProtocolException, WagonConfigurationException
        {
            return new FileWagon();
        }
    };

    VersionsHelper helper =
        new DefaultVersionsHelper( new DefaultArtifactFactory(), new DefaultArtifactResolver(), metadataSource, new ArrayList(),
                                   new ArrayList(),
                                   new DefaultArtifactRepository( "", "", new DefaultRepositoryLayout() ),
                                   wagonManager, new Settings(), "", rulesUri, mock( Log.class ), mock( MavenSession.class ),
                                   new DefaultPathTranslator());
    return helper;
}
 
开发者ID:petr-ujezdsky,项目名称:versions-maven-plugin-svn-clone,代码行数:21,代码来源:DefaultVersionsHelperTest.java


示例6: convertFromMavenSettingsRepository

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
public static ArtifactRepository convertFromMavenSettingsRepository(Repository repository)
{
   MavenArtifactRepository result = new MavenArtifactRepository();
   result.setId(repository.getId());
   result.setUrl(repository.getUrl());

   String layout = repository.getLayout();
   if ("default".equals(layout))
      result.setLayout(new DefaultRepositoryLayout());
   else if ("p2".equals(layout))
      result.setLayout(new P2ArtifactRepositoryLayout());

   RepositoryPolicy releases = repository.getReleases();
   if (releases != null)
      result.setReleaseUpdatePolicy(new ArtifactRepositoryPolicy(releases.isEnabled(), releases.getUpdatePolicy(),
               releases.getChecksumPolicy()));

   RepositoryPolicy snapshots = repository.getSnapshots();
   if (snapshots != null)
      result.setSnapshotUpdatePolicy(new ArtifactRepositoryPolicy(snapshots.isEnabled(),
               snapshots.getUpdatePolicy(),
               snapshots.getChecksumPolicy()));

   return result;
}
 
开发者ID:forge,项目名称:furnace,代码行数:26,代码来源:RepositoryUtils.java


示例7: toArtifactRepository

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
public static ArtifactRepository toArtifactRepository(String id, String url, String layout,
         boolean containsReleases,
         boolean containsSnapshots)
{
   MavenArtifactRepository result = new MavenArtifactRepository();
   result.setId(id);
   result.setUrl(url);

   if (layout == null || layout.isEmpty() || "default".equals(layout))
   {
      result.setLayout(new DefaultRepositoryLayout());
   }
   else if ("p2".equals(layout))
   {
      result.setLayout(new P2ArtifactRepositoryLayout());
   }
   result.setReleaseUpdatePolicy(new ArtifactRepositoryPolicy(containsReleases,
            ArtifactRepositoryPolicy.UPDATE_POLICY_NEVER,
            ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN));
   result.setSnapshotUpdatePolicy(new ArtifactRepositoryPolicy(containsSnapshots,
            ArtifactRepositoryPolicy.UPDATE_POLICY_DAILY,
            ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN));
   return result;

}
 
开发者ID:forge,项目名称:furnace,代码行数:26,代码来源:RepositoryUtils.java


示例8: resolve

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
private Object resolve(String bundle) throws Exception, ArtifactNotFoundException {
    if (!isMavenProtocol(bundle)) {
        return bundle;
    }
    Artifact artifact = getArtifact(bundle);
    if (bundle.indexOf(MVN_REPO_SEPARATOR) >= 0) {
        if (bundle.startsWith(MVN_URI_PREFIX)) {
            bundle = bundle.substring(MVN_URI_PREFIX.length());
        }
        String repo = bundle.substring(0, bundle.indexOf(MVN_REPO_SEPARATOR));
        ArtifactRepository repository = new DefaultArtifactRepository(artifact.getArtifactId() + "-repo", repo,
                new DefaultRepositoryLayout());
        List<ArtifactRepository> repos = new LinkedList<ArtifactRepository>();
        repos.add(repository);
        resolver.resolve(artifact, repos, localRepo);
    } else {
        resolver.resolve(artifact, remoteRepos, localRepo);
    }
    if (artifact == null) {
        throw new Exception("Unable to resolve artifact for uri " + bundle);
    } else {
        return artifact;
    }
}
 
开发者ID:retog,项目名称:karaf-maven-plugin,代码行数:25,代码来源:ValidateDescriptorMojo.java


示例9: initialize

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
protected void initialize() throws Exception {
    basedir = getBasedir();

    File settingsFile = new File(System.getProperty("user.home"), ".m2/settings.xml");
    String localRepo = null;
    if (settingsFile.exists()) {
        Settings settings = new SettingsXpp3Reader().read(new FileReader(settingsFile));
        localRepo = settings.getLocalRepository();
    } else {
        localRepo = System.getProperty("user.home") + "/.m2/repository";
    }
    if (localRepo == null) {
        localRepo = System.getProperty("user.home") + "/.m2/repository";
    }

    localRepository = new DefaultArtifactRepository("local", "file://" + localRepo, new DefaultRepositoryLayout());

}
 
开发者ID:mulesoft,项目名称:mule-tooling-incubator,代码行数:19,代码来源:MavenArtifactResolver.java


示例10: propagateRepositoryPolicies

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
@Test
// SWARM-1173: swarm-plugin trying to download SNAPSHOTs from Maven Central
public void propagateRepositoryPolicies() {
    RepositorySystemSession sessionMock = Mockito.mock(RepositorySystemSession.class);
    MirrorSelector mirrorSelectorMock = Mockito.mock(MirrorSelector.class);
    Mockito.when(sessionMock.getMirrorSelector()).thenReturn(mirrorSelectorMock);
    ProxySelector proxySelectorMock = Mockito.mock(ProxySelector.class);
    Mockito.when(sessionMock.getProxySelector()).thenReturn(proxySelectorMock);

    MavenArtifactResolvingHelper artifactResolverHelper = new MavenArtifactResolvingHelper(null, null, sessionMock, null);
    ArtifactRepositoryPolicy testSnapshotPolicy = new ArtifactRepositoryPolicy(false, "hourly", "warn");
    ArtifactRepositoryPolicy testReleasesPolicy = new ArtifactRepositoryPolicy(true, "never", "warn");
    ArtifactRepository testingRepo = new MavenArtifactRepository("testing-repo", "http://testing-repo.org", new DefaultRepositoryLayout(), testSnapshotPolicy, testReleasesPolicy);
    artifactResolverHelper.remoteRepository(testingRepo);

    List<RemoteRepository> remoteRepos = artifactResolverHelper.getRemoteRepositories();

    Assert.assertTrue("Remote repositories " + remoteRepos + " do not contain expected testing repo " + testingRepo,
                      remoteRepos.stream().anyMatch(
                              remoteRepo -> {
                                  RepositoryPolicy snapshotsPolicy = remoteRepo.getPolicy(true);
                                  RepositoryPolicy releasesPolicy = remoteRepo.getPolicy(false);
                                  return remoteRepo.getId().equals(testingRepo.getId()) &&
                                          !snapshotsPolicy.isEnabled() &&
                                          snapshotsPolicy.getUpdatePolicy().equals(testSnapshotPolicy.getUpdatePolicy()) &&
                                          snapshotsPolicy.getChecksumPolicy().equals(testSnapshotPolicy.getChecksumPolicy()) &&
                                          releasesPolicy.isEnabled() &&
                                          releasesPolicy.getUpdatePolicy().equals(testReleasesPolicy.getUpdatePolicy()) &&
                                          releasesPolicy.getChecksumPolicy().equals(testReleasesPolicy.getChecksumPolicy());
                              })
    );
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:33,代码来源:MavenArtifactResolvingHelperTest.java


示例11: repo

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
private ArtifactRepository repo(String id, String url, boolean releases,
		boolean snapshots) {
	MavenArtifactRepository repository = new MavenArtifactRepository();
	repository.setLayout(new DefaultRepositoryLayout());
	repository.setId(id);
	repository.setUrl(url);
	ArtifactRepositoryPolicy enabled = new ArtifactRepositoryPolicy();
	enabled.setEnabled(true);
	ArtifactRepositoryPolicy disabled = new ArtifactRepositoryPolicy();
	disabled.setEnabled(false);
	repository.setReleaseUpdatePolicy(releases ? enabled : disabled);
	repository.setSnapshotUpdatePolicy(snapshots ? enabled : disabled);
	return repository;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-function,代码行数:15,代码来源:DependencyResolver.java


示例12: testCreateEffectivePom

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
/**
 * Tests method to create effective POM.
 *
 * @throws Exception if something goes wrong.
 */
@Test
public void testCreateEffectivePom()
    throws Exception
{

    String magicValue = "magic-value";
    Properties userProperties = new Properties();
    userProperties.setProperty( "cmd.test.property", magicValue );

    File pomFile = new File( "src/test/resources/cmdpropertysubstituion/pom.xml" );
    ArtifactRepository localRepository = new MavenArtifactRepository();
    localRepository.setLayout( new DefaultRepositoryLayout() );
    ArtifactFactory artifactFactory = new DefaultArtifactFactory();
    ArtifactHandlerManager artifactHandlerManager = new DefaultArtifactHandlerManager();
    setDeclaredField( artifactFactory, "artifactHandlerManager", artifactHandlerManager );
    Map<String, ArtifactHandler> artifactHandlers = new HashMap<String, ArtifactHandler>();
    setDeclaredField( artifactHandlerManager, "artifactHandlers", artifactHandlers );
    DefaultDependencyResolver depencencyResolver = new DefaultDependencyResolver();
    DefaultProjectBuildingRequest projectBuildingRequest = new DefaultProjectBuildingRequest();
    FlattenModelResolver resolver = new FlattenModelResolver( localRepository, artifactFactory,
            depencencyResolver, projectBuildingRequest, Collections.<MavenProject>emptyList() );
    ModelBuildingRequest buildingRequest =
        new DefaultModelBuildingRequest().setPomFile( pomFile ).setModelResolver( resolver ).setUserProperties( userProperties );
    Model effectivePom = FlattenMojo.createEffectivePom( buildingRequest, false );
    assertThat( effectivePom.getName() ).isEqualTo( magicValue );
}
 
开发者ID:mojohaus,项目名称:flatten-maven-plugin,代码行数:32,代码来源:CreateEffectivePomTest.java


示例13: testExecute

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
/**
 * Validate the generation of a java files from purchaseorder.xsd.
 * 
 * @throws MojoExecutionException
 */
public void testExecute() throws Exception {

	final File pom = new File(getBaseDir(),
			"pom.xml");

	final ArtifactRepository localRepository = new DefaultArtifactRepository(
			"local",

			new File(getBaseDir(), "target/test-repository").toURI()
					.toURL().toString(), new DefaultRepositoryLayout());

	final MavenProject mavenProject = mavenProjectBuilder.build(pom,
			localRepository, null);

	final Hyperjaxb3Mojo generator = (Hyperjaxb3Mojo) lookupMojo(
			"org.jvnet.hyperjaxb3",
			"hyperjaxb3-maven-plugin",
			"0.5.4-SNAPSHOT",
			"generate", null);
	generator.setProject(mavenProject);
	generator.setLocalRepository(localRepository);
	generator.setSchemaDirectory(new File(getBaseDir(),
			"src/main/resources"));
	generator.setSchemaIncludes(new String[] { "*.xsd" });
	generator.setBindingIncludes(new String[] { "*.xjb" });
	generator.setGenerateDirectory(new File(getBaseDir(),
			"target/test/generated-sources"));
	generator.setVerbose(true);
	generator.setRemoveOldOutput(true);
	generator.execute();
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:37,代码来源:RunPoPlugin.java


示例14: setUp

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
protected void setUp() throws Exception {
	super.setUp();

	mavenProjectBuilder = (MavenProjectBuilder) getContainer().lookup(
			MavenProjectBuilder.ROLE);
	ArtifactFactory artifactFactory = (ArtifactFactory) getContainer()
			.lookup(ArtifactFactory.ROLE);

	final Map<String, Mojo> mojos = (Map<String, Mojo>) getContainer()
			.lookupMap(Mojo.ROLE);

	for (Mojo mojo : mojos.values()) {
		if (mojo instanceof Hyperjaxb3Mojo) {
			this.mojo = (Hyperjaxb3Mojo) mojo;
		}
	}

	MavenSettingsBuilder settingsBuilder = (MavenSettingsBuilder) getContainer()
			.lookup(MavenSettingsBuilder.ROLE);
	ArtifactRepositoryLayout repositoryLayout = (ArtifactRepositoryLayout) getContainer()
			.lookup(ArtifactRepositoryLayout.ROLE, "default");

	Settings settings = settingsBuilder.buildSettings();

	String url = settings.getLocalRepository();

	if (!url.startsWith("file:")) {
		url = "file://" + url;
	}

	localRepository = new DefaultArtifactRepository("local", url,
			new DefaultRepositoryLayout());
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:34,代码来源:RunEpisodesBPlugin.java


示例15: testExecute

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
/**
 * Validate the generation of a java files from purchaseorder.xsd.
 * 
 * @throws MojoExecutionException
 */
public void testExecute() throws Exception {

	final File pom = new File(getBaseDir(),
	"src/test/resources/test-pom.xml");
	
       final ArtifactRepository localRepository = new DefaultArtifactRepository( "local", 
       		
       		new File(getBaseDir(), "target/test-repository").toURI().toURL().toString()        		, new DefaultRepositoryLayout());
	
	
	final MavenProject mavenProject = mavenProjectBuilder.build(pom, localRepository, null);
	

	final XJC21Mojo generator = (XJC21Mojo) lookupMojo("generate", pom);
	generator.setProject(mavenProject);
	generator.setLocalRepository(localRepository);
	generator.setSchemaDirectory(new File(getBaseDir(),"src/test/resources/"));
	generator.setSchemaIncludes(new String[] { "*.xsd" });
	generator.setBindingIncludes(new String[] { "*.xjb" });
	generator.setGenerateDirectory(new File(getBaseDir(), "target/test/generated-sources"));
	generator.setVerbose(true);
	generator.setGeneratePackage("unittest");
	generator.setRemoveOldOutput(false);
	
	generator.execute();
}
 
开发者ID:highsource,项目名称:maven-jaxb2-plugin,代码行数:32,代码来源:JAXBGenerateTest.java


示例16: testExecute

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
/**
 * Validate the generation of a java files from purchaseorder.xsd.
 * 
 * @throws MojoExecutionException
 */
public void testExecute() throws Exception {

	final File pom = new File(getBaseDir(),
	"src/test/resources/test-pom.xml");
	
       final ArtifactRepository localRepository = new DefaultArtifactRepository( "local", 
       		
       		new File(getBaseDir(), "target/test-repository").toURI().toURL().toString()        		, new DefaultRepositoryLayout());
	
	
	final MavenProject mavenProject = mavenProjectBuilder.build(pom, localRepository, null);
	

	final XJC2Mojo generator = (XJC2Mojo) lookupMojo("generate", pom);
	generator.setProject(mavenProject);
	generator.setLocalRepository(localRepository);
	generator.setSchemaDirectory(new File(getBaseDir(),"src/test/resources/"));
	generator.setSchemaIncludes(new String[] { "*.xsd" });
	generator.setBindingIncludes(new String[] { "*.xjb" });
	generator.setGenerateDirectory(new File(getBaseDir(), "target/test/generated-sources"));
	generator.setVerbose(true);
	generator.setGeneratePackage("unittest");
	generator.setRemoveOldOutput(false);
	
	generator.execute();
}
 
开发者ID:highsource,项目名称:maven-jaxb2-plugin,代码行数:32,代码来源:JAXBGenerateTest.java


示例17: setupSession

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
private VersioningState setupSession( final Properties properties, final Map<ProjectRef, String[]> versionMap )
    throws Exception
{
    final ArtifactRepository ar =
        new MavenArtifactRepository( "test", "http://repo.maven.apache.org/maven2", new DefaultRepositoryLayout(),
                                     new ArtifactRepositoryPolicy(), new ArtifactRepositoryPolicy() );

    final MavenExecutionRequest req =
        new DefaultMavenExecutionRequest().setUserProperties( properties )
                                          .setRemoteRepositories( Arrays.asList( ar ) );

    final PlexusContainer container = new DefaultPlexusContainer();

    final MavenSession mavenSession = new MavenSession( container, null, req, new DefaultMavenExecutionResult() );

    session = new ManipulationSession();
    session.setMavenSession( mavenSession );

    final VersioningState state = new VersioningState( properties );
    session.setState( state );

    final Map<String, byte[]> dataMap = new HashMap<>();
    if ( versionMap != null && !versionMap.isEmpty() )
    {
        for ( final Map.Entry<ProjectRef, String[]> entry : versionMap.entrySet() )
        {
            final String path = toMetadataPath( entry.getKey() );
            final byte[] data = setupMetadataVersions( entry.getValue() );
            dataMap.put( path, data );
        }
    }

    final Location mdLoc = MavenLocationExpander.EXPANSION_TARGET;
    final Transport mdTrans = new StubTransport( dataMap );

    modder =
        new TestVersionCalculator( new ManipulationSession(), mdLoc, mdTrans, temp.newFolder( "galley-cache" ) );

    return state;
}
 
开发者ID:release-engineering,项目名称:pom-manipulation-ext,代码行数:41,代码来源:VersioningCalculatorTest.java


示例18: writeExternal

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
static void writeExternal( PrintWriter w, Artifact artifact )
    throws IOException
{
    w.write( "CRC:" );
    File file = artifact.getFile();
    w.write( Long.toString( CreateClusterAppMojo.crcForFile( file ).getValue() ) );
    w.write( "\nSIZE:" );
    w.write( Long.toString( file.length() ) );
    w.write( "\nURL:m2:/" );
    w.write( artifact.getGroupId() );
    w.write( ':' );
    w.write( artifact.getArtifactId() );
    w.write( ':' );
    w.write( artifact.getVersion() );
    w.write( ':' );
    w.write( artifact.getType() );
    if ( artifact.getClassifier() != null )
    {
        w.write( ':' );
        w.write( artifact.getClassifier() );
    }
    w.write( "\nURL:" );
    // artifact.repository is null, so cannot use its url, and anyway might be a mirror
    w.write( /* M3: RepositorySystem.DEFAULT_REMOTE_REPO_URL + '/' */ "http://repo.maven.apache.org/maven2/" );
    w.write( new DefaultRepositoryLayout().pathOf( artifact ) );
    w.write( '\n' );
    w.flush();
}
 
开发者ID:bitstrings,项目名称:nbm-maven,代码行数:29,代码来源:CreateNetBeansFileStructure.java


示例19: LegacyLocalRepositoryManager

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的package包/类
private LegacyLocalRepositoryManager( ArtifactRepository delegate )
{
    if ( delegate == null )
    {
        throw new IllegalArgumentException( "local repository delegate missing" );
    }
    this.delegate = delegate;

    ArtifactRepositoryLayout layout = delegate.getLayout();
    repo =
        new LocalRepository( new File( delegate.getBasedir() ),
                             ( layout != null ) ? layout.getClass().getSimpleName() : "legacy" );

    /*
     * NOTE: "invoker:install" vs "appassembler:assemble": Both mojos use the artifact installer to put an artifact
     * into a repository. In the first case, the result needs to be a proper local repository that one can use for
     * local artifact resolution. In the second case, the result needs to precisely obey the path information of the
     * repository's layout to allow pointing at artifacts within the repository. Unfortunately,
     * DefaultRepositoryLayout does not correctly describe the layout of a local repository which unlike a remote
     * repository never uses timestamps in the filename of a snapshot artifact. The discrepancy gets notable when a
     * remotely resolved snapshot artifact gets passed into pathOf(). So producing a proper local artifact path
     * using DefaultRepositoryLayout requires us to enforce usage of the artifact's base version. This
     * transformation however contradicts the other use case of precisely obeying the repository's layout. The below
     * flag tries to detect which use case applies to make both plugins happy.
     */
    realLocalRepo = ( layout instanceof DefaultRepositoryLayout ) && "local".equals( delegate.getId() );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:28,代码来源:LegacyLocalRepositoryManager.java


示例20: buildPom

import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; //导入依赖的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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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