├── .gitignore
├── .travis.yml
├── LICENSE.txt
├── README.md
├── grunt-maven-logo.svg
├── pom.xml
├── project-resources
└── ci-settings.xml
└── src
├── main
├── java
│ └── pl
│ │ └── allegro
│ │ └── tdr
│ │ └── gruntmaven
│ │ ├── AbstractExecutableMojo.java
│ │ ├── BaseMavenGruntMojo.java
│ │ ├── CleanResourcesMojo.java
│ │ ├── CreateResourcesMojo.java
│ │ ├── ExecBowerMojo.java
│ │ ├── ExecGruntMojo.java
│ │ ├── ExecNpmMojo.java
│ │ ├── ExecNpmOfflineMojo.java
│ │ ├── ExecutableFactory.java
│ │ ├── archive
│ │ └── TarUtil.java
│ │ ├── executable
│ │ └── Executable.java
│ │ └── resources
│ │ ├── Filter.java
│ │ ├── Resource.java
│ │ └── ResourceCreationException.java
└── resources
│ └── grunt-maven.json
└── test
├── java
└── pl
│ └── allegro
│ └── tdr
│ └── gruntmaven
│ └── resources
│ ├── FilterTest.java
│ └── ResourceTest.java
└── resources
└── test-resource
/.gitignore:
--------------------------------------------------------------------------------
1 | .settings/
2 |
3 | .classpath
4 | .project
5 | .idea/
6 | *.iml
7 | target/
8 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | jdk:
3 | - openjdk6
4 | matrix:
5 | include:
6 | - jdk: openjdk7
7 | script: "mvn deploy --settings project-resources/ci-settings.xml"
8 |
9 | branches:
10 | only:
11 | - master
12 |
13 | env:
14 | global:
15 | - secure: "IuT3Pny92PfBMd2pZXqmWKneem57iR7rwAmozpTN2mlWnrxgFABE3tZMWDonUTDRzQaE5rplMjj+X9CR1Yo7SUOHdmz4OBhYSXteWk2hshYEJ1Y4NFEz/jSNUvMweivk56jM2Q/RmARDH9IxZ2phkEKVc5Zxraz7s7ReZgHMXUA="
16 | - secure: "H/bc1P+9TdaY7s2HL0GI7A8h7RIFNrXJ4vFhVhcQPJLZUranXIBBmWHIF2h4eHcxm5GN1TH42o8rIknF4qe/vrjt0+wqvvBMM08PVznm7neZYO8ea1Y4lStnWbbY8s1offTP2NnaJyKCnr+OG+8wltxyS6O0I5f8y7nMhCrfAZ4="
17 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright 2013 Allegro Group
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # grunt-maven-plugin
2 |
3 | ## Deprecation note
4 |
5 | > **This plugin will no longer be maintained**. I can accept pull requests with some minor improvements and release new
6 | > versions, but there will be no active development.
7 | >
8 | > It has been almost two years since we moved from Maven to Gradle in most of our projects at Allegro. Since we don't use
9 | > the plugin nor even Maven, it is impossible to notice what new features are needed as frontend tools develop.
10 | >
11 | > If you are looking for a simple replacement, try [frontend-maven-plugin](https://github.com/eirslett/frontend-maven-plugin).
12 |
13 | ---
14 |
15 |
16 | **grunt-maven-plugin** plugin allows you to integrate **Grunt** tasks into the **Maven** build process. [**Grunt**](http://gruntjs.com/) is the JavaScript task runner utility. **grunt-maven-plugin** works on both Windows and \*nix systems.
17 |
18 | **grunt-maven-plugin** comes with unique Maven+Grunt Integrated Workflow which removes all impediments present when trying to build project using two different build tools.
19 |
20 | *Version 1.5.0 requires grunt-maven NPM plugin 1.2.0 version for Integrated Workflow to work.*
21 |
22 | ## Prerequisites
23 |
24 | The only required dependency is [**nodejs**](http://nodejs.org/) with **npm**.
25 | Globally installed [**grunt-cli**](http://gruntjs.com/getting-started) is optional and preferred, but not necessary, as installing custom node modules can be problematic in some environments (ex. CI servers). Additional configuration is needed when using local **grunt-cli**.
26 |
27 | **grunt-maven-plugin** can also run `bower install` from [**bower**](http://bower.io/) to install front-end dependencies.
28 |
29 | grunt-maven-plugin is compatible with JDK 6+ and Maven 2.1+.
30 |
31 | ## Motivation
32 |
33 | **grunt-maven-plugin** came to life because I needed a good tool to integrate Maven and Grunt. By good i mean not just firing off a **grunt** process, but a tool that would respect rules from both backend (Maven) and frontend (Grunt) worlds. No *node_modules* in Maven sources, no Maven *src/main/webapp/..* paths in *Gruntfile.js*.
34 |
35 | **grunt-maven-plugin** allows you to create a usual NPM/Grunt project that could be built and understood by any Node developer, and put it somewhere inside Maven project. It can be extracted at any time and nothing should break. On the other side backend developers don't need to worry about pesky *node_modules* wandering around src/ - all dependencies, generated sources and deliverables live in dedicated **target-grunt** directory, doing this part of build the Maven way.
36 |
37 |
38 | ## Usage
39 |
40 | Add **grunt-maven-plugin** to application build process in your *pom.xml*:
41 |
42 | ```xml
43 |
44 | pl.allegro
45 | grunt-maven-plugin
46 | 1.5.0
47 |
48 |
49 | path_to_js_project
50 |
51 |
52 |
53 | --verbose
54 |
55 |
56 |
57 |
58 | http://cnpmjs.org/downloads
59 |
60 |
61 |
62 |
63 | maven-properties.json
64 |
65 |
66 |
67 |
68 |
69 |
70 | create-resources
71 | npm
72 |
73 | bower
74 | grunt
75 |
76 |
77 |
78 |
79 | ```
80 |
81 | ### Usage with local grunt-cli
82 |
83 | In order to use local **grunt-cli**, add
84 |
85 | ```xml
86 | node_modules/grunt-cli/bin/grunt
87 | true
88 | ```
89 |
90 | options to plugin configuration and add **grunt-cli** to JS project **package.json**:
91 |
92 | ```javascript
93 | {
94 | "devDependencies": {
95 | "grunt-cli": "~0.1.6",
96 | "grunt": "~0.4.2"
97 | /*...*/
98 | }
99 | }
100 | ```
101 |
102 | ### Using NPM in offline mode
103 |
104 | NPM downtimes can be painful for (some) development and (all) release builds. **grunt-maven-plugin** contains
105 | **npm-offline** goal that uses tar-ed *node_modules* instead of running `npm install` during each build.
106 |
107 | **npm-offline** flow:
108 |
109 | * extract `node_modules.tar` in `target-grunt`
110 | * run `npm-install --ignore-scripts` in case there are any dependencies to download that were not tar-ed
111 | * run `npm rebuild`
112 |
113 | If *node_modules* dir already exists in *target-grunt*, it is not overriden.
114 | Offline flow is based on [this blogpost](http://www.letscodejavascript.com/v3/blog/2014/03/the_npm_debacle).
115 |
116 | #### Why only tar, not gz?
117 |
118 | * GIT uses compression internally anyway
119 | * TAR is lightweight and easy to extract
120 | * TAR is easier to diff
121 |
122 | If there are some compelling arguments for compressing this archive, please post an issue and we might add support in future
123 | releases.
124 |
125 | #### Preparing node_modules.tar
126 |
127 | In `target-grunt`:
128 |
129 | ```
130 | rm -rf node_modules/
131 | npm install --ignore-scripts
132 | tar cf node_modules.tar node_modules/
133 | mv node_modules.tar ../src/main/webapp/static/
134 | ```
135 |
136 | ### Using linked node_modules
137 |
138 | Removed in 1.3.0 release, use **npm-offline** instead.
139 |
140 | ### Working example
141 |
142 | [Sandbox](https://github.com/kielo/grunt-maven-plugin-sandbox) project contains simple usage example. It is used to PoC/develop/test new features, so it always stays up to date with SNAPSHOT version.
143 |
144 |
145 | ## How it works?
146 |
147 | 1. JavaScript project sources from
148 |
149 | sourceDirectory/jsSourceDirectory (default: src/main/webapp/static)
150 |
151 | are copied to
152 |
153 | gruntBuildDirectory (default: target-grunt)
154 |
155 | Copied directory has to contain **package.json** and **Gruntfile.js** files
156 |
157 | 1. `npm install` is called, fetching all dependencies
158 |
159 | 1. `grunt` is run to complete the build process
160 |
161 | Because the plugin creates its own target dir, it should be added to ignored resources in SCM configuration (like .gitignore).
162 |
163 | ## grunt-maven-plugin options
164 |
165 | Plugin options available in `...` are:
166 |
167 | #### misc
168 |
169 | * **showColors** : should Grunt and npm use color output; defaults to *false*
170 | * **filteredResources** : list of files (or expressions) that will be filtered using **maven-resources-plugin** when creating resources,
171 | remember to exclude those files from integrated workflow config, as else Grunt will override filtered values
172 | * **excludedResources** : list of files (or expressions) that will be excluded when creating resources,
173 | remember to exclude those files from integrated workflow config, as else Grunt will override filtered values
174 | * **disabled** : skip execution of plugin; defaults to *false*
175 |
176 | #### environment
177 |
178 | * **gruntBuildDirectory** : path to Grunt build directory (target for Grunt); defaults to *${basedir}/target-grunt*
179 | * **sourceDirectory** : path to directory containing source JavaScript project directory; defaults to *${basedir}/src/main/webapp*
180 | * **jsSourceDirectory** : name of directory relative to *sourceDirectory*, which contents are going to be copied to *gruntBuildDirectory*; defaults to *static*
181 | * **warTargetDirectory**: name of directory relative to WAR root, where artifacts from **grunt** build will be copied; defaults to *jsSourceDirectory*, use */* for root of WAR
182 |
183 | #### node
184 |
185 | * **nodeExecutable** : name of globally available **node** executable; defaults to *node*
186 |
187 | #### npm
188 |
189 | * **npmExecutable** : name of globally available **npm** executable; defaults to *npm*
190 | * **npmEnvironmentVar** : map of environmental variables passed down to npm install command; might be useful for npm repo customization
191 | * **npmOptions** : list of custom options passed to **npm** when calling `npm install` (defaults to empty)
192 |
193 | #### offline
194 |
195 | * **npmOfflineModulesFile** : name of tar-ed **node_modules** file; defaults to *node_modules.tar*
196 | * **npmOfflineModulesFilePath** : path to **node_modules** file, relative to project basedir; defaults to *sourceDirectory/jsSourceDirectory*
197 | * **npmRebuildOptions** : list of custom options passed to **npm** when calling `npm rebuild` (defaults to empty)
198 |
199 | #### bower
200 |
201 | * **bowerExecutable** : name of globally available **bower** executable; defaults to *bower*
202 |
203 | #### grunt
204 |
205 | * **target** : name of Grunt target to run (defaults to null, default Grunt target is run)
206 | * **gruntOptions** : list of custom options passed to grunt (defaults to empty)
207 | * **ignoreTasksErrors** : ignore failing Grunt tasks errors and finish Maven build with success (ignoring 3 and 6 exit code, more on [Grunt exit codes](http://gruntjs.com/api/exit-codes))
208 | * **ignoreAllErrors** : ignore all Grunt errors and finish Maven build with success (ignoring all exit codes, more on [Grunt exit codes](http://gruntjs.com/api/exit-codes))
209 | * **gruntExecutable** : name of **grunt** executable; defaults to *grunt*
210 | * **runGruntWithNode** : if Grunt executable is a js script, it needs to be run using node, ex: `node path/to/grunt`; defaults to *false*
211 |
212 | ## Execution goals
213 |
214 | * **create-resources** : copies all files and *filteredResources* from *sourceDirectory/jsSourceDirectory* to *gruntBuildDirectory*
215 | * **npm** : executes `npm install` in target directory
216 | * **npm-offline** : reuses packed node modules instead of fetching them from npm
217 | * **bower** : executes `bower install` in target directory
218 | * **grunt** : executes Grunt in target directory
219 | * **clean** : deletes *gruntBuildDirectory*
220 |
221 | ## Maven+Grunt Integrated workflow
222 |
223 | Using grunt-maven-plugin is convenient, but there is still a huge gap between frontend and backend development workflow. Various IDEs (Netbeans, IntelliJ Idea, Eclipse)
224 | try to ease webapp development by synchronizing changes made in *src/webapp/* to exploded WAR directory in *target/*. This naive approach works as long as there is no
225 | need to minify JavaScript sources, compile less files or project does not follow "single WAR" rule and can afford using Maven profiles. Rebuilding project each time a
226 | change was made in \*.js is a horrible thing. Fortunately grunt-maven-plugin is a great tool to solve this problem.
227 |
228 | Idea is to ignore IDE mechanisms and run Grunt build each time a change in static files was made. Traditional workflow looks like:
229 |
230 | 1. user changes *src/webapp/static/hello.js*
231 | 1. IDE detects change
232 | 1. IDE copies *hello.js* to *target/_war_name_/static/hello.js*
233 |
234 | This gives little room to integrate other processes in between. Workflow utilizing **grunt-maven-plugin**:
235 |
236 | 1. run [Grunt watch process](https://github.com/gruntjs/grunt-contrib-watch)
237 | 1. user changes *src/webapp/static/hello.js*
238 | 1. Grunt detects changes, copies *hello.js* to *target-grunt/hello.js*
239 | 1. run Grunt tasks, produce *target-grunt/dist/hello.min.js* with source map *target-grunt/dist/hello.map.js*
240 | 1. Grunt copies results to *target/warname/static*
241 |
242 | Now what happens inside *target-grunt* is for us to decide, it can be virtually anything - minification, less compilation, running
243 | JS tests, JS linting. Anything Grunt can do, just like during *heavy* build process.
244 |
245 | ### Configuring Maven
246 |
247 | Since we want grunt-maven-plugin to take control of what ends up in WAR, we need to tell Maven WAR plugin to ignore our statics dir when creating WAR:
248 |
249 | ```xml
250 |
251 |
252 |
253 | maven-war-plugin
254 | 2.3
255 |
256 | jsSourceDirectory/**
257 |
258 |
259 |
260 |
261 | ```
262 |
263 | ### Configuring Grunt
264 |
265 | **grunt-maven-plugin** has a dedicated NPM Grunt multitasks that make integrated workflow work.
266 |
267 | ```js
268 | grunt.initConfig({
269 | mavenPrepare: {
270 | options: {
271 | resources: ['**']
272 | },
273 | prepare: {}
274 | },
275 |
276 | mavenDist: {
277 | options: {
278 | warName: '<%= gruntMavenProperties.warName %>',
279 | deliverables: ['**', '!non-deliverable.js'],
280 | gruntDistDir: 'dist'
281 | },
282 | dist: {}
283 | },
284 |
285 | gruntMavenProperties: grunt.file.readJSON('grunt-maven.json'),
286 |
287 | watch: {
288 | maven: {
289 | files: ['<%= gruntMavenProperties.filesToWatch %>'],
290 | tasks: 'default'
291 | }
292 | }
293 | });
294 |
295 |
296 | grunt.loadNpmTasks('grunt-maven');
297 |
298 | grunt.registerTask('default', ['mavenPrepare', 'jshint', 'karma', 'less', 'uglify', 'mavenDist']);
299 |
300 | ```
301 |
302 | For more information please consult documentation of [grunt-maven-npm project](https://github.com/allegro/grunt-maven-npm).
303 |
304 |
305 | ### Deep customization of workflow
306 |
307 | It is possible to override inner workflow configuration during runtime. Inner properties are extracted from **pom.xml**
308 | and used internally inside workflow Grunt tasks. They reside in **target-grunt/grunt-maven.json**.
309 | After reading inner properties JSON file, workflow task seeks for **grunt-maven-custom.json** file in
310 | **target-grunt** and overrides original properties with custom ones.
311 |
312 | ### Configuring IDE
313 |
314 | Depending on IDE, synchronization processes behave differently. Having JSP files synchronized is a nice feature, so it is up to you
315 | to decide what should be turned off. In Netbeans and IntelliJ no configuration is needed, they play nicely with new workflow.
316 |
317 | You still have to remember to run Grunt watch process in background so it can monitor changes. It can be run from IDE via grunt-maven-plugin.
318 | Define custom runner that will run:
319 |
320 | mvn grunt:grunt -Dtarget=watch
321 |
322 | You should see process output each time static sources change.
323 |
324 | #### Configuring Eclipse
325 |
326 | Eclipse is a special case. Unfortunately it does not read WAR from Maven target, instead it keeps own file hierarchy.
327 | Eclipse developers on the team should use deep workflow customization to override properties used by others. Proposed
328 | way is to create **grunt-maven-custom.json** in Maven sources and add it to **.gitignore**, so it will not pollute
329 | source repository. Since i have little experience with Eclipse, i would welcome a contribution of sample configuration,
330 | but most probably it is enough to override **targetPath** property.
331 |
332 |
333 | ## Changelog
334 | * **1.5.9** (26.12.2014)
335 | * added option to change destination of all deliverables within WAR
336 | * **1.4.1** (02.08.2014)
337 | * added option to exclude custom resources in create-resources phase
338 | * **1.4.0** (07.07.2014)
339 | * changed default lifecycle bindings
340 | * support for disabling execution based on flag
341 | * **1.3.2** (19.06.2014)
342 | * support for defining npm command line parameters
343 | * fixed bug from 1.3.1 - null pointer when no npm env variables specified
344 | * **1.3.1** (26.05.2014)
345 | * support for Maven 2.1+ and 3.*
346 | * option to specify NPM env variables
347 | * **1.3.0** (22.04.2014)
348 | * **dropped** support for *link-node-modules*
349 | * **1.2.2** (31.03.2014)
350 | * support for npm offline mode
351 | * **1.2.1** (25.02.2014)
352 | * executing `bower install`
353 | * **1.2.0** (07.02.2014)
354 | * new Maven+Grunt NPM multitasks
355 | * **1.1.4** (05.02.2014)
356 | * added option to ignore Grunt task errors (failing tests etc) (#22)
357 | * **1.1.3** (25.01.2014)
358 | * fixed issue with using custom Grunt target and CLI options together (#20)
359 | * **1.1.2** (06.01.2014)
360 | * fixed compatibility issue of 1.1.x branch - once again compatible with JDK 6+
361 | * **1.1.1** (31.12.2013)
362 | * fixed bug with filtering all resources instead of only chosen
363 | * fixed bug with Windows paths in workflow properties
364 | * **1.1.0** (30.12.2013)
365 | * integrated workflow as a separate, auto-configured Grunt task
366 | * **1.0.4** (8.12.2013)
367 | * explicit declaration of resources filtered on create-resources goal
368 | * **1.0.3** (24.11.2013)
369 | * passing custom options to grunt executable
370 | * ability to use external or preinstalled node_modules
371 | * **1.0.2** (15.10.2013)
372 | * option to disable npm and grunt color output, by default no colors are shown as it looks bad in Maven logs
373 | * **1.0.1** (13.09.2013)
374 | * compatibility with Maven 3.1.x
375 |
376 |
377 | ## License
378 |
379 | **grunt-maven-plugin** is published under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
380 |
--------------------------------------------------------------------------------
/grunt-maven-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 |
5 | org.sonatype.oss
6 | oss-parent
7 | 7
8 |
9 |
10 | pl.allegro
11 | grunt-maven-plugin
12 | 1.5.2-SNAPSHOT
13 | maven-plugin
14 |
15 | grunt-maven-plugin
16 | Integrates GruntJS with Maven build.
17 |
18 | https://github.com/allegro/grunt-maven-plugin
19 |
20 |
21 |
22 | Adam Dubiel
23 | Allegro Group
24 |
25 |
26 |
27 |
28 |
29 | The Apache Software License, Version 2.0
30 | http://www.apache.org/licenses/LICENSE-2.0.txt
31 |
32 |
33 |
34 |
35 | scm:git:git@github.com:allegro/grunt-maven-plugin.git
36 | scm:git:git@github.com:allegro/grunt-maven-plugin.git
37 | https://github.com/allegro/grunt-maven-plugin
38 |
39 |
40 |
41 | UTF-8
42 |
43 |
44 |
45 |
46 | org.apache.maven
47 | maven-core
48 | 3.1.1
49 |
50 |
51 | org.apache.maven
52 | maven-plugin-api
53 | 3.1.1
54 |
55 |
56 | org.apache.maven.plugin-tools
57 | maven-plugin-tools-annotations
58 | 3.2
59 |
60 |
61 |
62 | org.apache.commons
63 | commons-compress
64 | 1.9
65 |
66 |
67 | commons-io
68 | commons-io
69 | 2.4
70 |
71 |
72 |
73 |
74 | org.twdata.maven
75 | mojo-executor
76 | 1.5.2
77 |
78 |
79 | org.apache.maven.plugins
80 | maven-resources-plugin
81 | 2.6
82 |
83 |
84 | org.apache.maven.plugins
85 | maven-clean-plugin
86 | 2.5
87 |
88 |
89 |
90 |
91 | org.testng
92 | testng
93 | 6.8.7
94 | test
95 |
96 |
97 |
98 | org.assertj
99 | assertj-core
100 | 1.5.0
101 | test
102 |
103 |
104 |
105 | org.mockito
106 | mockito-core
107 | 1.9.5
108 | test
109 |
110 |
111 |
112 | com.googlecode.catch-exception
113 | catch-exception
114 | 1.2.0
115 | test
116 |
117 |
118 |
119 | com.google.guava
120 | guava
121 | 15.0
122 | test
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 | org.apache.maven.plugins
131 | maven-compiler-plugin
132 | 2.3.2
133 |
134 | 1.6
135 | 1.6
136 |
137 |
138 |
139 | org.apache.maven.plugins
140 | maven-plugin-plugin
141 | 3.2
142 |
143 | true
144 |
145 |
146 |
147 | mojo-descriptor
148 | process-classes
149 |
150 | descriptor
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 | release-sign-artifacts
161 |
162 |
163 | performRelease
164 | true
165 |
166 |
167 |
168 |
169 |
170 | org.apache.maven.plugins
171 | maven-gpg-plugin
172 | 1.4
173 |
174 |
175 | sign-artifacts
176 | verify
177 |
178 | sign
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 | sonatype-staging-grunt-maven
191 | https://oss.sonatype.org/service/local/staging/deploy/maven2/
192 |
193 |
194 | sonatype-snapshots-grunt-maven
195 | https://oss.sonatype.org/content/repositories/snapshots/
196 |
197 |
198 |
199 |
200 |
--------------------------------------------------------------------------------
/project-resources/ci-settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 | sonatype-staging-grunt-maven
9 | ${env.NEXUS_USER}
10 | ${env.NEXUS_PASSWORD}
11 |
12 |
13 | sonatype-snapshots-grunt-maven
14 | ${env.NEXUS_USER}
15 | ${env.NEXUS_PASSWORD}
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/main/java/pl/allegro/tdr/gruntmaven/AbstractExecutableMojo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package pl.allegro.tdr.gruntmaven;
17 |
18 | import pl.allegro.tdr.gruntmaven.executable.Executable;
19 |
20 | import java.util.ArrayList;
21 | import java.util.Arrays;
22 | import java.util.List;
23 | import java.util.Map;
24 |
25 | import org.apache.maven.plugin.MojoExecutionException;
26 | import org.apache.maven.plugin.MojoFailureException;
27 | import org.apache.maven.plugins.annotations.Parameter;
28 | import static org.twdata.maven.mojoexecutor.MojoExecutor.*;
29 |
30 | /**
31 | * Abstract mojo which uses MojoExecutor to execute exec-maven-plugin,
32 | * which in turn executes system command - command line only.
33 | *
34 | * Compatible with Windows via
35 | *