Package org.guvnor.common.services.project.model

Examples of org.guvnor.common.services.project.model.GAV


        return null;
    }

    public String uploadFile( FormData uploadItem ) throws IOException {
        InputStream fileData = uploadItem.getFile().getInputStream();
        GAV gav = uploadItem.getGav();

        try {
            if ( gav == null ) {
                if ( !fileData.markSupported() ) {
                    fileData = new BufferedInputStream( fileData );
                }

                fileData.mark( fileData.available() ); // is available() safe?

                String pomContent = GuvnorM2Repository.loadPOMFromJar(fileData);
                PomModel pomModel = null;
                if ( pomContent != null ) {
                    pomModel = PomModel.Parser.parse("pom.xml", new ByteArrayInputStream(pomContent.getBytes()));
                }

                if ( pomModel != null ) {

                    String groupId = pomModel.getReleaseId().getGroupId();
                    String artifactId = pomModel.getReleaseId().getArtifactId();
                    String version = pomModel.getReleaseId().getVersion();

                    if (isNullOrEmpty(groupId) || isNullOrEmpty(artifactId) || isNullOrEmpty(version)) {
                        return NO_VALID_POM;
                    } else {
                        gav = new GAV(groupId, artifactId, version);
                    }

                } else {
                    return NO_VALID_POM;
                }
View Full Code Here


        Model model = new MavenXpp3Reader().read( new StringReader( pomAsString ) );

        POM gavModel = new POM(
                model.getName(),
                model.getDescription(),
                new GAV(
                        ( model.getGroupId() == null ? model.getParent().getGroupId() : model.getGroupId() ),
                        ( model.getArtifactId() == null ? model.getParent().getArtifactId() : model.getArtifactId() ),
                        ( model.getVersion() == null ? model.getParent().getVersion() : model.getVersion() )
                )
        );
View Full Code Here

        URL url = this.getClass().getResource( "/GuvnorM2RepoDependencyExample1" );
        SimpleFileSystemProvider p = new SimpleFileSystemProvider();
        org.uberfire.java.nio.file.Path path = p.getPath( url.toURI() );

        final Builder builder = new Builder( path,
                                             new GAV(),
                                             ioService,
                                             projectService,
                                             new ArrayList<BuildValidationHelper>() );

        final BuildResults results = builder.build();
View Full Code Here

        URL url = this.getClass().getResource( "/GuvnorM2RepoDependencyExample2" );
        SimpleFileSystemProvider p = new SimpleFileSystemProvider();
        org.uberfire.java.nio.file.Path path = p.getPath( url.toURI() );

        final Builder builder = new Builder( path,
                                             new GAV(),
                                             ioService,
                                             projectService,
                                             new ArrayList<BuildValidationHelper>() );

        final BuildResults results = builder.build();
View Full Code Here

        URL url = this.getClass().getResource( "/GuvnorM2RepoDependencyExample2Snapshot" );
        SimpleFileSystemProvider p = new SimpleFileSystemProvider();
        org.uberfire.java.nio.file.Path path = p.getPath( url.toURI() );

        final Builder builder = new Builder( path,
                                             new GAV(),
                                             ioService,
                                             projectService,
                                             new ArrayList<BuildValidationHelper>() );

        final BuildResults results = builder.build();
View Full Code Here

        URL url = this.getClass().getResource( "/GuvnorM2RepoDependencyExample2" );
        SimpleFileSystemProvider p = new SimpleFileSystemProvider();
        org.uberfire.java.nio.file.Path path = p.getPath( url.toURI() );

        final Builder builder = new Builder( path,
                                             new GAV(),
                                             ioService,
                                             projectService,
                                             new ArrayList<BuildValidationHelper>() );

        final BuildResults results = builder.build();
View Full Code Here

        URL url = this.getClass().getResource( "/ExampleWithExcel" );
        SimpleFileSystemProvider p = new SimpleFileSystemProvider();
        org.uberfire.java.nio.file.Path path = p.getPath( url.toURI() );

        final Builder builder = new Builder( path,
                                             new GAV(),
                                             ioService,
                                             projectService,
                                             new ArrayList<BuildValidationHelper>() );

        final BuildResults results = builder.build();
View Full Code Here

                                                                                                cc );

        String m2RepoURL = m2RepoService.getRepositoryURL( null );

        //Deploy a 1.0 version of guvnor-m2repo-dependency-example1-snapshot kjar
        GAV gav = new GAV( "org.kie.workbench.common.services.builder.tests",
                           "dependency-test1",
                           "1.0" );

        InputStream is = this.getClass().getResourceAsStream( "/dependency-test1-1.0.jar" );
        m2RepoService.deployJarInternal( is,
                                         gav );

        //Deploy a SNAPSHOT version of guvnor-m2repo-dependency-example1-snapshot kjar
        GAV gav2 = new GAV( "org.kie.workbench.common.services.builder.tests",
                            "dependency-test1-snapshot",
                            "1.0-SNAPSHOT" );

        InputStream is2 = this.getClass().getResourceAsStream( "/dependency-test1-snapshot-1.0-SNAPSHOT.jar" );
        m2RepoService.deployJarInternal( is2,
View Full Code Here

        System.out.println( "  Module migration ended" );
    }

    private void migrate( Module jcrModule ) {
        //Set up project structure:
        GAV gav = new GAV(jcrModule.getName(),
                          jcrModule.getName(),
                          "0.0.1");
        POM pom = new POM(gav);

        Path modulePath = migrationPathManager.generateRootPath();
View Full Code Here

    @Ignore("Fails - ignored for Beta3")
    public void testDeployArtifact() throws Exception {
        GuvnorM2Repository repo = new GuvnorM2Repository();
        repo.init();

        GAV gav = new GAV( "org.kie.guvnor",
                           "guvnor-m2repo-editor-backend",
                           "0.0.1-SNAPSHOT" );

        InputStream is = this.getClass().getResourceAsStream( "guvnor-m2repo-editor-backend-test.jar" );
        repo.deployArtifact( is,
View Full Code Here

TOP

Related Classes of org.guvnor.common.services.project.model.GAV

Copyright © 2018 www.massapicom. 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.