allegro / grunt-maven-plugin

Grunt + Maven integration done right
Other
213 stars 32 forks source link

sourceDirectory in grunt-maven.json is a relative path, but not to target-grunt #26

Closed nalbion closed 10 years ago

nalbion commented 10 years ago

I'm a bit confused... The docs say that Gruntfile.js and package.json should be in src/main/webapp/static (jsSourceDirectory) - because this is currently the only directory that is copied across to target-grunt. I can see that AbstractExecutableMojo adds the following to the exec configuration:

new Element[]{element(name("workingDirectory"), gruntBuildDirectory)}

...so shouldn't all of the paths provided in the generated grunt-maven.json file be adjusted accordingly? ie, "../src/main/webapp" rather than "src/main/webapp"?

{
  "finalName": "my-project-1.0.0-SNAPSHOT",
  "filesToWatch": "D:/my/project/src/main/webapp/static/**",
  "directoryToWatch": "D:/my/project/src/main/webapp/static",
  "projectRootPath": "D:/my/project",
  "targetPath": "D:/my/project/target",
  "sourceDirectory": "src/main/webapp/",
  "jsSourceDirectory": "WEB-INF/static",
  "filteredFiles": []
}
adamdubiel commented 10 years ago

gruntBuildDirectory is target-grunt in project root. This is the directory where npm and grunt executables are executed. Nothing gets executed in src/main/webapp.

Property you are concerned about is there for other reasons, namely for GMP npm tasks that uses it internally.