Search in sources :

Example 1 with LegacyRepositoryLayout

use of org.apache.maven.artifact.repository.layout.LegacyRepositoryLayout in project felix by apache.

the class AbstractBundlePluginTest method getMavenProjectStub.

protected MavenProjectStub getMavenProjectStub() {
    MavenProjectStub project = new MavenProjectStub();
    project.setGroupId("group");
    project.setArtifactId("project");
    project.setVersion("1.2.3.4");
    VersionRange versionRange = VersionRange.createFromVersion(project.getVersion());
    ArtifactHandler artifactHandler = new DefaultArtifactHandler("pom");
    Artifact artifact = new DefaultArtifact(project.getGroupId(), project.getArtifactId(), versionRange, null, "pom", null, artifactHandler);
    artifact.setResolved(true);
    project.setArtifact(artifact);
    ProjectBuilderConfiguration projectBuilderConfiguration = new DefaultProjectBuilderConfiguration();
    ArtifactRepositoryLayout layout = new LegacyRepositoryLayout();
    ArtifactRepository artifactRepository = new DefaultArtifactRepository("scratch", new File(getBasedir(), "target" + File.separatorChar + "scratch").toURI().toString(), layout);
    projectBuilderConfiguration.setLocalRepository(artifactRepository);
    project.setProjectBuilderConfiguration(projectBuilderConfiguration);
    return project;
}
Also used : ArtifactRepositoryLayout(org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout) DefaultProjectBuilderConfiguration(org.apache.maven.project.DefaultProjectBuilderConfiguration) DefaultArtifactRepository(org.apache.maven.artifact.repository.DefaultArtifactRepository) LegacyRepositoryLayout(org.apache.maven.artifact.repository.layout.LegacyRepositoryLayout) VersionRange(org.apache.maven.artifact.versioning.VersionRange) DefaultArtifactRepository(org.apache.maven.artifact.repository.DefaultArtifactRepository) ArtifactRepository(org.apache.maven.artifact.repository.ArtifactRepository) DefaultArtifact(org.apache.maven.artifact.DefaultArtifact) Artifact(org.apache.maven.artifact.Artifact) ProjectBuilderConfiguration(org.apache.maven.project.ProjectBuilderConfiguration) DefaultProjectBuilderConfiguration(org.apache.maven.project.DefaultProjectBuilderConfiguration) DefaultArtifactHandler(org.apache.maven.artifact.handler.DefaultArtifactHandler) ArtifactHandler(org.apache.maven.artifact.handler.ArtifactHandler) MavenProjectStub(org.apache.maven.plugin.testing.stubs.MavenProjectStub) DefaultArtifactHandler(org.apache.maven.artifact.handler.DefaultArtifactHandler) File(java.io.File) DefaultArtifact(org.apache.maven.artifact.DefaultArtifact)

Aggregations

File (java.io.File)1 Artifact (org.apache.maven.artifact.Artifact)1 DefaultArtifact (org.apache.maven.artifact.DefaultArtifact)1 ArtifactHandler (org.apache.maven.artifact.handler.ArtifactHandler)1 DefaultArtifactHandler (org.apache.maven.artifact.handler.DefaultArtifactHandler)1 ArtifactRepository (org.apache.maven.artifact.repository.ArtifactRepository)1 DefaultArtifactRepository (org.apache.maven.artifact.repository.DefaultArtifactRepository)1 ArtifactRepositoryLayout (org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout)1 LegacyRepositoryLayout (org.apache.maven.artifact.repository.layout.LegacyRepositoryLayout)1 VersionRange (org.apache.maven.artifact.versioning.VersionRange)1 MavenProjectStub (org.apache.maven.plugin.testing.stubs.MavenProjectStub)1 DefaultProjectBuilderConfiguration (org.apache.maven.project.DefaultProjectBuilderConfiguration)1 ProjectBuilderConfiguration (org.apache.maven.project.ProjectBuilderConfiguration)1