Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-3013

maven-jaxws-tools-plugin has an issue with the lack of tools.jar on OSX Snow Leopard.

    XMLWordPrintable

Details

    • Hide

      1. Create a POM for your JEE project that requires the functionality of wsconsume (generating Java from WSDLs)
      2. Use the maven-jaxws-tools-plugin in your POM
      3. Put the code and POM onto an OSX system
      4. Type: mvn generate-sources

      Show
      1. Create a POM for your JEE project that requires the functionality of wsconsume (generating Java from WSDLs) 2. Use the maven-jaxws-tools-plugin in your POM 3. Put the code and POM onto an OSX system 4. Type: mvn generate-sources
    • Hide

      There are two ways to work around the issue:
      1. Create an empty tools.jar in the directory this plugin is looking for.
      2. Edit the downloaded pom in the local $M2_HOME directory, removing the com.sun dependency.

      Show
      There are two ways to work around the issue: 1. Create an empty tools.jar in the directory this plugin is looking for. 2. Edit the downloaded pom in the local $M2_HOME directory, removing the com.sun dependency.

    Description

      Within a pom.xml that uses maven-jaxws-tools-plugin, the following error appears on OSX Snow Leopard:

      [INFO] Scanning for projects...
      [INFO] ------------------------------------------------------------------------
      [INFO] Building Template Web Service
      [INFO] task-segment: [generate-sources]
      [INFO] ------------------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Failed to resolve artifact.

      Missing:
      ----------
      1) com.sun:tools:jar:1.5.0

      Try downloading the file manually from the project website.

      Then, install it using the command:
      mvn install:install-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.5.0 -Dpackaging=jar -Dfile=/path/to/file

      Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.5.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

      Path to dependency:
      1) org.jboss.ws.plugins:maven-jaxws-tools-plugin:maven-plugin:1.0.0.GA
      2) com.sun:tools:jar:1.5.0

      ----------
      1 required artifact is missing.

      for artifact:
      org.jboss.ws.plugins:maven-jaxws-tools-plugin:maven-plugin:1.0.0.GA

      from the specified remote repositories:
      central (http://repo1.maven.org/maven2),
      repository.jboss.org (http://repository.jboss.org/maven2),
      snapshots.jboss.org (http://snapshots.jboss.org/maven2),
      eviwarePluginRepository (http://www.eviware.com/repository/maven2),
      Main Maven repo (http://repo1.maven.org/maven2),
      JBOSS-WS (http://repository.jboss.org/maven2)

      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 4 seconds
      [INFO] Finished at: Wed Apr 28 21:41:40 EDT 2010
      [INFO] Final Memory: 45M/81M
      [INFO] ------------------------------------------------------------------------

      According to various posts on the Internet about this same error with other maven plugins, the problem is connected to the fact that the JDK for OSX does not include the tools.jar file. The objects within this file are, instead, available in the classes.jar file.

      The pom at http://repository.jboss.org/maven2/org/jboss/ws/plugins/maven-jaxws-tools-plugin/1.0.0.GA/maven-jaxws-tools-plugin-1.0.0.GA.pom does contain the following entry:
      <dependency>
      <groupId>com.sun</groupId>
      <artifactId>tools</artifactId>
      <version>1.5.0</version>
      <scope>system</scope>
      <systemPath>${java.home}/../lib/tools.jar</systemPath> <!-- Required by wsprovide with Metro stack (because of APT) -->
      </dependency>

      which appears to affix the plugin to version 1.5.0 of the JDK's tools.jar. Obviously, according to the comment, this is needed. Again, tools.jar is not present on OSX and its objects are present in classes.jar.

      This error does not occur with the JDK of Windows XP, Windows 7, or Red Hat Linux.

      Attachments

        Issue Links

          Activity

            People

              rhn-support-asoldano Alessio Soldano
              shawnmjones_jira Shawn Jones (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: