- This topic has 8 replies, 2 voices, and was last updated 15 years, 9 months ago by aqbrown.
-
AuthorPosts
-
aqbrownMemberHi,
I have a project that needs to work with both Maven and in eclipse. java sources are in /src/main/java and resources in /src/main/resources. These two folders are listed as source folders in eclipse, and they compile to /target/classes.
The web root folder is /src/main/webapp. The eclipse project is maven enabled.
When I deploy to the sandbox, only the /arc/main/webapp resources are put into tomcat. The lib folder is built with the Maven dependencies in th exploded deployment. But the classes folder in WEB-INF does not exist. I have to copy the classes folder to the webapp/WEB-INF folder by hand to get the classes deployed. Howver, if I do this there is no automatic code replacement and the debugger does not stop on breakpoints.
Another really strange thing is I have another project in the workspace, and if that project is open its compiled targets in its /target/classes are copied to the WEB-INF/classes folder in the deployment !
The other project is not a web project and is not a dependent project.What exactly is required to get this to work. Can you explain the rules about how the builders are supposed to work ?
support-eugeneMemberUnfortunately, this scenario is not yet supported. We plan to work on proper Maven deployment support in our next releases.
aqbrownMemberOk, so it is not supported, but can you tell me how the deployment builder works so I can do something in the meantime ?
How does it determine where to obtain the classes for the WEB-INF folder ?
It certainly seems that no matter what support for Maven there is, the builder is not working right by incorporating unrelated projects into the deployment.
support-eugeneMemberThe classes should be built to ${webroot}/WEB-INF/classes
aqbrownMemberRight, but how is the builder deciding what classes to put there ?
support-eugeneMemberSee Java Build Path project property page, Source tab. MyEclipse will configure this using your pom.xml.
aqbrownMemberExcept … it is not respecting the values listed for the build path target folders as configured in eclipse. But, maybe it is getting confused since the pom does not explicitly list the target destination but relies on maven defaults. I will try explicitly listing it in the pom to see if that works.
support-eugeneMemberIt is not designed to work with output folders other then WEB-INF/classes. There are some conflicting requirements that mandate such behavior.
aqbrownMemberOk I got it working.
setup was :
default build target : src/main/webapp/WEB-INF/classes
webroot : src/main/webappand, most important of all, I disabled workspace resolution in Maven4MyEclipse. Not sure what use this setting really has but it was pulling in all projects in the workspace as Maven dependencies even if the dependency was not in the pom. By disabling this I prevented the deployment of unwanted classes and resources from other projects to WEB-INF/classes This was the original problem that sent me on my journey trying to specify the build paths, which led to it not finding the classes for deployment.
-
AuthorPosts