Have you ever tried to use Maven dependencies within Ivy projects? If so, you may know that this was possible, but a bit hacky 🙃...
Recently we finally addressed this issue, so now it works much more comfortably and with known Maven standards 🎉.
Let's assume that we need an opencsv library in our project. Then we need to do the following:
- Make sure that you use the latest Project-Build-Plugin (9.2.1 at this moment)
- Make sure that your project is a maven nature project (Right click on project -> Configure -> Convert to Maven Project)
Now you can add some Maven dependecies using the IDE or you can add them directly to your project
As you can see above, I also exclude transient dependencies of the opencsv library. This is because all the dependencies this library needs (some Apache Commons libraries) are already provided by core 🚚. So I exclude these libraries here to reduce the size of the final ivy archive.
You should also make sure that you only include dependencies which are needed for the runtime. For example, do not include test dependecies like
junit or simply add
<scope>test</scope> to it.
Now when you export the project from the Designer or build it with the
project-build-plugin 🔨, all maven dependecies should be added to the
If you're working with a version before 9.2, you still need to go with the old way:
- Copy the libary with the
mvn clean generate-resources
- Refresh your project in the Designer workspace
- Add the Jar's in the
lib directory to the project
.classpath (Java Perspective -> Right click on Jar -> build path -> add to build path)
Migrate to 9.2:
Theoretically no migration is necessary, because the old hack still works 😎, but there is a migration chapter in our Migration Notes 📕.