Why does the WTP plugin deploy one Maven dependency as a folder, instead of a jar?

前端 未结 4 874
小鲜肉
小鲜肉 2021-02-08 07:53

I have a very strange problem with Maven and the Eclipse WTP. I have a multi-module project, let\'s call it project. It consists of two modules project-base

相关标签:
4条回答
  • 2021-02-08 08:02

    I was just having the same problem. Upgrading m2e to version 1.2 fixed it.

    0 讨论(0)
  • If that folder is an exploded JAR (so it is like a JAR file, but appearing as a folder, not archived), in my case it was a server connector issue.

    Although I use JBoss instead of Tomcat, this might be helpful for others struggling with this problem.

    Provided you have the latest JBoss Tools installed on your Eclipse, you can double-click the server in Server view to open the settings.

    On Deployment tab, you can select Zip Module Yes/No for each project. When I selected YES for my utility jar files, JBoss then deployed the dependency as a normal JAR file instead of a folder.

    0 讨论(0)
  • 2021-02-08 08:16

    I ultimately solved my problem: I had problems with the properties section Deployment Assembly for the project-base project. I could not save it, as Eclipse mentioned, the current page does contain errors.

    I then looked into the settings file .settings/org.eclipse.wst.common.component. It was completely empty (I don't know why). I then added the following block:

    <?xml version="1.0" encoding="UTF-8"?>
    <project-modules id="moduleCoreId" project-version="1.5.0">
        <wb-module deploy-name="project-base">
            <wb-resource deploy-path="/" source-path="/src/main/java"/>
            <wb-resource deploy-path="/" source-path="/src/main/resources"/>
        </wb-module>
    </project-modules>
    

    After this, the settings page is accessible again and the JAR is assembled correctly. Workspace resolution does work, too.

    0 讨论(0)
  • 2021-02-08 08:26

    I solved the problem by deleting the dependency in the "Deployment assembly" project settings page and adding it back.

    0 讨论(0)
提交回复
热议问题