Hi, I just tried to add a dependency by inserting the reference found here ( https://mvnrepository.com/artifact/com.opencsv/opencsv/3.8) into the pom.xml of the project (using Axon Ivy Designer 6.0.4) I tried to build it with "mvn install" in the command line and got an error that the library is missing (CSVWriter cannot be resolved to a type) Executing the following command shows me that the artifact ist downloaded. "mvn dependency:get -Dartifact=com.opencsv:opencsv:3.8"
Adding the library in the Axon Ivy Environment removes the errors in the IDE. But the error still exits if I want to execute a "maven install". Is there anything I'm missing? BR and thx, Gerald POM File:
asked 10.10.2016 at 18:45 Gerald |
The thing is, that only IAR maven-dependencies are included in the projects classpath on the engine. There is currently no built in support to include normal JAR dependencies in a project and auto-download them when a project is deployed to an engine. A simple work-around is to add the maven-dependency-copy plugin to your POM.xml. It will copy JAR dependencies to a directory in your project and you can add it to the classapth:
With this configuration you can run answered 11.10.2016 at 09:04 Reguel Werme... ♦♦ Hi, thx for the answer. This works well and I have the lib in the local project folder. But I still cannot execute a "mvn compile" (I want to run the build process on a Jenkins later). I added the lib in Axon Ivy and it tells me that there are no longer missing references. But, as mentioned, the command line process cannot find it. Do I need to define the local library somewhere else for Maven? Thx in advance, Gerald
(11.10.2016 at 13:19)
Gerald
Try to use the latest project-build-plugin:6.3.0 as it has several improvements in the classpath handling: http://axonivy.github.io/project-build-plugin/release/6.3/index.html If the commandline execution still does not work. Run
(11.10.2016 at 15:35)
Reguel Werme... ♦♦
|
Another way to use maven-dependency-plugin suggestested by Emmanuel is this:
This will include any jar dependency to the lib directory and is packged when running maven. In Desinger it still needs to be linked manually once by right clicking on the project, "Build Path.." -> Configure Build Path -> Add External JARs. answered 19.09.2017 at 11:45 adamf ok basically I like this approach. But I think the exclusions of test frameworks is not intuitive. I always suggest to create an extra project for test cases (Even tough standard maven handles it different). So you will never have code deps to test frameworks and therefore you do no need to exclude them while copying POM deps. If test and prod code is in the same projects, chances are ways to high that test code at some point of time will leak into production without notice...
(25.09.2017 at 04:15)
Reguel Werme... ♦♦
yeah, I already noticed that src and src_test are copied compiled into classes. Wonder if things get easier if ivy project conforms to standard maven project directory layout (src/main/java, src/test/java, src/main/resources, ..). Great about TDD is that you have less chance of introducing regressions or bugs. When having tests separate there is less motivation to keep them up to date and increased complexity for continuous integration.
(25.09.2017 at 08:50)
adamf
|
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 10.10.2016 at 18:45
Seen: 9,830 times
Last updated: 25.09.2017 at 08:50
Could you include your pom file?