Examples of MavenPom


Examples of com.hascode.tutorial.xbeam.projection.MavenPom

import com.hascode.tutorial.xbeam.projection.MavenPom;

public class MavenPomParsing {
  public static void main(final String[] args) throws IOException {
    MavenPom pom = new XBProjector().io().fromURLAnnotation(MavenPom.class);
    System.out.println("Project: " + pom.project().artifactId() + ":" + pom.project().groupId() + ":" + pom.project().version());
    pom.dependencies().forEach(dep -> {
      System.out.println("-dependency -> " + dep.artifactId() + ":" + dep.groupId() + ":" + dep.version());
    });
    System.out.println("updating project version to 1.2.3..");
    pom.project().version("1.2.3");

    Path path = FileSystems.getDefault().getPath("/tmp", "changed.xml");
    System.out.println("writing pom to file: " + path);
    new XBProjector().io().file(path.toFile()).write(pom);
    Files.readAllLines(path).forEach(System.out::println);
View Full Code Here

Examples of org.gradle.api.artifacts.maven.MavenPom

    public MavenPom addFilter(String name, PublishFilter publishFilter) {
        if (name == null || publishFilter == null) {
            throw new InvalidUserDataException("Name and Filter must not be null.");
        }
        MavenPom pom = mavenPomFactory.create();
        pomFilters.put(name, new DefaultPomFilter(name, pom, publishFilter));
        return pom;
    }
View Full Code Here

Examples of org.gradle.api.artifacts.maven.MavenPom

    }


    @Test
    public void addFilter() {
        MavenPom pom = pomFilterContainer.addFilter(TEST_NAME, publishFilterMock);
        assertSame(pom, pomMock);
        assertSame(pomMock, pomFilterContainer.pom(TEST_NAME));
        assertSame(publishFilterMock, pomFilterContainer.filter(TEST_NAME));
    }
View Full Code Here

Examples of org.gradle.api.artifacts.maven.MavenPom

        return new DefaultArtifact(ModuleRevisionId.newInstance("org", name, "1.0"), null, name, type, type, extraAttributes);
    }

    @Test
    public void writePom() {
        final MavenPom mavenPomMock = context.mock(MavenPom.class);
        DefaultArtifactPom artifactPom = new DefaultArtifactPom(mavenPomMock);
        final File somePomFile = new File(tmpDir.getDir(), "someDir/somePath");
        context.checking(new Expectations() {{
            allowing(mavenPomMock).getArtifactId();
            will(returnValue("artifactId"));
View Full Code Here

Examples of org.gradle.api.artifacts.maven.MavenPom

        return new DefaultArtifact(IvyUtil.createModuleRevisionId("org", name, "1.0"), null, name, type, type, extraAttributes);
    }

    @Test
    public void writePom() {
        final MavenPom mavenPomMock = context.mock(MavenPom.class);
        DefaultArtifactPom artifactPom = new DefaultArtifactPom(mavenPomMock);
        final File somePomFile = new File(tmpDir.getTestDirectory(), "someDir/somePath");
        context.checking(new Expectations() {{
            allowing(mavenPomMock).getArtifactId();
            will(returnValue("artifactId"));
View Full Code Here

Examples of org.gradle.api.artifacts.maven.MavenPom

                }

                ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration();
                ModuleInternal module = configuration.getModule();
                for (MavenResolver resolver : uploadArchives.getRepositories().withType(MavenResolver.class)) {
                    MavenPom pom = resolver.getPom();
                    ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier(
                            pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID) ? module.getGroup() : pom.getGroupId(),
                            pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID) ? module.getName() : pom.getArtifactId(),
                            pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION) ? module.getVersion() : pom.getVersion()
                    );
                    publicationRegistry.registerPublication(project.getPath(), new DefaultProjectPublication(publicationId));
                }
            }
        });
View Full Code Here

Examples of org.gradle.api.artifacts.maven.MavenPom

    }


    @Test
    public void addFilter() {
        MavenPom pom = pomFilterContainer.addFilter(TEST_NAME, publishFilterMock);
        assertSame(pom, pomMock);
        assertSame(pomMock, pomFilterContainer.pom(TEST_NAME));
        assertSame(publishFilterMock, pomFilterContainer.filter(TEST_NAME));
    }
View Full Code Here

Examples of org.gradle.api.artifacts.maven.MavenPom

     */
    public MavenPom pom(Closure configureClosure) {
        Factory<MavenPom> pomFactory = mavenFactory.createMavenPomFactory(project.getConfigurations(),
                conf2ScopeMappings.getMappings(),
                project.getFileResolver());
        MavenPom pom = pomFactory.create();
        pom.setGroupId(project.getGroup().toString());
        pom.setArtifactId(project.getName());
        pom.setVersion(project.getVersion().toString());
        return ConfigureUtil.configure(configureClosure, pom);
    }
View Full Code Here

Examples of org.gradle.api.artifacts.maven.MavenPom

    public MavenPom addFilter(String name, PublishFilter publishFilter) {
        if (name == null || publishFilter == null) {
            throw new InvalidUserDataException("Name and Filter must not be null.");
        }
        MavenPom pom = mavenPomFactory.create();
        pomFilters.put(name, new DefaultPomFilter(name, pom, publishFilter));
        return pom;
    }
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.