MyEclipse: Workspace Resolution + Glassfish
maiconramones - Jan 20, 2012 - 01:04 PM
Post subject: Workspace Resolution + Glassfish
Hi guys I'm here again...
I have two projects in my workspace. One project is a jar and other is a war.
So the war project depends on jar. But when "Enable Workspace Resolution" is activated the MyEclipse doesn't export the project as jar (or other form) into Glassfish (3.1.1).
The Glasssfish doesn't found any class (of jar project) and my web app not was deployed.
The "Enable Worskpace Resolution" is necessary for hot deploy.
support-tony - Jan 23, 2012 - 10:07 AM
When deploying to servers using normal MyEclipse deployment functions, maven isn't used. Maven functions are only used when building with Maven (such as Run As->Maven Build...) The deployment of dependencies is controlled through preferences. Right click on the web project and select Properties. Now go to the MyEclipse->Web page and the Deployment tab. You can modify how dependent projects are deployed from there.
Let us know how you get on.
maiconramones - Jan 23, 2012 - 04:57 PM
So, what's the option I should mark to export my jar dependency (project referenced by Maven4MyEclipse -> "Enable Workspace Resolution")??
Because any combination marked doesn't work. My referenced project wasn't deployed as jar.
How to exported my project referenced with "Enable Resolution workpace" marked?
Now my new package is not exported to server... :(
support-tony - Jan 24, 2012 - 07:41 AM
Do you have the dependent project included in the web project's pom? If not, please add it, using the pom editor or simply right-click on the project and go to Maven4MyEclipse->Add Dependency. Once the dependency is added in the pom, right click on the project again and select Maven4MyEclipse->Update Project Configuration and follow the wizard.
Check that the dependent project is now in the deployment assembly: right click on the project, go to Properties and then the MyEclipse->Deployment Assembly page. The dependent project should be there. Select an appropriate deployment policy, as mentioned previously, and deployment of the dependent project should now work.
Please let us know if this works.
maiconramones - Feb 06, 2012 - 06:42 PM
Hi. Sorry for taking so long on answering...
In Web Deployment Assembly I selected my project (jar) to assembly in WEB-INF/lib.
But not assembly my project in WEB-INF/lib.
What can be?
support-tony - Feb 07, 2012 - 05:06 AM
I can't replicate your problem. I don't have any problem setting up a maven web project with a dependent maven java project and get a successful deployment. Just to confirm what I've done -
I created a maven web project. I created a maven java project. I added the maven java project to the maven web project dependencies in the pom. I ensured that the workspace resolution was enabled. I also ensured that the dependent project deployment policy was set to smart deployment (though I don't think this is necessary). I can now deploy the web project to the glassfish server and can reference classes in the dependent project.
Is it possible for you to send us zipped copies of the two projects that are causing problems, so that we can investigate further? If they are not more than a few megabytes, you can attach them in an email to email@example.com, with "ATTN: Tony" in the subject line and a link to this forum topic in the email. If you can't send the projects, please attach the poms for the two projects, as that may help.
Also please attach your installation details (which can be found through the menu item MyEclipse->Installation Summary, and then clicking on the Installation Details button.
maiconramones - Feb 07, 2012 - 05:01 PM
Hi Tony, thanks for your answers...
I closed and open the MyEclipse and I repeated all steps...
So now it works \o/ but I have one question.
In the page "Web Deploy Assembly" the "Deploy Path" is displayed as WEB-INF/lib/myproject.jar. But not generated the jar in WEB-INF/lib folder.
My project was exploded in WEB-INF/classes.
Question: Whats is the correct? Jar or exploded?
support-tony - Feb 08, 2012 - 03:50 AM
I'm glad your deployment is working now.
I just checked and the Web dependent project deployment setting does affect this. Right click on the project and select Properties. Go to the MyEclipse->Web page and click the deployment tab. If the Web Project Deployment Policy is set to "Use workbench default settings", click on the link, "Configure workspace settings", to see what the workbench default is. If Smart deployment is being used, then where the dependent project classes are placed depends on how the main project is deployed. I assume you're using exploded deployment. In this case, the classes of the dependent project are merged into the classes directory of the deployed application. Otherwise, the classes are jar'ed and put in the WEB-INF/lib folder.
You can check this by looking at the deployment location (a quick way to get to that is from the Servers view - expand your server to see your project deployment, right click on the project and select "Browse deployment location"). Check that the dependent project classes are in the classes folder under WEB-INF.
If you alter the Web Project Deployment Policy to "JAR and place them in the /lib directory", then you'll get what you expected.
I hope this explains things for you.
All times are GMT - 6 Hours
Powered by PNphpBB2
© 2003-2004 The PNphpBB GroupCredits