pat
pat

Reputation: 1987

Declare dependency to war file in Gradle

Based on the gradle docs, to define external jars means adding to build.gradle the following snippet (considering you have {project_root}/libs/foo.jar) in place:

dependencies {
  runtime files('libs/foo.jar')
}

However, using the same dependency declaration for *.war files doesn't work. Is this even possible? The project I'm trying to depend on builds to a war file.

Upvotes: 1

Views: 1688

Answers (1)

Opal
Opal

Reputation: 84864

Since war layout is different from jar file standard layout, it's not possible to declare war a dependency file to a java project. Possible ideas:

  1. Clone the project and define it as a dependency (very stupid idea, I'm ashamed that I suggest sth like that)
  2. Contact the author and ask him/her if you can just copy the class you need to use. If you can copy the class along with the credits.
  3. Contact the author and ask him/her if it does make sense to make the codec open source (I know it is right now) and release it as a standalone jar library (maybe along with other classes used in the project).

Upvotes: 1

Related Questions