0

I am migrating an old project from Ant to Gradle (yes, there is still an Ant-based project in 2014). It has all sorts of nonsense thrown into its lib/ dir, and I'm very keen on dumping anything unnecessary as part of this migration.

The project is based on Spring 3.0.5 and Jersey 1.8. It is not using Hibernate but instead using Cassandra. The project seems to think it needs javassist 3.12.0, but didn't pull cglib.

I thought I had some vague recollection of perhaps one of these optionally using javassist, but it seems by recollection is lying to me. Is it safe to remove this dependency?

Amir Abiri
  • 8,847
  • 11
  • 41
  • 57

1 Answers1

0

Depending on how you're using Spring you might need to add an explicit dependency on CGLIB. It's marked as an optional dependency in 3.0. In Spring 3.2, the CGLIB classes were repackaged into the Spring JARs so an explicit dependency on CGLIB is no longer required. You would need CGLIB if you're proxy-target-class="true" or @Configuration.

I just checked one of my projects that's similar to yours (Spring 3.0.x and Jersey 1.x). I have dependency on Javassist but Maven tells me it's because of Hibernate. I don't see an explicit dependency from Jersey 1.x to Javassist.

If I were you, I'd leave the Javassist dependency out of the POM and let Maven take care of pulling it in if it's necessary. I would only add an explicit dependency on Javassist if it was an optional dependency that I needed or if Maven made the wrong choice about which version to include.

Is it safe to remove this dependency?

It's hard to say without seeing your entire pom.xml or the list of JARs that the Ant script worked with.

John R
  • 2,066
  • 1
  • 11
  • 17
  • The rest of the deps are simple (Apache MQ, Jackson). It's a small project. My gut feeling is that javassist was there because of Hibernate long time ago, and left there after the migration to Cassandra. Iv'e decided to remove this and let the gods of staging judge me. – Amir Abiri Aug 11 '14 at 18:56