Hot code is not working in Maven project using Eclipse - java

My EAR is deployed in JBoss 1.7 and it's a Maven project. I export this Maven project as Java project. Hot code is not working for me. I tried the below points:
Enabled build automatically
Disable "Abort build when build path error occur"
Removed unwanted projects from project tab

Related

Eclipse don't deploy maven dependencies

I have a ear project with maven and i want to hot deploy in a jboss with eclipse (m2e/jboss tools).
The ear has a two war and one ejb modules. The problem is when i deploy the ear (Server > add remove and clean/publish) the lib folder of the ear is empty when i expect find the ejb dependencies inside.
If i run "mvn clean install" the generated ouptput are correct and the eclipse "ear deplyment assembly" of the project are updated and show the dependencies. If, in the deployment assembly, delete one of the dependencies and add it manualy (exact same configuration relative .m2 folder) then it deployed.
Workstation:
Windows 7
Jboss 5.2 EAP
Eclipse Oxygen/ Proton and Red Had Developer Studio 12
Java 1.8.0_181 (eclipse) Java 1.7.0_75 (jboss)
Maven embedded 3.5.3 and exgternal 3.5.4
Any idea?
Thanks
I think I found the problem and the solution.
The problem is eclipse sets by default the oldest version of the EAR (1.3). If I add <version> X </ version> in the configuration of maven-ear-plugin, the problem will be solved.
To force eclipse to update the configuration, delete the project, run mvn eclipse: clean clean (verify that all eclipse settings have been removed) and re-import the project (mvn install && maven -> update project). If I check the facets of the project configuration, I will now show the new version.

Maven Dependencies disappears from deployment assembly after Maven update

I am making a webapp using maven. The problem is that everytime I do maven update project, the Maven Dependencies library disappears from the deployment assembly to WEB-INF. I have to re-add it manually every time. It is similar to problem 1 in this post: Eclipse + Maven + Dynamic Web Project -> Maven overwrites Deployment Assembly
His solution was to update eclipse, but I am already on newest version (mars) and I have all maven plugins installed properly. I know this because I have another web application built using maven that working completely fine without this issue. I've looked through a bunch of settings and the two look completely identical, so I cannot figure out why. Is there some place where I can set so the Maven Dependencies are added automatically to the deployment assembly even after maven update project?

Grails equivalent for Gradle Eclipse plugin?

I just cloned a Grails project to my local machine (using Mercurial). I am using GGTS for Grails projects, and would like to import the Grails project as an existing project. With a Gradle-built project, I would just apply the Gradle Eclipse plugin and then run gradle eclipse inside the project root.
This generates Eclipse project files and classpath magic for me, so I can import it into my Eclipse workspace.
I'm using GGTS for my Grails projects. But when I open up GGTS and go to Import >> Existing project, and select my Grails project (root dir), it doesn't see the necessary Eclipse project files and can't open it up.
So I ask: is there an equivalent "Grails Eclipse/GGTS" plugin that will allow me to take a Grails project that has no Eclipse files (.project, etc.) and generate them?
The command you are looking for is the Grails command integrate-with. You can read more about it in the Grails documentation.
The integrate-with command will integrate Grails with different IDEs
and build systems based on the arguments provided. For example the
--eclipse command will produce .project and .classpath files for use with Eclipse or Spring Tool Suite (STS).

How to deploy a Maven WAR to JBoss EAP 6.3 within Eclipse Luna

I have read every page that shows up on the first Google result page with that search. But nothing seems to help.
Of course I can run "mvn clean install" in or out of Eclipse and get the .war generated in the target folder. I can copy the .war in the deployments folder of JBoss installation myself. And then I can start the server through the server adapter in Eclipse.
But I want that "manual copy of war" to be automatic as well.
How can I do this? What do I need to do to add a new item to "Run As" menu, say, "Maven JBoss Deploy" where underneath, it does a clean, install, deploy (copy to deployments)?
I have Maven 3.1.1 installed separately (outside of Eclipse) and I have told Eclipse where my Maven is. I have JBoss Tools (latest version) installed with JBoss Maven Integration part of it.
I just don't see any way to integrate JBoss and Maven within Eclipse :(
You can do with fileName tag
<fileName>${basedir}/target/webapp.war</fileName> in pom.xml
or
You can go with Profiles in pom.xml
More 1
More 2
By trial and error, I was able to get Eclipse to deploy a maven project WAR on JBoss.
I just needed to have "Dynamic Web Module" facet attached to the project. I did that using the Project properties in eclipse.
Now I am able to right click the project and Run As Server and that deploys to JBoss. And the project is still a Maven project. Yay!

Eclipse maven-enabled web app references workspace projects, but those are not deployed when running Tomcat server

I have a web application (Eclipse's Dynamic Web App) which uses Maven (m2e-wtp) for the build and dependencies management. This web app's POM references a few other projects in my workspace, which happen to be eclipse plugins built with maven as well (built using Tycho), and also other third party libraries which come from Maven's repository.
Everything works fine when I run maven from the CLI. All dependencies are included in the WEB-INF/lib directory just as expected.
The problem is when I attempt to run the project using Eclipse. I run the app in a configured Tomcat server inside Eclipse, but the referenced projects in my workspace are not added to the deployed war.
I tried adding them to the Deployment Assembly (under project preferences), and that works perfectly, but those settings get wiped out by m2e every time the maven configurations are updated. I read in a few places that we should not manually add entries there since all dependencies should be managed by m2e...
The question is: How to make Eclipse add the workspace project dependencies to the WEB-INF/lib of my web app when I run it from Eclipse?
I'm using Eclipse J2EE 4.3.1 (Kepler SR1).
I also tried right-clicking the project and selecting Export -> WAR file, but the exported WAR file doesn't include the referenced workspace projects either. I'm assuming the issue is affecting both cases.
This is extremely annoying ans is slowing me down quite a bit.. at this time I have to re-add the projects to the Deployment Assembly page several times a day to keep it going...
UPDATE: The workspace projects I added as dependencies in the POM appear in the list of Referenced Projects, under the project's properties. But when I expand the Maven Dependencies in the Project Explorer, the workspace project dependencies are missing from the list! Only the ones in the Maven repository show up. They local ones seem to be silently ignored...
I had similar problem because I created the project outside eclipse, and them imported it. What worked for me was to add the right project facet: Project context menu -> properties -> Project Facets -> Dynamic Web Module (choose right version). I was using Eclipse ADT (version 4.2.0), but, to avoid having multiple installations, I use the same eclipse for Android and other kind of apps.

Categories