GithubHelp home page GithubHelp logo

zaplatynski / archive-packagetype Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 16 KB

A Maven archive package type to create an archive like zip or tar.gz as primary artifact

Home Page: https://zaplatynski.github.io/archive-packagetype/

License: Apache License 2.0

maven maven-plugin zip targz assembly packaging

archive-packagetype's Introduction

Maven Archive Package Type Build Status Maven Central

A Maven archive package type to create an archive like zip or tar.gz. I made this because I didn't want to use the built-in jar packagetype if I only wanted to have a zip created.

How to use

In your pom.xml add this:

<project>

    <groupId>my-group</groupId>
    <artifactId>my-archive-artifact</artifactId>
    <version>1.2.3</version>
    
    <!-- NEW: make only a archive file -->
    <packaging>archive</packaging>

    ...
    <build>
    
        <plugins>
            
            <!-- make new archive package type available to Maven -->
            <plugin>
                <groupId>com.github.zaplatynski</groupId>
                <artifactId>archive-packagetype</artifactId>
                <version>1.0.0</version>
                <!-- this is important when extending core Maven functionality: -->
                <extensions>true</extensions>
            </plugin>
            
            <!-- define how the archive file look like -->
             <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptors>
                        <descriptor>src/assembly/archive.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>
            
        </plugins>    
        ...
    </build>
</project>

Inside the above mentioned archive.xml you need to specify the [Maven assembly plugin] (http://maven.apache.org/plugins/maven-assembly-plugin/) descriptor to create a typical archive file layout for example:

<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
    <id>myZip</id>
    <formats>
        <format>zip</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <fileSets>
        <fileSet>
            <directory>src/main/resources</directory>
            <outputDirectory></outputDirectory>
        </fileSet>
    </fileSets>
</assembly>

See the Maven assembly plugin documentation for more information.

Build

mvn clean install

archive-packagetype's People

Contributors

zaplatynski avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.