allegro / grunt-maven-plugin

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

Filter Resources #9

Closed BrianChapman closed 10 years ago

BrianChapman commented 11 years ago

The name of the target/ can be variable. To allow for variable names, it would be nice to be able to filter properties like the resources plugin does.

The create-resources goal uses the resources plugin to do it's work, so adding the ability to define resources (including filtered resources) in the configuration would be straightforward.

adamdubiel commented 11 years ago

You mean adding filtering in statics? (js, css etc). I'm afraid it's not so straightforward as it would break the whole integrated workflow (grunt does the heavy lifting then). Resources plugin is used only on full maven build. So even if resources plugin supports filtering, any change using grunt:watch would override filtered values.

Do you have any specific use case? Maybe it will give me some idea how to solve this problem.

BrianChapman commented 11 years ago

In my environment the project.build.finalName follows the pattern artifactId-version. Therefore after every release the name of the war folder under target changes and thus needs to be manually updated in Gruntfile.js.

targetMaven: { // copy dist files to exploded WAR target files: [ { expand: true, cwd: './dist', src: ['./**'], dest: '../target//static/' } ] }

What I would like to be able to do is filter the Gruntfile.js to include the current project.build.finalName variable where is in the code above.

adamdubiel commented 11 years ago

Okay, actually i was thinking about it some time ago. My idea was to create file like project-properties.json which could be imported into Gruntfile just like packages.json is. This one resource would get filtered by maven when performing full-build, but left alone when copying resources by Grunt.

I guess i can implement it this week, would it solve your issue?

BrianChapman commented 11 years ago

Yes, that would allow for maven to share state with grunt, which is exactly the need I have.

adamdubiel commented 11 years ago

Specific option and/or configuration pattern will be available in 1.0.4 release this week - stay tuned!

adamdubiel commented 10 years ago

New configuration option: filteredResources. By using this option you can be sure, that your code will be compatible with 1.1.0 release, which will introduce automatization of integrated workflow.