Reputation: 141
We are developing a single-page application (SPA) in which the front end is developed using AngularJS and the business logic is developed using RESTful Web Services with JAX-RS.
We are using Eclipse as IDE, Maven for dependency management and build automation tool and Tomcat as the development server. We have installed AngularJS Eclipse 0.4.0. I am a newbie to Eclipse and am running into these issues:
How do I create a Maven based AngularJS project in Eclipse?
Is there any way to scaffold an AngularJS application in Eclipse (just like Yeoman)?
Upvotes: 12
Views: 21176
Reputation: 9616
Short answer:
Look for my long answer to think differently. There is a reason why you are not finding many formal popular Archetypes.
Maven Archetypes for AngularJS Maven Grunt Plugin
Long Answer:
I would advise you against
mixing and encourage to treat them separately for "cleanliness" and also from architectural point of view.
Treat them as 2 separate applications.
Here are the reasons why
Builds & Tooling - The Java side tooling will not catch up with the Web/Javascript. SPAs are full fledged applications and tend to have their own development workflow. Hence working with build tools such Grunt/Gulp will make things more easier than if the server side Java (or other JVM lang) you are going after.
SPAs with and with AngularJS are more of a norm on node based build tools. Going forward you will find plethora of tools in this space than Java based tools for Javascript/HTML application.
REST Architecture style The REST architecture style you are already making conscious decision about the separation. Think Server applications are serving entities (states). The UI application is presenting.
Freedom with Development Cycles
You can develop and release your UI SPA separately on a totally different release cycle. This is a great freedom. This freedom also comes with slight costs i.e. versioning and hardening interfaces which you can overcome with JSON schema and API versioning. One example about JSON schema is that you can use Jackson Schema generation https://github.com/FasterXML/jackson-module-jsonSchema of something similar that can make the schema available during build/development time. Also look at http://beanvalidation.org/1.1/ and declare your Bean Validation constraints such as (Required, Type, Format, etc) and go for declarative approach
. Then you can export this to a JSON schema easily.
Upvotes: 16