Deploying multi-module app to jboss - maven

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.

Related

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!

Deploy Mavenized EAR project without packaging to EAR

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.

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.

Maven cargo plugin - redeploy specific deployable in standalone container?

I'm currently working on a project that consists of several services written in Java that are accessed by a Ruby/Rails front-end. In an attempt to simplify local development, I've created a separate project that adds all of our service WAR projects as dependencies, and uses the cargo-maven-plugin to deploy each of these as a deployable inside of a single embedded Jetty instance.
The issue I'm having is that I'd like to be able to tell cargo to re-deploy a single WAR out of the several that are being run at a time. Starting the entire set of services from scratch takes a bit, and is really unnecessary when only one deployable has actually changed. As far as I can tell, the cargo:redeploy goal only works for non-standalone containers, and I also haven't been able to find any documentation that its possible to specify what you want to re-deploy on the command line.
Is there a way to tell cargo to re-deploy a single deployable from the command line? I'm thinking of something along the lines of mvn cargo:redeploy -DgroupId=com.foo.bar -DartifactId=baz
Apologies if this isn't clear, or if there is a different approach that I should be taking entirely - I'm relatively new to Java development and Maven.
Thanks for any help.
Download the latest war file to your local machine, then redeploy using the following pattern:
mvn install:install-file -DgroupId=com.foo.bar -DartifactId=baz -Dversion=1.x -Dpackaging=war -Dfile=C:/cargo.jar

Automatic deployement with Jenkins/jetty

I would like to setup a continuous integration environment whereby after committing the source code, it triggers a build process that checks out the code, runs tests, constructs a war file and deploys the same to jetty server such that the users/testers can access the application on the browser.
Is this possible ?
Am using maven and jetty (I am not willing to change this. I use jetty both for development and in production). For CI, I am exploring Jenkins but am open to other opensource solutions.
If possible, how do I setup the environment.
I found a maven plugin named cargo. It has everything that I needed. I added it into my pom so that I could deploy and undeploy using mvn cargo:deploy/mvn cargo:undeploy. I created a new jenkins job and added undeploy, package deploy maven goals as build steps. Everything is working perfectly.
it's definitely possible. In a previous project, the build server (teamcity) copied the war to a shared nfs location between the build server and the application server and run a little shell script that connected to the application server and restarted jetty.
We used ant inside maven to manage the deployment, I remember we used the copy and sshexec tasks.
I'm sure that there are many other solutions, but that one worked for us.
I reviewed a lot of posts like this but I want something that is maven independent. Look here, this is selfcontained runner in on hudson/jenkins. You only need 'war', even manual jetty installation is not needed. Deploy war on jetty in Jenkins or Hudson job

Resources