Maven doesn't recognize EJB as dependency of project when trying to define module

后端 未结 1 1111
余生分开走
余生分开走 2021-02-04 01:57

Today I upgraded my local Glassfish server to 3.1.1 in preparation for my company\'s upgrading of the servers to the same version. I am attempting to convert my web service proj

相关标签:
1条回答
  • 2021-02-04 02:43

    The answer ended up being pretty simple, and I'm kicking myself a bit for it. In the webapp's pom file, I just had to add the scope line to the ejb dependency:

    <dependency>
        <groupId>com.groupId</groupId>
        <artifactId>webservice-service-ejbs</artifactId>
        <version>${project.version}</version>
        <type>ejb</type>
        <scope>provided</scope>
    </dependency>
    

    With this, I could keep the ejb dependency in the ear pom, application.xml generated properly and glassfish 3.1.1 didn't get confused thinking there were multiple ejb classes with the same name.

    EDIT: Here's what the ejb dependency looks like in the ear pom

    <dependency>
        <groupId>com.groupId</groupId>
        <artifactId>webservice-service-ejbs</artifactId>
        <type>ejb</type>
    </dependency>
    

    Thanks to those who helped me out.

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