Is there a way to tell maven to continue the build although a dependency ist missing?
I tried <optional>true</optional> but this doesn't seem to do it in this scenario.
I have build a costum Maven Plugin for the package phase and it does still have to package even if one or multiple dependencies could not be found.
Thanks in advance.
<optional>true</optional>
Optional means that a client using your library does not necessarily need that dependency. An example is Spring's ORM module, that has optional dependencies to Hibernate, JDO, JPA and mybatis. Nobody will ever use all of these in a project, so each is marked as optional.
Your case is completely different, you are trying to compile something, and you can only do that if the libraries you compile against are present. Sorry, it don't work like that.
If you are trying to build something while the rest of the team finishes their parts, you could use a Mocking framework that creates something that looks like the classes you need . Check out, for example mockito
Otherwise, the only thing you can do is run mvn with -fn (fail-never) but that will mask all your errors and not just the missing dependencies
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With