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 🙏

© 2026 – Pkg Stats / Ryan Hefner

grunt-maven

v1.2.0

Published

Grunt tasks for grunt-maven-plugin Maven+Grunt workflow.

Readme

grunt-maven

npm tasks for grunt-maven-plugin.

grunt-maven-plugin NPM tasks power Maven+Grunt integrated workflow. These tasks depend on properties file produced by grunt-maven-plugin, which contains paths and options derived from projects pom.xml.

Getting started

Add plugin dependency to your package.json:

"devDependencies": {
  "grunt-maven": "~1.1.0",
}

Load tasks in Gruntfile:

grunt.loadNpmTasks('grunt-maven');

mavenPrepare task

Overview

This tasks role is to copy raw sources from Maven webapp sources to target-grunt, where Grunt tasks will be executed. In your project's Gruntfile, add a section named mavenPrepare to the data object passed into grunt.initConfig().

grunt.initConfig({
  mavenPrepare: {
    options: {
      resources: ['**']
    },
    dev: {
    },
    prod: {
      resources: ['**', '!dev/**']
    }
  },
});

Options

options.resources

Type: Array

List of patterns that will be evaluated using minimatch to choose resources that will be copied from Maven webapp to target-grunt.

mavenDist task

Overview

mavenDist task copies artifacts produced by Grunt (less -> css, minified JS) from target-grunt to target-grunt/dist and from target-grunt to Maven WAR directory.

grunt.initConfig({
  mavenDist: {
    options: {
      warName: 'war',
      deliverables: ['**', '!non-deliverable.js'],
      gruntDistDir: 'dist'
    },
    dev: {
      warName: 'war-dev'
    }
  },
});

Options

options.warName

Type: String

Name of WAR directory, residing in /target/, to which all deliverables will be copied.

options.deliverables

Type: Array

List of patterns that will be evaluated using minimatch to choose deliverables that will be copied from target-grunt/ to target-grunt/dist and to WAR.

options.workingDirectory

Type: String Default: Directory where gruntfile is located

Deliverable patterns will be matched relative to this path, and all returned filepaths will also be relative to this path.

options.gruntDistDir

Type: String Default: dist

Name of directory residing in target-grunt, where all deliverables will be copied.

Using maven* tasks

Each defined task that wants to operate on resources from Maven, should start with mavenPrepare and end with mavenDist, for example:

grunt.registerTask('default', ['mavenPrepare', 'jshint', 'karma', 'less', 'uglify', 'mavenDist']);
  • prepare environment in target-grunt
  • run all Grunt specific tasks in target-grunt
  • copy deliverables to WAR

watch

Using grunt-contrib-watch can be very useful to create good development environment, just register whatever task you should need to run on resources change, using properties generated by grunt-maven-plugin to obtain watch path:

grunt.initConfig({
    gruntMavenProperties: grunt.file.readJSON('grunt-maven.json'),

    watch: {
        maven: {
            files: ['<%= gruntMavenProperties.filesToWatch %>'],
            tasks: 'default'
        }
    }
});

gruntMavenProperties.filesToWatch evaluates to /src/main/webapp/statics_dir/**. If you need to exclude some resources from being watched (although you probably shouldn't need to), use gruntMavenProperties.directoryToWatch. This is simply path to directory without globing pattern appended, in our case: /src/main/webapp/statics_dir.

License

grunt-maven-plugin NPM tasks are published under Apache License 2.0.