facebook

Maven generate-classpath causes tomcat deployment failure

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #268116 Reply

    Mike
    Member

    We use maven for our applications and follow the maven rules for directory structure. When using the maven eclipse plugin, we are able to update the libraries used by the project. However when I have updated my project.xml with a new library and I use the maven eclipse:generate-classpath feature, I need to refresh my project. That is when the problems begin.
    The refresh causes the src\main\webapps\WEB-INF\classes directory to appear in my project, although my build path configuration says it should be building the classes in target\classes. For hot code-change deployment it has to be in target-classes.
    So when I have done the refresh of the project I get the WEB-INF\classes directory and my hot deployment won’t work anymore. When I remove the WEB-INF\classes folder, the next deployment (even when forcing a clean) is missing the classes folder in WEB-INF in Tomcat.

    So this means basically I have to remove web capabilities from the project, then change the focus to a package, then change to the project again to add web capabilities. Then I have to change the buildpath again to target\classes instead of src\main\webapps\WEB-INF\classes.
    Once I have done this I can succesfully redeploy again.

    Does anyone else have the same problem? Does anyone have a solution?

    Thanks!

    #268144

    Riyad Kalla
    Member

    The refresh causes the src\main\webapps\WEB-INF\classes directory to appear in my project, although my build path configuration says it should be building the classes in target\classes.

    Open your project properties and go to Java Build Path > Source tab, then double check that the output dir is set to what you need it to be. Also make sure that each source folder (if there are multiple ones) don’t have separate Source folders setup.

    When I remove the WEB-INF\classes folder, the next deployment (even when forcing a clean) is missing the classes folder in WEB-INF in Tomcat.

    MyEclipse doesn’t support Maven2 at this point, so I’m not sure if you are using your Maven plugin, Ant or MyEclipse to deploy your project. If you are using MyEclipse, it deploys everything under your Web Root to the app server. So if you have moved this output dir somewhere else other than the standard WEB-INF/classes location, MyEclipse won’t be able to deploy it.

    #268171

    Mike
    Member

    Sorry I was not clear. I am using Maven 1 and Mevenide. But even when I use maven on the command prompt I get this problem.

    The issue is that a project with Web capabilities cannot be refreshed without breaking the hot code deployment. The refresh causes my WEB-INF\classes directory to become visible, which causes every deployment to use that classes folder instead of the target\classes folder which contains the new code.

    So what you are saying that the default Maven directory layout, being target\classes cannot be used with MyEclipse?

    #268180

    Riyad Kalla
    Member

    So what you are saying that the default Maven directory layout, being target\classes cannot be used with MyEclipse?

    It cannot be deployed from MyEclipse, but you should be able to atleast work with it. Did you try my tips about setting your output dir? The only reason this dir should ever get created is if you have it set as an output dir.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Maven generate-classpath causes tomcat deployment failure

You must be logged in to post in the forum log in