1

I am trying to create a fat jar which includes my test classes as well as it is described here : How to add test classes in JAR with Maven project

But I am getting the following error when I run maven install:

Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.3:single (make-assembly) on project formulas: Failed to create assembly: Unable to resolve dependencies for assembly 'fat-tests': Failed to resolve dependencies for assembly: Missing:
[ERROR] ----------
[ERROR] 1) org.eclipse.jetty:jetty-servlet:jar:7.6.16
[ERROR] 
[ERROR]   Try downloading the file manually from the project website.
[ERROR] 
[ERROR]   Then, install it using the command: 
[ERROR]       mvn install:install-file -DgroupId=org.eclipse.jetty -DartifactId=jetty-servlet -Dversion=7.6.16 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR]   Alternatively, if you host your own repository you can deploy the file there: 
[ERROR]       mvn deploy:deploy-file -DgroupId=org.eclipse.jetty -DartifactId=jetty-servlet -Dversion=7.6.16 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Outout is clear that I have missing jar but I do not understand why I am facing with it.

user1474111
  • 1,356
  • 3
  • 23
  • 47
  • Probably you are using the wrong maven coordinates for jetty, if you need to use this old version you should try: ` org.eclipse.jetty jetty-servlet 7.6.16.v20140903 ` – DrHopfen Dec 17 '18 at 10:49
  • actually i do not have any idea where this is coming from because I do not have such a dependency added to the pom with that version. – user1474111 Dec 17 '18 at 11:26

1 Answers1

0

There is no such version like 7.6.16 for a jetty-servlet dependency. Make sure you have a either a correct dependency like:

<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-servlets</artifactId>
    <version>7.6.16.v20140903</version>
</dependency>

Or any of the following versions from maven central repository: https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-servlets

You can also rename both the folder and the jar in your local maven repository, but I would strongly advise against that, as it would be only a hack.

Dezso Gabos
  • 2,297
  • 5
  • 21
  • 29
  • actually i do not have any idea where this is coming from because I do not have such a dependency added to the pom with that version. – user1474111 Dec 17 '18 at 11:26
  • Try searching for the "7.6.16" in your project. Maybe the version is specified in the aggregator pom file in a property. – Dezso Gabos Dec 17 '18 at 11:44