Search in sources :

Example 56 with Project

use of org.commonjava.maven.ext.common.model.Project in project pom-manipulation-ext by release-engineering.

the class ProjectInheritanceTest method testVerifyRelativeExecutionRoot.

@Test
public void testVerifyRelativeExecutionRoot() throws Exception {
    final File projectRoot = new File(System.getProperty("user.dir") + "/pom.xml");
    Path root = Paths.get(projectRoot.getParent());
    Path absolute = Paths.get(projectRoot.toString());
    Path relative = root.relativize(absolute);
    PomIO pomIO = new PomIO();
    List<Project> projects = pomIO.parseProject(relative.toFile());
    assertTrue(projects.size() == 1);
    assertTrue(projects.get(0).isExecutionRoot());
}
Also used : Path(java.nio.file.Path) Project(org.commonjava.maven.ext.common.model.Project) File(java.io.File) PomIO(org.commonjava.maven.ext.io.PomIO) Test(org.junit.Test)

Aggregations

Project (org.commonjava.maven.ext.common.model.Project)56 Model (org.apache.maven.model.Model)27 Test (org.junit.Test)25 HashSet (java.util.HashSet)21 File (java.io.File)19 HashMap (java.util.HashMap)11 ManipulationSession (org.commonjava.maven.ext.core.ManipulationSession)9 Profile (org.apache.maven.model.Profile)7 ManipulationException (org.commonjava.maven.ext.common.ManipulationException)7 PomIO (org.commonjava.maven.ext.io.PomIO)7 ArrayList (java.util.ArrayList)6 Properties (java.util.Properties)6 ArtifactRef (org.commonjava.maven.atlas.ident.ref.ArtifactRef)6 ProjectVersionRef (org.commonjava.maven.atlas.ident.ref.ProjectVersionRef)6 Map (java.util.Map)5 Dependency (org.apache.maven.model.Dependency)5 SimpleProjectVersionRef (org.commonjava.maven.atlas.ident.ref.SimpleProjectVersionRef)5 SimpleArtifactRef (org.commonjava.maven.atlas.ident.ref.SimpleArtifactRef)4 DependencyState (org.commonjava.maven.ext.core.state.DependencyState)4 IOException (java.io.IOException)3