Multi-module deploy with Maven, JBoss and Eclipse - eclipse

Is there a way to do incremental deployments with these three tools when in a multi-module project?
Example of Maven project:
project
project-data
project-service
project-webapp
The above are Maven modules with dependencies between them. The project-webapp module contains the .war file, but I don't want to create a new .war file every time I need to deploy. Is there a way to perform deployments upon file saves?

Use the Eclipse WTP support (and either the maven eclipse plugin or m2eclipse to import your project as a dynamic project). Did you try? Are you facing any particular problem?

Related

Eclipse OSGi (Kura) Plugin and Maven

I have a simple basic question. If I develop plugin for Kura in eclipse with maven, can I use dependency feature of Maven? I mean, when I use Maven for my Spring projects, I simple add dependency to pom.xml file and I can use in my project. Since I run Spring project on my local machine, dependent .jar files can be used runtime. This time, I will deploy my plugin to another device (Raspberry) , I have to put everything in the bundle .jar package. Can Maven do this or should I add dependent .jar files to classpath manualy?
You can use maven shade plugin to build the so called uber-jar - one jar that will contain your project along with all the dependencies.

Eclipse WTP and Maven project producing two artifacts

I have a maven jar project common_platform that is producing the usual .jar file and also a .war overlay (using the maven-assembly-plugin)
I have another maven project with war packaging, it's including both those artifacts.
Now I want to use WTP to deploy the webapp project to Tomcat. Unfortunately the common_platform .war overlay is not getting processed.
If I go to Web Deployment Assembly view I see the project is included twice, but the files do not appear in the deployed webapplication.
I have another (external) overlay with ExtJs and it's being unpacked as expected.
I tried adding the package manually to the descriptor, but it's added as a package, not unpacked.
How to make WTP unpack the overlay contents?
I'm using Eclipse Mars with recent WTP, m2e and m2e-wtp.
Filled a bug in m2e-wtp
TL;DR:
Unfortunately m2e-wtp doesn't support workspace projects generating
multiple archives.

Eclipse glassfish plugin not publishing maven dependency jars to ear lib folder

I'm using the Eclipse "Internal Glassfish 3.1.2.2" server with the Eclipse Glassfish plugin (http://download.java.net/glassfish/eclipse/juno). I'm also using Maven with the m2e Eclipse plugin. The Glassfish plugin correctly deploys my EAR modules to the Internal Glassfish, but it does not deploy my dependency jars, which I believe should end up in a folder called "lib".
I found a partial solution here, which is to add my maven target lib folder to the EAR Deployment Assembly (double-click in the Deploy Path box to edit). This works, but m2e (or m2e-wtp) undoes the config change when I do Maven > Update Project.
There ought to be a cleaner solution. The Eclipse Ear Module Assembly dialog has a field to name the "EAR library directory", so it's aware of the lib folder. Where does Eclipse EAR assembly (without Maven) look for jars to put in the lib folder? I assume the Glassfish plugin is looking in the same place.
You can use the following steps to find the source of the problem:
Take Eclipse out of the equation and build EAR on command line using Maven, does it turn out ok? If not, look for a solution in your pom.xml.
If ok so far, open Eclipse and perform Maven -> Update Project. Then export EAR using Eclipse (look for EAR export wizard under File -> Export). Did the exported EAR turn out ok? If not, file a bug report for m2e-wtp plugin. It is still pretty raw, so it wouldn't be surprising if it doesn't setup Eclipse metadata correctly in some cases.
If ok so far, then it is time to look for a problem in Glassfish plugin. I doubt that you will get this far, but if you do I will help you to follow up.

Eclipse not deploy all the jar files for a web app

We have a non-trivial multi-module maven project, then have a single module maven web-app that depends on 2 modules in the larger multi module project.
When we use eclipse to deploy to tomcat, it doesn't deploy all the jars that are required (spring, camel, etc) by the projects in the multi-module projects, but the multi-module jars are present???
But if we were to do an export of a war file on the single module app it includes everything we need spring, camel, and all the multi-module jars as expected? Why do export and deploy work differently and how can I get deploy to work the way I want.
We are using eclipse 3.6.2 with m2eclipse and other plugins. It seems Eclipse Indigo is worst at handling maven projects than 3.6.
This seems to be the same problem that I encounter semi-regularly. Open the build path for the project, and in the Exports tab, check the Maven dependencies checkbox. Do a clean and reploy the webapp.
It may be necessary to remove & readd the webapp to the server, and I usually have to quit Eclipse and restart it.

M2Eclipse and EAR projects on Weblogic

How can I import a maven EAR project into Eclipse 3.4, and be able to use the IDE (WTP) to deploy the ear successfully to Weblogic (9.2)?
The main issue is that the dependent jars are not being included in the ear (under APP-INF/lib) when it gets deployed through the IDE. When I build from command line, the ear is exactly how I want it.
I am using the APP-INF/lib configuration for the ear plugin, and have included the jarModule sections for all the required jars.
When editing the eclipse EAR project's Java EE components, all the jars are listed, but not in the APP-INF/lib. Only when I open a dependent jar project do those specific jars get set under that subfolder. All the 3rd party jars are showing they will end up in the wrong place.
If you need more info, just let me know. Thanks!
You might want to use maven to create the eclipse WTP projects for you. This might be helpful.
The Using maven-eclipse-plugin in multi-module projects with WTP of the maven website describes how to develop Multi-module projects with Maven and Eclipse efficiently using the best of both Maven 2 and Eclipse's WTP. This covers projects that have EJB and EAR modules.
An fully working example of a multi-module projects, containing some JAR-, a WAR- and an EAR-project is even available for download if necessary.