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

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.

Related

Issue deploying EAR project from eclipse to EAP 6.2.0 using JBoss Tools Plugin

I have a maven EAR project, which contains a couple of WAR and JAR files. I'm using Spring STS IDE with JBoss Tools 1.6.0 (latest).
When I try to deploy my EAR to JBoss EAP 6.2.0 with JBoss Tools from STS i'm facing the following issues.
My Jars (external jars and project jar) are getting copied into WEB-INF/lib and EAR/lib, where i expected it to be only in EAR/lib.
EAR application.xml is not getting copied into EAR/META-INF/ folder
But when i use terminal to build my project and deploy EAR, i'm not experiencing these issue and JBoss starts without any problem
Here's its solved JBIDE-19047 The main issues are,
jars are getting copied into WEB-INF/lib due to skinnywar not supported by eclipse m2e-wtp plugin and this can be solved by adding <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes> in war plugin configuration.
application.xml not getting copied into ear/META-INF/ folder, if you have any unresolved dependency in any of the pom then this would occur, so make sure all jar dependencies are available.

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.

deploying a war file in WTP(Eclipse) tomcat server

I have a maven build Java project.
My war file name is: test-1.0-SNAPSHOT.war
I am using M2E plugin in Eclipse.
I have run target mvn package.
Added server as tomcat version 7 in eclipse indigo 3.7. Server started. But my war file didn't deployed in the server.
I have tried by right clicking tomcat server and Add remove..., it says "there is no resources that can be added or removed from the server".
How can i deploy my war file in the eclipse WTP tomcat server?. Do i need to run any maven target?
Make sure that you have "Maven Integration for WTP" installed in your Eclipse instance.
First check if it's available through
Window->Preferences->Maven->Discovery->Open Catalog
If for whatever reason this does not work, you can get WTP integration from this update site (that's the version I am currently using):
https://repository.sonatype.org/content/repositories/forge-sites/m2eclipse-wtp/0.13.0/S/0.13.0.20110623-0455
This integration does a lifecycle mapping of maven-war-plugin into m2e architecture.
Once you've installed the WTP integration, you must restart eclipse and once it's restarted, right click on your web app project and choose: Maven->Update Project Configuration...
Also, I would advise to run a clean build at this time.
Last, but not least, delete and recreate your Tomcat server configuration (I don't know why, but I had to do it quite a few times when I switched to m2e).
I think eclipse is not recognizing your project as a web app, To confirm this
Open to do open J2ee perspective on your eclipse, If you open the project folder of your app, You should see (Deployment Descriptor)
If you don't see it, your app is not web app as far as eclipse is concerned
I have see this in case if you imported/created a maven command line project
To fix this
Select Project ==> Properties ==> Project Facets ==> make sure Dynamic Web Module check box is checked
If you do that the local tomcat server will add your app when do add remove projects
I think eclipse is not recognizing your project as web app,convert your project into web app by command mvn eclipse:eclipse -Dwtpversion=2.0 and try to deploy in Eclipse configured tomcat,it will work.
If you have Eclipse 3.5 or above you should ensure that you have both the m2eclipse (m2e for 3.7) plugin installed and its WTP add-on. With these you shouldn't need to change your configuration by hand.
Did you try to build your project from the command line and deploy it in Tomcat by hand?
By the way, have you read this wiki post? It's a bit old, but it may still be relevant.
Adding 2 cents to Prasanna wonderful solution.
I realized that building maven war files "mvn package" was just creating .war file but eclipse was not picking up that war but was deploying its some internal version of it's app war.
I found that server > Browse Deployment Location.. in Eclipse server view .. it was taking to some abstract location like "C:\Programs\workspaceSTS.metadata.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps"
Where I could see my exploded app deployed but it was not having any /classes folder just limited files.
Using Prasanna's method I realized that eclipse now was deploying full exploded .war now.
So this was happening coz changing the facets to Dynamic Web Module has actually populated "R-click project > Properties > Deployment Assembly "
This Web Deployment Assembly window only tells eclipse what to deploy and what not. So even if your project is NOT setup as Dynamic Web Module , and still if you configure "Web Deployment Assembly" values properly , eclipse will deploy the app fine to Tomcat/ Server.

EAR with EJB and WAR modules fails to deploy WAR dependencies

I have an EAR that has many EJB modules and one WAR. The WAR dependencies are not picked up. There are only 3 of the WAR dependencies that are not already included in the EAR. These are ones that break the deployment. The target web logic server starts in Eclipse but the app fails to publish. As a test, when I add the missing WAR dependencies to any of the EJB modules they are picked up.
The problem was with certain versions of the m2eclipse plugin from Sonatype.
Some versions of the plugin do not correctly propogate the dependencies for the web project (WAR).
The plugin that works is the one that is installed in version 3.6.2 of eclipse. The one in 3.6.0 doesn't work.
Once I woved to version 3.6.2 of eclipse the problem went away.
Granted the issue may also have been tied to the plugin verions PLUS the version of eclipse.
Here are the maven plugin and eclipse details:
Works:
m2eclipse - 0.12.1.20110112-1712 running in Eclipse Java EE IDE for Web Developers Helios Service Release 2 Build id: 20110218-0911
Doesn't work:
m2eclipse - 0.12.0.20101115-1102 running in Eclipse Java EE Version: 3.6.0 Build id: I20100608-0911

Maven/Jetty to Maven/Tomcat Project

I have a project that I created with the Maven Archetype plugin and I added the Maven Jetty plugin so I can run the jetty server with "mvn jetty:run-war".
Now I have to change my project so that it integrates with Eclipse and Tomcat. I remember working on some projects which when I clicked the Tomcat button from the Sysdeo Eclipse Tomcat Launcher plugin, it would automatically compile the new code, deploy it to the Tomcat's webapp folder, and start the Tomcat server for you. Using tomcat also allows us to use the integrated Eclipse debugger.
How do I get that effect with my current Maven/Jetty setup without re-creating the entire project over again and starting it as a Tomcat project?
You can try using Tomcat Maven Plugin. It has similar goals to the jetty plugin. You just need to add the plugin configuration to your existing pom and make no additional changes.