smh/grunt-maven-tasks — pull request #4 by scottydawg (2013-07-17 17:04:28+00:00)
Title: Support multiple release and deploy targets for a single build

Note: these are breaking changes.

These changes allow the release or deployment of multiple artifacts by allowing multiple user-defined build targets. For example, a JavaScript project that creates both Node and browser artifacts can deploy and release both of those artifacts with these changes.

This requires changes to the way that users configure the maven task. A configuration in 1.0.2 that looks like this:

```js
grunt.initConfig({
maven: {
options: {
groupId: 'com.example'
},
deploy: {
options: { url: '' },
files: [ { src: [ '**', '!node_modules/**' ] } ]
},
release: {
options: { url: '' },
files: [ { src: [ '**', '!node_modules/**' ] } ]
},
},
})
```
would need to be changed to:

```js
grunt.initConfig({
maven: {
options: {
groupId: 'com.example'
},
deploy: {
options: { goal: 'deploy', url: '' },
src: [ '**', '!node_modules/**' ]
},
release: {
options: { goal: 'release', url: '' },
src: [ '**', '!node_modules/**' ]
},
},
})
```
The target names ('deploy' and 'release') could be any user-defined value, and any number of targets may be created:

```js
grunt.initConfig({
maven: {
options: {
groupId: 'com.example'
},
deployNodeArtifact: {
options: { goal: 'deploy', artifactId: 'myNodeLib', url: '' },
src: [ 'target/node/**', '!target/node/node_modules/**' ]
},
deployBrowserArtifact: {
options: { goal: 'deploy', artifactId: 'myBrowserLib', url: ''},
src: [ 'target/browser/**' ]
}
},
})
```