Examples of ParsedPomFile


Examples of org.jboss.shrinkwrap.resolver.api.maven.pom.ParsedPomFile

    @Test
    public void testParsedPomFile() {
        PomEquippedResolveStage resolver = Maven.resolver().loadPomFromFile("target/poms/test-resources.xml");

        ParsedPomFile pom = ((MavenWorkingSessionContainer) resolver).getMavenWorkingSession().getParsedPomFile();

        Assert.assertTrue("Project resources are not null nor empty", pom.getResources() != null
                && !pom.getResources().isEmpty());

        Assert.assertTrue("Project test resources are not null nor empty", pom.getTestResources() != null
                && !pom.getTestResources().isEmpty());
    }
View Full Code Here

Examples of org.jboss.shrinkwrap.resolver.api.maven.pom.ParsedPomFile

    @Override
    public WarPackagingProcessor importBuildOutput(MavenResolutionStrategy strategy) throws IllegalArgumentException,
        UnsupportedOperationException {

        final ParsedPomFile pomFile = session.getParsedPomFile();

        // add source files if any
        if (Validate.isReadable(pomFile.getSourceDirectory())) {
            compile(pomFile.getSourceDirectory(), pomFile.getBuildOutputDirectory(), ScopeType.COMPILE, ScopeType.IMPORT,
                ScopeType.PROVIDED, ScopeType.RUNTIME, ScopeType.SYSTEM);

            JavaArchive classes = ShrinkWrap.create(ExplodedImporter.class, "sources.jar")
                .importDirectory(pomFile.getBuildOutputDirectory()).as(JavaArchive.class);

            archive = archive.merge(classes, "WEB-INF/classes");
        }

        // add resources
        for (Resource resource : pomFile.getResources()) {
            archive.addAsResource(resource.getSource(), resource.getTargetPath());
        }

        WarPluginConfiguration warConfiguration = new WarPluginConfiguration(pomFile);
        if (Validate.isReadable(warConfiguration.getWarSourceDirectory())) {
View Full Code Here

Examples of org.jboss.shrinkwrap.resolver.api.maven.pom.ParsedPomFile

    @Override
    public JarPackagingProcessor importBuildOutput(MavenResolutionStrategy strategy) throws ResolutionException,
        IllegalArgumentException, UnsupportedOperationException {

        final ParsedPomFile pomFile = session.getParsedPomFile();

        // add source filed if any
        if (Validate.isReadable(pomFile.getSourceDirectory())) {
            compile(pomFile.getSourceDirectory(), pomFile.getBuildOutputDirectory(), ScopeType.COMPILE, ScopeType.IMPORT,
                ScopeType.PROVIDED, ScopeType.RUNTIME, ScopeType.SYSTEM);

            JavaArchive classes = ShrinkWrap.create(ExplodedImporter.class, "sources.jar")
                .importDirectory(pomFile.getBuildOutputDirectory()).as(JavaArchive.class);

            archive = archive.merge(classes);
        }

        JarPluginConfiguration jarConfiguration = new JarPluginConfiguration(pomFile);

        // add resources
        for (Resource resource : pomFile.getResources()) {
            archive.addAsResource(resource.getSource(), resource.getTargetPath());
        }

        // set manifest
        Manifest manifest = jarConfiguration.getArchiveConfiguration().asManifest();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.