0

I have a web service WebService1 that is deployed on JBoss (4.2.3.GA).
WebService1's endpoint is Endpoint1.

I wrote a WebService2 which dependends on WebService1. When Maven creates the .EAR file, it places the .JAR with WebService1 in WebService2's .EAR.

So, when I deploy WebService2 in JBoss I get the exception:

Endpoint1 has already registered.

If I remove class with Endpoint1 from the .JAR in the .EAR, then it's all normally deployed. But I can't remove this class after every project building.
Any ideas?

acdcjunior
  • 132,397
  • 37
  • 331
  • 304
Ilya
  • 29,135
  • 19
  • 110
  • 158

1 Answers1

1

If you have a dependency that you don't want packaged with your maven build, use the "provided" dependency scope like this:

<dependency>
  ..
  <scope>provided</scope>
  ..
</dependency>

This will allow Maven to compile the project, but won't include said dependency with the final package. More information here.

Is this what you were looking for?

josh-cain
  • 4,997
  • 7
  • 35
  • 55
  • No. I need this package in runtime. I want exclude 1 class from dependency – Ilya Apr 25 '12 at 18:06
  • ah, I see. Is [this](http://stackoverflow.com/questions/547805/how-to-exclude-all-transitive-dependencies-of-a-maven-dependency) what you're looking for? Maven also provides a way to exclude certain classes from dependency libraries... – josh-cain Apr 26 '12 at 18:17
  • This exclude all package, not 1 class – Ilya Apr 26 '12 at 18:31