Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do a "grunt build" before generating a WAR file #28

Closed
Merguez22 opened this issue Nov 22, 2013 · 6 comments
Closed

Do a "grunt build" before generating a WAR file #28

Merguez22 opened this issue Nov 22, 2013 · 6 comments
Assignees
Milestone

Comments

@Merguez22
Copy link

All nodejs server et jetty server work fine. But i wondering how to have all files generated
by "grunt build" in the WAR when doing a "mvn package".

I see the yeoman-maven-plugin to launch yo command. May be it's possible to register a new task to generate minify, uglify, ... file and to inject it in the webapp ?

@jdubois
Copy link
Member

jdubois commented Nov 22, 2013

You're right... That was one of my main ideas at the beginning of the project, and I totally forgot it!!! So thanks for the bug report :-)

I don't think the yeoman-maven-plugin will help a lot, but it's worth checking out.

My idea at the moment (but I haven't tried it for real!) would be to run a "grunt build" by running something like the Maven Exec plugin: http://mojo.codehaus.org/exec-maven-plugin/usage.html

@Merguez22
Copy link
Author

This project https://github.com/trecloux/yeoman-maven-samples show an example base on "yeoman-maven-plugin". The "yeoman-maven-plugin" simply execute "npm install", "bower install" and "grunt (test/)build".

The files structure is quiet different, but simply to mimic. Extract all CSS, SASS, JS, images, ... from webapp to a root subfolder to avoid to overwrite them or duplicate them. (i'm french, sorry or the English, i know you too ;-))

@jdubois
Copy link
Member

jdubois commented Nov 22, 2013

Yes, that's exactly what I want to do, run the bower/grunt commands from Maven, with the JHipster file structure.

I'm not sure it's a good idea to depend on yeoman-maven-plugin, as it's so simple we can just configure the maven exec plugin to do the same thing. But it's worth trying both options before deciding.

@philippd
Copy link
Contributor

I did exactly that using maven exec plugin and two different scripts for unix/win. https://github.com/philippd/angular-spring-webmvc/blob/master/pom.xml

@jdubois
Copy link
Member

jdubois commented Nov 22, 2013

If @philippd solution already works, and doesn't need a plugin, I'll go for it! The only downside is the build scripts that need to be at the root of the project, can't those commands be run straight from the exec plugin?

@jdubois
Copy link
Member

jdubois commented Nov 27, 2013

I'll use the code from @philippd

It's going to be easy now that #32 is closed, but I'll need:

  • more testing
  • a good documentation to explain how you're supposed to use all this :-)

@jdubois jdubois closed this as completed Nov 29, 2013
@jdubois jdubois modified the milestone: 0.0.1 Sep 10, 2014
erikkemperman pushed a commit to erikkemperman/generator-jhipster that referenced this issue Dec 3, 2017
erikkemperman pushed a commit to erikkemperman/generator-jhipster that referenced this issue Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants