Eclipse mvn project deploy to jboss - eclipse

I changed my project to use maven2 (from just plain eclipse dynamic web project) and now I can't do Debug As > Debug on Server (JBoss).
Previously I can just do Debug As > Debug on Server (JBoss) and Eclipse will happily copy the war file into jboss deploy directory and I can debug etc.
Now it seems like eclipse just don't recognize the maven2 project and therefore cannot package the war file?
I have to deploy it manually using the command line mvn war:war and copy the war file to deploy directory.
What can I do to make Eclipse understand mvn project so I can just do Debug As > Debug on Server?
Eclipse 3.5

Use m2eclipse (and the extra Maven Integration for WTP). Once installed, Import... your webapp project as Existing Maven Projects and it will get imported as a dynamic web project.

Related

deploy my project directly without copying always the war file

I'm running a web application with maven + spring mvc + spring data jpa with apache tomcat in eclipse.
I want to deploy my application without opening eclipse and run tomcat inside it, so i have to export my project into war and copy it into apache-tomcat-7.0.42\webapps directory and it's working good.
My problem is that i want to work directly into apache-tomcat-7.0.42\webapps with eclipse so like that i don't have to export my war file after every changes in my code.
Just configure the Tomcat as server in eclipse and run the project from eclipse.
To configure tomcat in eclipse:
In Eclipse, go to Windows->preferences->Servers->runtime Environment, add tomcat here.
To run the project from eclipse:
right click project in Eclipse's project explorer and select->run as->run on server. select the tomcat you configured.

Using Jboss with maven eclipse project

I have create a maven project in eclipse .
I want to build my maven project using jboss and also debug it while running
Can any one share there code please on hot to use jboss with maven project.

maven and eclipse builds differently the same project

I have a java ear maven project.
When I publish the ear to jboss7 via eclipse it generates an ear and deploys it to jboss.
But when I manually run a maven build of the same project I get a different ear in size and also the name is different.
When eclise builds the project when executing "publish to server", doesnt it use the same build as maven?
I use eclipse juno and maven3. I'm new to maven.
Eclipse uses the .classpath to package the ear that gets deployed to jboss. When you do a manual maven build it is using the pom.xml file to package the ear. If those aren't in sync you could get differences in your ears.

missing jars when publishing a web app to glassfish with eclipse juno and maven integration

I use eclipse juno with GlassFish Server Open Source Edition 3(java EE6), m2e and maven 3.0.4.
When I create a war file by 'mvn package' command and deploy it to a glassfish,
the war file works just fine.
However, when I publish a web app to a glassfish from the server view of eclipse,
the web app fails.
I guess the reason of this failure is that publishing from eclipse is not configured correctly
to get jars from my maven repository and then jar files in eclipseApps//WEB-INF/lib directory are missing.
Can I configure eclipse to use a maven configuration when publishing a web app to a glassfish?
Thanks.
I found the answer
"anyway I solved the issue by adding following row Properties > Deployment Assembly: /target/myapp/WEB-INF/lib -> WEB-INF/lib"
in
Glassfish Deployment out of Eclipse Helios SR2 fails
Thanks.

Maven Tomcat Project Process Simplification

I'm working on a Maven project in Eclipse, where I'm using Maven (mvn install) to create my WAR file and run it on my Tomcat server. However, every time I change my application, I have to execute mvn -o compile war:exploded and sometimes have to restart Tomcat.
Is there any other way to simplify this long and heavy process?
You may start using:
m2e ( maven to eclipse integration ) -> http://www.eclipse.org/m2e/
Eclipse WTP ( web tools platform ) -> http://www.eclipse.org/webtools/
WTP will allow you to run Tomcat from eclipse and m2e will take care of converting your Maven build into Eclipse project and integrating it with WTP.
If you are using eclipse then you need not to use mvn -o compile war:exploded every time. But yes, you need to use mvn install each time you make a change in your application.
This is what you need to do:
Open Server View
Open expected tomcat server settings. A settings window for tomcat will be opened.
Select modules tab.
Choose Add external web module. An input form will be opened.
Browse to your application's target (generated by maven) folder and then select already exploded war directory and set it as Document Base
Enter Path as the base url for your application.
This is just one time effort.