Deploy Mavenized EAR project without packaging to EAR - performance

I have a "mavenized" EAR project like this:
PARENT
EAR
EJB
WEB
The problem is that I have to do
mvn clean package
on PARENT project every time I want to deploy. Just after this, I get the EAR and do
mvn glassfish:deploy
on a running Glassfish instance.
All this process is a bit hassle in development environment!
I just want to know if there is a faster way to work with EJB, Maven and Glassfish, like deploying target contents without the need of packaging EAR.
PS: I'm already using "jrebel-maven-plugin" that does hot-deploy ONLY when EAR was initially deployed.

Michel,
why don't you deploy your app from your IDE? I understand that it may take a bit more time to configure development environment, but it really worth the effort. I truly enjoy configuration: Eclipse + m2eclipse + Java EE server.
Download Eclipse for Java EE developers, add plugin m2eclipse(included in Eclipse Juno), import your project as maven project, add application server to eclipse, and run your app on it. Application will be deployed on server by default as exploded archive in less than 10s, what should be huge improvement for you.

Related

How to Deploy an artifact programmatically using Maven

I have a mission to develop an integration tool which allows from a source code folder to generate a WAR or OSGI Bundle and then deploys it in Tomcat or Karaf. I used Maven Embedder to create the artifacts, now my problem is how to configure my pom.xml to automatically deploy these artifacts.
on the internet I can't find any examples and also I'm new to the world of JEE and Maven.
please help me.
Find out how you can deploy artifacts to Tomcat or Karaf (without Maven).
Find out how you can deploy artifacts to Tomcat or Karaf programmatically.
Find a Maven plugin to use that deployment method.
The simplest solution would be to use something like the maven-resources-plugin to copy your built artifacts to the servers deployment directory but I am pretty sure that there are more sophisticated methods like http://tomcat.apache.org/maven-plugin-2.2/tomcat7-maven-plugin/deploy-only-mojo.html for deploying out of maven without plain file system mechanisms.
On a wider scale when working on problems like yours it always helps to take a step back and think about the abstract use case ("How to deploy something somewhere" followed by "How to deploy something somewhere programmatically") before going into detail and think about Tomcat or other application servers - and in most cases you will find out that there were hundreds of other who already had the same problem and solved it some way or the other.

Slow Appengine build with Maven and Modules

I just converted my GAE application to using modules and started using maven as well. I used the standard appengine archetype to create the project structure.
However, when I run mvn install this takes over a minute to build my project. Most of the time is taken building .war and .ear files. Are these needed for appengine builds?
If not, how do I get these .war and .ear files to not be packaged for appengine projects?
You should stop in the default life cycle of Maven somewhere before package, say test.
mvn test
Any point at or after package will lead to building a package.
b.t.w. I'm learning how to build an App Engine app with modules. May I ask which archetype did you use? It looks to me this doesn't create a multi-module layout, https://developers.google.com/appengine/docs/java/tools/maven#creating_app_engine_applications_or_backend_apis_using_the_archetypes
Another question is how to launch the devserver for modules like the example shown here, https://developers.google.com/appengine/docs/java/modules/#an_example
Thanks!

Deploying multi-module app to jboss

I have a maven project that contains several sub projects/modules(ears,wars, ejb's). Is there a way I can deploy the entire project at once, and how would I do that? My IDE is NetBeans.
What is the jboss version that you are currently using?
I think that you can create one shell script which is charge of to deploy all your modules. I have not seen any plugin that allow to do that.

Deploy a Maven application in IntelliJ 12 without building with Maven

I have problem with configuration of maven project in IntelliJ. I deploy my application to JBoss, when I start JBoss server via IntelliJ, application is deployed without any additional actions, but when I try to redeploy application after some changes, IntelliJ try to make project with it's own make process, and it fails. I have to make project via maven and restart server to redeploy application. Can I somehow tell intelliJ to use maven while redeploy application? I cannot see such option in Run/Debug configuration window.
I think you are using exploded artefacts (present icon) Server, Deployment Section. Right?
There you can choose the external artefact and disable the make flag.
I always using exploded artefacts, because of the hot code deployment. So I do no need to deploy artefacts again and again.
Please be aware if there is already an artefact (e.g. foobar.war) in the same location (maven target directory), you have to change the name of the exploded artefact (e.g. foobarE.war). Idea is creating a folder named foobarE.war.

Configure tomcat runtime using maven

Is it possible to configure a complete tomcat runtime within Eclipse using Maven/m2eclispe.
A maven goal to downloaded tomcat, create the server withing the eclipse environment and add the specified war files to the server ?
Or can some of these goals be implemented ?
You might want to take a look at this solution or check out the maven cargo plugin.
The first solution uses the sysdeo tomcat plugin, which I've personally used in the past, which worked quite well. It does not download tomcat though for you. You will have to do that manually.
Right now I'm working with the maven cargo plugin (not an eclipse plugin though), which will download a tomcat instance for your for development purposes.

Resources