GithubHelp home page GithubHelp logo

nxrm3-maven-plugin's Introduction

NXRM3 Maven Plugin

Maven Central

This plugin handles Nexus Repository Manager 3 operations for Maven projects.

Example configuration

The basic build configuration requires a url (nexusUrl), repository to deploy (repository) and a server (serverId).

      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nxrm3-maven-plugin</artifactId>
        <version><!-- choose a version --></version>
        <extensions>true</extensions>
        <configuration>
          <nexusUrl>http://localhost:8081</nexusUrl>
          
          <!-- The server "id" element from settings to use authentication from settings.xml-->
          <serverId>local-nexus</serverId>
         
          <!-- Which repository to deploy to -->
          <repository>maven-releases</repository>
          
          <!-- Skip the staging deploy mojo -->
          <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
        </configuration>
      </plugin>

To override the default deploy goal add the following to the plugin. This can be used if more control is desired over when the plugins deploy goal is activated.

        <executions>
          <execution>
            <id>default-deploy</id>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>

Staging

Example staging usage

The plugin allows a tag to be specified via -Dtag or as a parameter in the plugin configuration in the pom file.

e.g. mvn install nxrm3:staging-deploy -Dtag=test or

<plugin>
    ...
    <configuration>
      ...
      <tag>...</tag>
       ...

If no tag is specified, one will be generated in the format:

<artifactId>-<version>-<timestamp>

e.g. myproject-1.5.7-1550242817039

Performing a staging move

The plugin currently provides a means for performing a move of artifacts. The move is performed by conducting a search in a repository for all artifacts tagged with a defined tag. The move operation has three configuration properties, tag, sourceRepository, and destinationRepository.

The tag can be specified via -Dtag or the plugin configuration in the pom file. If a tag has not been specified, the plugin will attempt to find a tag previously used (and stored) in the target directory of project's the build.

sourceRepository is an optional configuration property which can be specified via -DsourceRepository or the plugin configuration in the pom file.

NOTE: If the source repository property is not specified, the plugin will default to the repository property in the plugin configuration in the pom file.

The target repository is a required configuration property specified via -DdestinationRepository or within the plugin configuration in the pom file.

Staging Move Usage Example

e.g. mvn nxrm3:staging-move -Dtag=build-123 -DsourceRepository=maven-dev -DdestinationRepository=maven-qa

<plugin>
    ...
    <configuration>
      ...
      <!--Optional configuration -->
      <sourceRepository>...</sourceRepository>
       ...
       
      <!--Required configuration -->
      <destinationRepository>...</destinationRepository>
        ...
        
      <tag>...</tag>

Performing a staging delete

The plugin provides a means for performing a delete of tagged artifacts. The delete operates in a similar way to the move operation whereby it performs a search for all artifacts with the specified tag. The delete operation makes use of a single property tag and operates as described in Example staging usage

Staging Delete Usage Example

mvn nxrm3:staging-delete -Dtag=build-123

Note: Delete searches all repositories for tagged assets.

Mutation testing

Run mvn -DwithHistory org.pitest:pitest-maven:mutationCoverage to calculate mutation coverage. This needs to be run from inside the maven-plugin directory rather than at the root of the project to detect the tests.

Integration testing

To run the integration tests against a docker instance specify the port you would like the tests to run on:

-Dnexus.it.port=8085

e.g. mvn clean install -Dnexus.it.port=8085

To run the integration tests against a local instance use the profile local-nexus3

e.g. mvn clean install -Plocal-nexus3

Getting Help

Looking to contribute or need some help?

nxrm3-maven-plugin's People

Contributors

parulkundra avatar sirmaster avatar doddi avatar sonatype-zion avatar jeremybryan avatar j-s-3 avatar nmcafee avatar mickoallen avatar wwannemacher avatar bhamail avatar hboutemy avatar stephenc 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.