Package org.apache.maven.archiver

Examples of org.apache.maven.archiver.MavenArchiver.createArchive()


            }


            warArchiver.setIgnoreWebxml(false);
            MavenArchiveConfiguration archive = new MavenArchiveConfiguration();
            archiver.createArchive(session, project, archive);
        } catch (Exception e) {
            getLog().error("Error during the construction of the War file with the archiving process", e);
            throw new IOException("Cannot build the War file", e);
        }
View Full Code Here


      String groupId = project.getGroupId();
      String artifactId = project.getArtifactId();
      mavenArchiver.getArchiver().addFile(project.getFile(), "META-INF/maven/" + groupId + "/" + artifactId
              + "/pom.xml");

      mavenArchiver.createArchive(project, archive);
    } catch (Exception e) { // NOSONAR
      throw new MojoExecutionException("Failed to create the javascript archive", e);
    }
    project.getArtifact().setFile(jarFile);
View Full Code Here

        archiver.setArchiver(jarArchiver);
        archiver.setOutputFile(aarFile);
        jarArchiver.addDirectory(aarDirectory);

        // create archive
        archiver.createArchive(project, archive);

        if (classifier != null) {
            projectHelper.attachArtifact(project, "aar", classifier, aarFile);
        } else {
            Artifact artifact = project.getArtifact();
View Full Code Here

        archiver.setArchiver( jarArchiver );
        archiver.setOutputFile( marFile );
        jarArchiver.addDirectory( marDirectory );

        // create archive
        archiver.createArchive( project, archive );

        if ( classifier != null )
        {
            projectHelper.attachArtifact( project, "mar", classifier, marFile );
        }
View Full Code Here

      archive.setManifestFile(defaultManifestFile);
    }
    try {
      // we don't want Maven stuff
      archive.setAddMavenDescriptor( false );
      archiver.createArchive( project, archive );
    } catch ( ManifestException e ) {
      throw new ArchiverException( "ManifestException: " + e.getMessage(), e );
    } catch ( DependencyResolutionRequiredException e ) {
      throw new ArchiverException( "DependencyResolutionRequiredException: " + e.getMessage(), e );
    }
View Full Code Here

            if (classpath != null) {
                archive.addManifestEntry("Class-Path", getClassPath());
            }

            archiver.createArchive(project, archive);

            return archiveFile;
        }
        catch (Exception e) {
            throw new MojoExecutionException("Failed to create archive", e);
View Full Code Here

    archiver.setArchiver(jarArchiver);
    archiver.setOutputFile(jarFile);
    jarArchiver.addDirectory(outputDirectory, new String[] { "**/*.class" }, null);
    MavenArchiveConfiguration archive = new MavenArchiveConfiguration();
    try {
      archiver.createArchive(session, project, archive);
    } catch (Exception e) {
      throw new MojoExecutionException("Could not build the jar file", e);
    }

    if (jarFile.exists()) {
View Full Code Here

        else
        {
            archiver.getArchiver().addDirectory( siteDirectory, getArchiveIncludes(), getArchiveExcludes() );
        }

        archiver.createArchive( project, archive );

        return siteJar;
    }

    private String[] getArchiveIncludes()
View Full Code Here

        archiver.setArchiver( jarArchiver );
        archiver.setOutputFile( aarFile );
        jarArchiver.addDirectory( aarDirectory );

        // create archive
        archiver.createArchive( project, archive );

        if ( classifier != null )
        {
            projectHelper.attachArtifact( project, "aar", classifier, aarFile );
        }
View Full Code Here

            getLog().debug( "Excluding " + Arrays.asList( getPackagingExcludes() ) + " from the generated EAR." );
            getLog().debug( "Including " + Arrays.asList( getPackagingIncludes() ) + " in the generated EAR." );

            archiver.getArchiver().addDirectory( getWorkDirectory(), getPackagingIncludes(), getPackagingExcludes() );
            archiver.createArchive( session, getProject(), archive );

            if ( classifier != null )
            {
                projectHelper.attachArtifact( getProject(), "ear", classifier, earFile );
            }
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.