Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to separate my front-end and back-end parts into 2 modules.

Parent
 | pom.xml
 |
 |--Back-end
     |- pom.xml
 |--Front-end
 |   |- pom.xml

My back-end module produces a WAR. I would like to include my javascript code (from Front-end module) into this WAR at build time but i don't know how to do. I have not found concrete samples on the Internet to use WAR overlay / javascript dependencies.

My front-end project will use a similar architecture to that of Angular-seed project. For now, I am using javascript-maven-plugin in order to use <packaging>js</packaging> but there are some dependencies i don't want. I would prefer to use Grunt / Bower to collect dependencies and minify my JS files (but I'm new to these technologies and I need to train first. In the future i would like my project to have the same architecture as ng-boilerplate.)

Can someone give me some links, so that i can understand how to include my front-end code into my war. Or a simplified POM from two modules that match what i want.

I am also interested in sample architectures for AngularJs projects using Maven.

Thx

share|improve this question
1  
I'm also looking at this type of implementation because I work with a bunch of Java devs. From what I can see, it's not a common/best practice (otherwise there would be a plethora of info on it) and from what I'm experiencing, it's way more complexity than it's worth. I would just build an Angular front-end and have it communicate with the backend via REST API calls. You don't need the server to generate your UI. The only caveat is how to handle the scenario where your app needs to have seed data (dev/stage/prod URLs, tokens, etc) before it can do anything important. Good Luck! –  fractalspawn Mar 10 at 23:40
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.