0

I am working on the question of packaging a maven selenium framework into an executable jar file. I managed to pack both main and test classes into a jar file with maven assembly plugin and I can run tests from MainClass. I am almost done, but somehow there are a few spring dependencies in the project so during packing them into the jar they are overwriting spring.handlers/spring.schemas files. It's a well-known problem with spring projects.

The common advice is to use maven shade plugin or another tool, but I can't do it because I need to preserve my test-classes in the jar file.

What can I do to tune my assembly file for dealing with spring dependencies? Or can anyone recommend me any tool good enough both for packing test-classes and spring dependencies?

  • I understand you are keeping your classes under `src/test`, correct? Have you considered adding a specific module for such tests and adding the test classes under `src/main`? – Samuel Negri Jan 19 '21 at 13:21
  • You are right. The thing is I am developing a new feature for a long time existing framework, so any changing of its structure isn't fit. – Maksym Bova Jan 19 '21 at 13:33
  • Are the dependencies missing from test classpath or main? – Samuel Negri Jan 19 '21 at 14:33
  • they are not really missing. the problem is in messing spring.handlers/spring.schemas files, because every spring module edits the same files, as a result, the files are completely messed. The problem is described here: https://stackoverflow.com/questions/5586515/idea-to-avoid-that-spring-handlers-spring-schemas-get-overwritten-when-merging-m – Maksym Bova Jan 19 '21 at 14:46

0 Answers0