npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@auto-it/maven

v11.3.0

Published

Maven publishing plugin for auto

Downloads

2,599

Readme

Maven Plugin

Release a Java project to a maven repository.

Installation

This plugin is not included with the auto CLI installed via NPM. To install:

npm i --save-dev @auto-it/maven
# or
yarn add -D @auto-it/maven

WARNING: You can only use one "package manager" at a time! Mixing them will lead to undesired results.

Usage

This plugin makes recursive changes to all pom.xml files in the project, with the following assumptions: a. The project is a multi-module project. b. The parent pom.xml file is located in the root directory of the repo. c. The parent pom.xml contains the version. d. Sub-modules have the same version as the parent pom.xml.

auto will detect if the parent pom.xml file has the versions-maven-plugin configured, and if so, use it to set the version on the parent and all child pom.xml files. If not, then auto will modify the parent and all child pom.xml files using a DOM parser and XML serializer. This has the effect of losing formatting. Therefore it then runs the serialized XML through the prettier "html" pretty-printer.

This means that if the versions-maven-plugin isn't available, the pom.xml files will be pretty-printed using prettier formatter with the following default settings:

  • printWidth: 120 (configurable - see below)
  • tabWidth: 4 (configurable - see below)
  • parser: "html"
{
  "plugins": [
    [
      "maven",
      {
        // An optional maven binary cmd/path
        // @default /usr/bin/mvn
        "mavenCommand": "mvn",

        // An optional maven argument list - e.g. any maven option allowed for the version
        // of maven you're using
        // @default []
        "mavenOptions": ["-DskipTests", "-P some-profile"],

        // An optional set of goals to execute for release
        // @default ["deploy", "site-deploy"]
        "mavenReleaseGoals": ["deploy"],

        // An optional path to a maven settings.xml file
        // @default ""
        "mavenSettings": "./.github/maven/settings.xml",

        // An optional printWidth for the prettier pretty-printer
        // @default 120
        "printWidth": 80,

        // An optional tabWidth for the prettier pretty-printer
        // @default 4
        "tabWidth": 4
      }
    ]
    // other plugins
  ]
}

Environment Variables

| Name | Description | Default value | | --------------------- | ---------------------------------------------------------------------------- | --------------------------- | | MAVEN_COMMAND | The Maven command to use. | /usr/bin/mvn | | MAVEN_OPTIONS | A list of maven command customizations to pass to maven. | null | | MAVEN_RELEASE_GOALS | A list of maven goals to pass to maven for release. | ["deploy", "site-deploy"] | | MAVEN_SETTINGS | The maven settings.xml file used by maven. | null | | MAVEN_USERNAME | (DEPRECATED IN 9.38.0 ) The deploy username used to login to the repository. | null | | MAVEN_PASSWORD | (DEPRECATED IN 9.38.0 ) The deploy password used to login to the repository. | null |

NOTE: The MAVEN_USERNAME and MAVEN_PASSWORD environment variables are still supported, and have their counterparts as configuration options, but should be deprecated, and will be removed in a later release. This is because MAVEN_SETTINGS or MAVEN_OPTIONS can do the same work, but provide a much more flexible solution.

Maven Project Configuration

You will need all the following configuration blocks for all parts of auto to function:

  1. Author
<developers>
    <developer>
        <name>Andrew Lisowski</name>
        <email>[email protected]</email>
    </developer>
</developers>
  1. SCM
<scm>
    <connection
  >scm:git:https://${env.GH_USER}:${env.GH_TOKEN}@github.com/${owner}/${repo}.git</connection>
    <developerConnection
  >scm:git:https://${env.GH_USER}:${env.GH_TOKEN}@github.com/${owner}/${repo}.git</developerConnection>
    <url>https://github.com/${owner}/${repo}</url>
    <tag>HEAD</tag>
</scm>

:warning: Either replace ${owner}/${repo} with the corresponding GitHub owner and repository for your project or ensure those are configured as properties within the pom.xml

  1. Versions Maven Plugin RECOMMENDED (Optional)
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>versions-maven-plugin</artifactId>
    <version>2.7</version>
</plugin>

:warning: Don't forget to set environment variables GH_USER, GH_TOKEN

  1. Version
<version>1.0.0-SNAPSHOT</version>