I have a test which requires the successfully compiled jar to be in the target directory: this is a software that interacts with other programs which get started as a separate process and to test this the test starts a small program from the jar of its own package. This can be "bootstrapped" by first running the build and skipping the tests and then running the build again - but this is not ideal.
Is it possible to create a pom which will first compile, create the jar in target (or somewhere else) then allow the test to run and if anything fails maybe remove the jar again? Or if the jar is created anywhere else just for testing in addition, that would not be a problem.