I have developed a module using Play Framework. This module is used by multiple Play framework projects. Each time I change any code in the module I need to build the module and deploy it inside my other main applications. I do not want to do this step while doing the development in Eclipse. I only want to build the module when deploying in server. Is there any way my which I can achieve this - I do code change in module in eclipse all projects using this module automatically get the changes.
Thank you
If it's play 1.2 you can declare your module to be loaded from local repository:
http://www.playframework.com/documentation/1.2.4/dependency#repositories (section "Local repositories").
Play should then compile your module and always load latest sources when you start your app.
You might have issues if your modules use some jar deployed classes (not in app directory), then you would need to execute play build-module.
Related
I currently have an opensource maven project that I have downloaded off github. The project includes 14 modules, all having dependencies with each other.
I am trying to create a RESTfull API using Tomcat 9 on eclipse to access the aforementioned project.
I started by creating a dynamic web application in eclipse. Is there any way I can add the project (GitHub project mentioned above) to the dynamic web application, so I can write a logic layer that can interact with the project.
If your goal for your second project is to consume the RESTful web services exposed by the first, then it doesn't need to actually interact with the first project at the code level. I would just create an entirely separate project in Eclipse. The first REST project you downloaded doesn't even need to be running on the same machine as your second project.
I want to create an App Engine Modules project using maven in Java basically for frontend and backend instance.
For that I don't have any idea of module project structure as well as archetype of the module app engine project.
The docs walk you through creating an App Engine module using Maven. If you use the appengine-skeleton-archetype archetype, Maven will create the directory structure for you.
If you're using Java for all of your modules (hint: you don't have to), you will want to create a Maven module corresponding to each of your App Engine modules.
The App Engine modules documentation explains how to configure your modules.
I'm converting some backends to modules and am perplexed on setting up the development environment configuration. I'm using Java in Eclipse but not Maven. The architecture is very simple:
Front end module is default. Basic GAE/GWT app. Puts items on task queue.
Back end module processes task queue.
With the old backend architecture one debug configuration would start up the development server that would service the GWT DevMode UI and the backend task processing.
The crux of the issue is that the arguments to DevMode provide for a -war command line argument. Now that we no longer have a single war file (there is an ear containing two war files), we have to start them independently. This is fine, we can create a Launch Group that starts up the frontend and backend.
The problem is that each war file gets it's own
WEB-INF/appengine-generated/local_db.bin, which essentially creates two standalone applications. Am I missing something here? I need to be able to put a breakpoint on my front-end RPC service and in the servlet that handles task queue items in the new backend and have both of them hit in one debugging session.
Thanks for any thoughts.
If you follow the instructions here, this will create a modularized application structure in Eclipse, and not using Maven at all. You will need Eclipse WTP in order to have the required project types available (Enterprise Application Project and Dynamic Web Project).
The Eclipse project structure should look as follows:
<<Enterprise Application Project>> ear-app
|
| (refers to)
|
<<Dynamic Web Project>> app-module-1 "default"
<<Dynamic Web Project>> app-module-2 "any_name_2"
<<Dynamic Web Project>> app-module-3 "any_name_3"
<<Dynamic Web Project>> app-module-4 "any_name_4"
The value of "name" refers to the "module" element in appengine-web.xml, while the physical web project can have any name.
Please note that you need to switch into J2EE perspective in order to have the GPE WTP menu options available, they do not show up in the standard Java perspective.
Next, you need to link the EAR project to a new local server instance (of type "Google App Engine").
Only one of the web modules must be flagged as "default" in appengine-web.xml.
Upon deployment of the EAR to the local server, the datastore location is in WEB-INF/appengine-generated/local_db.bin of the default web module, and it is shared between the web modules.
I'm having similar problems figuring out how to implement multiple modules in the MyEclipse plugin for Google App Engine. The best information I've found just says to use Maven.
"Although Java EE supports WAR files, module configuration uses unpacked WAR directories only. App Engine's Java SDK includes an Apache Maven tool that can build a skeletal EAR structure for you." (source: https://developers.google.com/appengine/docs/java/modules/)
I also found this:
"A Maven project has a different layout than an Eclipse project. So, if you wish to use a Maven project with Eclipse, you need to do a bit more work. You have the following options:
1] Import a Maven project for App Engine into Eclipse as a Web Tools Platform (WTP) project, as described in Importing an Existing Maven Project.
2] Import the Maven project into Eclipse using an appropriate Maven integration plugin such as m2eclipse.
3] Set up two debug configurations, one for the Maven project in devserver (mvn appengine:devserver), and one for a Remote Java Application that you use to connect the Eclipse debug client to the devserver jvm. For details on how to do this, see ..." (source: https://developers.google.com/appengine/docs/java/tools/maven#creating_a_new_maven_app_engine_project_using_skeleton-archetype)
I know you said you're not using Maven, but might you consider trying it?
we have web java ee projects using maven
The projects shared common webpages and their code
i want the optimized way to be able to run every single project (Hr , Payroll ,..) and also the aggregated project ERP
the main problem is WAR dependencies
if module projects can run ,all WARs will contain dependencies which will make ERP build time consuming process
we made temp solution using a variable in parent pom to make modules dependencies provided to make ERP build faster
and switch it off to make modules run
As i know, no team like to make war artifact (web project) dependent on other war artifact. if you want to share login functions, it 's better to integrate single-sign-on module. if you only want to share some logic in the webapp, it's advisable to fork it and make it as a standalone maven project.
using IDEA ultimate, how would I start a project and have the following layout:
/src/
/src/main/java/com/example/myapp
/src/main/resources
/src/main/webapp
/src/main/webapp/META-INF
/src/main/webapp/WEB-INF
/src/main/webapp/WEB-INF/jsp
/src/main/webapp/WEB-INF/lib
/src/main/webapp/WEB-INF/myapp-servlet.xml
/src/main/webapp/WEB-INF/web.xml
So from what I understand, once this is setup I have to now somehow wire things using Modules/Artifacts/Facets.
I have JDK and tomcat setup.
I just don't know how to wire things up, so when I hit RUN it will build, deploy the app.
The best way to start creating a web project in Idea is to use either a maven project (any project with valid pom.xml and by your folder structure I guess thats what you are trying to do) Or create a project and add a web module (a module with web facet). Artifacts are like your build artifacts, your wars, jars and such things. Modules are sub projects or logical division of your main projects like common module, services, web module in a main project. Facets gives your some extra features like spring auto completion. It tells the IDE that your module is using so and so technology...