- This topic has 4 replies, 4 voices, and was last updated 13 years, 6 months ago by support-tomasz.
-
AuthorPosts
-
Henning SchmiedehausenParticipantEver since Maven support was added to MyEclipse, deploying these projects to an application server is broken:
I used 8.0, 8.5, 8.6 and now 9.0M1 and they all show the same behaviour. This is a systematic bug in the DeploymentBuilder that has been there forever.
I tried using the embedded maven (3.0-SNAPSHOT) installation and an external 2.2.1 installation.
I reproduced this problem on Linux running Sun 64 Bit Java 1.6.0_20 and on MacOSX running the latest Java 1.6 version.
I tried various application servers, mostly Jetty 5,6 and 7 and Tomcat 5 and 6. I did limited tries with other servers.
Here is how to reproduce the issue:
I have a web project WEB. This project depends on another project, DAO. Both are part of a maven multi-module build and loaded into MyEclipse 9.0M1.
Both projects are maven enabled.
WEB has a src/main/webapp folder with a WEB-INF/web.xml file in it. It has added web project capabilities. It is also configured to do “smart” deployment.
I have a locally installed application server (I usually use Apache Tomcat or Jetty but I tried various others and they all have the same problem).
WEB is deployed into the local application server at /web. Deployment is in “exploded” mode for debugging.
On the Package Explorer, the WEB project shows the “Maven Dependencies” library. I have enabled “Resolve dependencies in workspace”, so the DAO project is not shown as jar (DEP-1.0-SNAPSHOT) but the actual project is shown as a dependency.
Both projects compile fine on eclipse.
The WEB project contains the following classes:
src/main/java/web/classA src/main/java/web/classB src/main/java/web/classC
The DAO project contains the following classes:
src/main/java/dao/daoA src/main/java/dao/daoB src/main/java/dao/daoC
When I now deploy the WEB project into the application server, I expect so see:
webapps/WEB/WEB-INF/classes/web/classA.class webapps/WEB/WEB-INF/classes/web/classB.class webapps/WEB/WEB-INF/classes/web/classC.class webapps/WEB/WEB-INF/classes/dao/daoA.class webapps/WEB/WEB-INF/classes/dao/daoA.class webapps/WEB/WEB-INF/classes/dao/daoA.class
However, what i see is:
webapps/WEB/WEB-INF/classes/web/classA.class webapps/WEB/WEB-INF/classes/web/classB.class webapps/WEB/WEB-INF/classes/web/classC.class
The dao classes don’t show up. The problem is, that the Deployment Builder for “smart” deployment does not understand the Maven dependencies and removes the classes from Maven dependencies before it deploys the actual project classes.
If you open “WEB” -> “Properties” -> “Builders” and uncheck (!) the Deployment Builder, then all the classes show up. However, when unchecking the deployment builder, then all the libraries in WEB-INF/lib disappear, so that is not a viable workaround.
What also works is if you close the “DAO” project in the workspace. In that case, Maven will pick up the DAO-1.0-SNAPSHOT.jar from my local repository and deploy this into the WEB-INF/lib folder just fine. However, then it is no longer possible to work on the two projects at the same time.
WTP from the Eclipse JEE project gets this right. The problem exists in the enhancements that Genuitec added to the Deployment Builder with ‘smart’ deployment.
This is a serious issue that has bitten me for a very long time. We are on the verge of throwing out our MyEclipse license and going back to WTP because of that (using Maven and Web projects is pretty much all we need MyEclipse for) and this functionality is broken for us ever since at least MyEclipse 8.0.
If you need more information about this, my setup or a set-by-step project setup to reproduce (with screen shots). Getting this bug fix into the 9.0 release would be a make-or-break decision point to continue using MyEclipse.
Personally, I would like to suggest to Genuitec to fix such long standing bugs, instead of adding more “enterprisey” features.
deeeedMemberI have the exact same problem which took me several hours to figure out.
This is not the first time I have problem because of Maven support in Myeclipse and I am really thinking about completely stopping using myeclipse.
Did you find a workaround ?
support-joyMemberdeeeed, hgschmie,
My apologies for the late reply. I have escalated this to dev team members. They would get back to you on this.
Sorry for the inconvenience cause.
deeeedMemberSo Far the only solution I found to make it work again is to remove the .metadata folder and loose all my workspace settings: Working from a “clean” workspace make it works again.
This is clearly not possible to keep this as a “solution” and the problem happens everytime I run “Run as->Maven …”. It will change the default output directory for the compiled class to “target/classes/” and then when I want to switch back to “src/main/webapp/WEB-INF/classes/” the files are not updated on the server deployment.
I am not using myeclipse anymore, I spent too much time figuring out these issues and I can’t afford to spend more.
support-tomaszMemberHgschmie, The compiled classes for DAO project schould be visible in DAO classes folder and from there are referenced to Your web project. Will this answer help You?
Deeeed, You can specify in Maven pom.xml any output folder You like, not depending from the MyEclipse configuration
For example:
<build>
<outputDirectory>…….</outputDirectory>
<testOutputDirectory>………</testOutputDirectory>
</build>
Will this answer help You? -
AuthorPosts