6

I am using Spring Tool Suite 3.6.3 and M2E eclipse plugin 1.4.1, when I opened the POM file from one of the project, I observed not all the dependencies are getting added, I have added depnedecy configuration for jaxws-rt with version 2.2.8 which has many dependencies as follows

    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
    </dependency>
    <dependency>
        <groupId>javax.xml.ws</groupId>
        <artifactId>jaxws-api</artifactId>
    </dependency>
    <dependency>
        <groupId>javax.xml.soap</groupId>
        <artifactId>javax.xml.soap-api</artifactId>
    </dependency>
    <dependency>
        <groupId>javax.annotation</groupId>
        <artifactId>javax.annotation-api</artifactId>
    </dependency>
    <dependency>
        <groupId>javax.jws</groupId>
        <artifactId>jsr181-api</artifactId>
    </dependency>
    <!-- Provided dependencies -->
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-core</artifactId>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>policy</artifactId>
    </dependency>
    <dependency>
        <groupId>org.glassfish.gmbal</groupId>
        <artifactId>gmbal-api-only</artifactId>
    </dependency>
    <dependency>
        <groupId>org.jvnet.staxex</groupId>
        <artifactId>stax-ex</artifactId>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.stream.buffer</groupId>
        <artifactId>streambuffer</artifactId>
    </dependency>
    <dependency>
        <groupId>org.jvnet.mimepull</groupId>
        <artifactId>mimepull</artifactId>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.fastinfoset</groupId>
        <artifactId>FastInfoset</artifactId>
    </dependency>
    <dependency>
        <groupId>org.glassfish.ha</groupId>
        <artifactId>ha-api</artifactId>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.messaging.saaj</groupId>
        <artifactId>saaj-impl</artifactId>
    </dependency>

    <dependency>
        <artifactId>woodstox-core-asl</artifactId>
        <groupId>org.codehaus.woodstox</groupId>
    </dependency>
    <dependency>
        <groupId>org.codehaus.woodstox</groupId>
        <artifactId>stax2-api</artifactId>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.sun.org.apache.xml.internal</groupId>
        <artifactId>resolver</artifactId>
    </dependency>

In STS when I open the POM, and navigates to the Dependency Hierarchy, I am not able to see policy, resolver and streambuffer dependencies.

But when I run mvn clean install from command prompt, all above mentioned jars gets added to .war file.

I think there is some issue with the m2e + STS, not sure why m2e is not able to get those missing dependencies.

  • both are pointing to different `settings.xml` ? – jmj Dec 30 '14 at 17:41
  • I tend to wipe out my local Maven repo in those situations and restart STS after that, do a clean build of the project, and therefore let m2e (or Maven) download all the necessary dependencies again. This solves those issues in many cases (at least for me). In case you are hitting a bug in m2e, you also might want to try the latest STS version which includes the latest m2e release version. – Martin Lippert Dec 31 '14 at 22:24
  • Thanks Jigar and Martin for comments.... – Yogesh Shinde Jan 02 '15 at 08:55
  • I have deleted m2e for the missing libraries, but they're still not being output to eclipse's tomcat, however they're in the target folder and the war. I am not using STS, any idea for a fix ? – abdelrahman-sinno Nov 13 '15 at 12:06
  • Even installing STS did not solve this ! – abdelrahman-sinno Nov 13 '15 at 12:33
  • @united-expression I'm confused, what exactly is the problem? Some dependencies in the POM are `provided` (per the comment) so they are not included in the war, that's normal. You should create another question with your POM because it seems to be a different problem. – Tunaki Nov 13 '15 at 12:36
  • Only the servlet API is provided, that's normal. My case is similar, i depend on 'jaxws-rt 2.2.8' and it's jar are output in the target folder; however in eclipse's tomcat, jaxb-api, jaxb-core and impl are missing (among many others), instead I have 'jaxb-api-2.2.4' and 'jaxws-api-2.2.8.jar' (instead of jaxws-api-2.2.9.jar). VERY WEIRD thing is, when I change the dependency to jaxws-rt 2.2.7 then are all jars are OK, except my application won't work with this library. Now, I can use the war and it deploys on external tomcat. – abdelrahman-sinno Nov 13 '15 at 13:16

1 Answers1

2

I found the solution

The machine where we faced this issue, had java 1.6 executable copied in system32 folder, and when we removed those files and updated path to use jdk 1.7, issue got resolved....

I tried to search for compatible java version for m2e 1.4.1 but didn't found anything, for new m2e version i.e. 1.5 required java version is specified.

  • I don't understand your solution. I have java.exe in windows/system32, but what does that change ? The file's version is 7 when i check its properties. Please clarify what I should do. – abdelrahman-sinno Nov 13 '15 at 12:01
  • Did someone found an alternative answer? I also face the same issue with Eclipse Mars, java 8 on windows 8. – nmy Mar 07 '16 at 09:25