Integrate Maven and FRC Java projects?


I’d like to use Maven for dependency tracking for a couple of 3rd party libraries.

Is it possible to use Maven dependency tracking alongside an FRC project?


FRC Java development currently doesn’t provide any special support for Maven. If you are only using it to pull in dependencies, there is no reason you can’t use it to pull the jars in from target/lib/*.jar to the classpath much like how the networktables jar is. The entire build process is ant scripts, you may need to dig into the sunspotfrcsdk directory to see how it works.

However, it is worth noting that java on the crio is a bit more interesting than Java SE. You need to target 1.2 (I think 1.3 works, but I can’t test it right now and sunspotfrcsdk/ant/compile.xml targets 1.2), which will rule out many newer libraries and you have to make sure your libraries go through the preverification process and end up in the suite file that gets deployed to the crio.

Out of curiousity, what libraries are trying to use and why do you want to do maven?

We just had some third party libraries we wanted to utilize for a debugging project, but were distributed via .pom files and relied on Maven to resolve their own dependencies.

However, because the FRC Java projects targets J2ME, we’re unable to (easily) use some of the utilities that we would need anyway. We’ve moved the project to C++ and are now using a framework we like.

Thanks for responding though!

In case anyone else comes across this thread looking for something similar, you can get around this issue and avoid integrating Maven with an FRC project. Create a maven project and set up the POM correctly to pull in the dependencies you want. Once those are in (including all of their dependencies), just save off all of the JAR’s and import them into your FRC project. Yes, it’s a bit of a pain, and yes, it defeats the whole point of having a dependency management solution like Maven, but it gets you what you want in the end!