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

mvn-tag-push

v0.0.1

Published

Toolchain for a save git tag and push for Maven projects.

Downloads

4

Readme

mvn-tag-push

Small Toolchain for tagging and pushing safely for Maven projects. On top of grunt-bump.

Getting Started

This plugin requires Grunt.

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install mvn-tag-push -g

Now you can bootstrap the needed things in your maven project:

mvn-tag-push-setup

package.json and Gruntfile.js are created, run

npm install

and you're good to go.

Motivation

I work in a coperate environment where i have to tag in order to deploy to a test instance. So I often messed up versions, because my tests where not clean an so on. I was tired of the repetitive steps i had to follow (and remember) in order to deploy. So I wanted to automate some things.

Features

  • executes mvn install before any changes/tagging
  • if mvn install fails, no tag is created, no version is changed
  • able to execute any grunt task in advance to check/do project specific things
  • grunt-bump handles semantic versioning
  • bump arguments (major, minor, patch etc) are passed to grunt bump, prerelease as default
    • bump changes the version in package.json, commits, tags and pushes the changes including the newly created tag
  • does not change the pom version currently

Usage

mvn-tag-push-setup

Used to create a preconfigrued package.json with all dependencies and a Gruntfile.js which calls the module to define the tasks and the workflow

Options

mvn-tag-push-setup --version 0.1.0 --name my-awesome-project

| Argument | Alias | Description | | ------------- |:-------------:|:-----| | --version | -v | Initial Version. default: 1.0.0 | | --name | -n | Name of the Project in package.json default: dirname |

Grunt

Gruntfile.js

Default Gruntfile, as created by mvn-tag-push-setup is:

var fs = require('fs');

var mvnTagPush = require('mvn-tag-push')

module.exports = function(grunt, preRunTask) {

    mvnTagPush(grunt);
}

The Grunt instance is passed to the plugin to define the tasks.

Task: release

grunt release

executes mvn install, bumps version with grunt-bump prerelease, tags, pushes All version modifiers grunt-bump offers are supported.

Further Examples:

grunt release:patch
grunt release:major
grunt release:premajor
.
.
.

See grunt-bump docs for full list.

Task: push

grunt push

Just executes mvn install and pushes.

preRunTask

Plugin is able to run any grunt task before doing its work:

var fs = require('fs');

var mvnTagPush = require('mvn-tag-push')

module.exports = function(grunt) {

    grunt.registerTask('my-pre-task', function() {
		console.log("pretask executed")
	});

    mvnTagPush(grunt, 'my-pre-task');

}

Taskname is passed as second argument to mvn-tag-push. Pretask is only executed on task release

To-Do

  • Maybe convert to proper grunt-task
  • Port to gulp
  • Ability to pass config to underlying modules (e.g. grunt bump)