geography_guy
geography_guy

Reputation: 331

How can I run jax-ws on java 5 with the minimum number of external dependencies?

I would like to use jax-ws in a java-5 environment. jaxws-rt 2.2.5 promises to allow access to jax-ws services. However, according to maven repository this artifact relies on about 12 other artifacts. There are constraints in my enterprise that make it difficult to add an artifact to our enterprise repo, and adding a dozen artifacts is much more difficult that adding just one. Because of this issue, I would like to know if there is a larger artifact that I can use to write a jax-ws web service client without the need for any additional dependencies.

Is there a bundled jax-ws jar I can use that has 0 external dependencies?

Upvotes: 2

Views: 426

Answers (2)

Stephen C
Stephen C

Reputation: 718896

There is one hacky way to do this.

  1. Download and add the 12 dependencies to your local repo.

  2. Create a Maven project that depends on the 12 dependencies, and use the Maven "shade" plugin to construct an "Uber Jar" that combines the 12 JARs into one JAR. You might include a README file in the JAR to explain how and why it was constructed.

  3. Build the Uber Jar file.

  4. Submit the Uber Jar file for approval.


Frankly, I think this is a technically inferior approach, but if your corporate bureaucracy makes uploading difficult, do what you need to do.

Upvotes: 2

Bruno Grieder
Bruno Grieder

Reputation: 29824

JAX-WS with Java 5 will require a significant number of libraries. This should be true whether you opt for Metro, CXF, Axis or anything else.

Options I can think of are:

  • Move to Java 6 if you can - in most cases the jaxws-rt 2.2.1-1 (from the group org.glassfish.metro) may be sufficient
  • Deploy inside and application server (Jboss, Glassfish, etc...). Everything should already be there
  • Deploy inside a servlet container (Jetty, Tomcat, etc...) in a war. The dependencies will be isolated to that war (servlet API 2.5 or more).

Anything else will probably lead to the "pollution" of your lib folder/classpath and, likely, your endorsed folder.

Upvotes: 1

Related Questions