allegro/grunt-maven-plugin

Add documentation for excludedResources

Opened this issue · 5 comments

Hi,

I was trying to figure out how to use the <excludedResources> element to exclude node_modules, bower_component, dist, .tmp and .sass-cache so I can run grunt serve locally in the src/main/resources/static directory without all that stuff being copied over to the build directory when I run maven. I finally found the solution:

<configuration>
    <excludedResources>
        <excludedResource>node_modules/**/*</excludedResource>
        <excludedResource>bower_components/**/*</excludedResource>
        <excludedResource>dist/**/*</excludedResource>
        <excludedResource>.tmp/**/*</excludedResource>
        <excludedResource>.sass-cache/**/*</excludedResource>
    </excludedResources>
</configuration>

Would you add this to the README in order to save others the trouble of figuring this out on their own?

Cheers,

Jannik

The whole point of grunt-maven-plugin is to have build in separate directory (for reasons stated in readme), so for me config snippet you posted above is a hack. That's why i don't want to post it as part of official guide, especially that it has some elements specific to your build (like .sass-cache, .tmp).

grunt-maven builds in separate dir, so you don't have to worry about excluding grunt artifacts, list of which depends on plugins used and might change as grunt build evolves.

I am using grunt-maven-plugin to build my yeoman-angular project on Bamboo. Locally, I prefer to run grunt serve directly (which does not make sense as a maven goal at all, IMHO). This allows me to to have my changes autoreloaded into the browser immediately, along with providing test results, jshint results and any compass errors immediately. So this use case actually does make some sense.

Even if you think my usage of excludeResources is a hack, some documentation for the configuration option would still be helpful. This might save others from having to read the source code to figure out how excludeResources works.

Okay, so it's not part of Java/mvn project at all? Let me understand your usage of gmp, so i might come up with some solution that will be satisfying for both of us :) Could you show simplified tree ./ of your project?

Sorry, I can't give you the tree due to confidentiality issues.

Basically, we have a system that is written (mostly) in Java and use Maven as our main build tool with Bamboo as a CI. The grunt project is a pure Angular UI and does not contain any Java components. We use grunt-maven-plugin to run the tests (and collect test reports) for the project and build a ZIP file that we can later deploy to a web server. The code interfaces with the Java backend over REST calls.

So I use grunt directly for development, but use grunt-maven-plugin to seamlessly integrate the frontend with our CI infrastructure and software development processes in general.

Does that make our use case clearer?

Okay, i think i start to get it - maybe this is the case in which target-grunt and grunt:watch does not really make sense. I developed integrated workflow to make development of grunt application easier and more JS-like, but i guess it does not help? If not, i will create wiki page with link to README that shall describe your configuration.