1

I'm using Spring Boot with the spring boot maven plugin which creates a JAR with

The JAR created by the plugin puts the classes in subdirectory in the JAR which means that I can't use the JAR as a dependency in maven.

Is there a way to declare a depenency in maven on the original JAR. I see that there is a *.jar.original file in the target directory so maybe I can create a dependency on that in the way it's possible to create a dependency on the test classes by declaring a dependency of the kind test-jar.

Just for clarification: I'm doing this testing/easier debugging, not for production.

Jimmy T.
  • 4,033
  • 2
  • 22
  • 38

1 Answers1

2

It's the other way around bout you can put a classifier to the Spring-Boot Jar in the repackage goal and let maven build your normal jar during the packaging phase: http://docs.spring.io/spring-boot/docs/current/maven-plugin/repackage-mojo.html#classifier

thopaw
  • 3,796
  • 2
  • 17
  • 24
  • 1
    That's not at all helpful. When using the classifier, the original jar gets replaced, unless you use attach=true, in which the original jar still gets renamed to .jar.original, and a normal dependency will still point to the non-original jar. – user625488 Feb 04 '19 at 20:23