I am trying to set up a continuous integration system for a Java project I am working on. I plan to use Jenkins or some equivalent for the front end. The Java project is configured to use the IntelliJ IDEA IDE, version 11. The problem is there is no way to build IntelliJ IDEA 11 projects from a command line interface, which is required so it can interface with the CI front-end (Jenkins).
There are a couple of potential solutions I have looked into. They are as follows.
Use the "Generate Ant Build" capability of IntelliJ IDEA. There are 2 problems with this solution:
Use a 3rd party application to dynamically generate ant build files, namely ant-intellij-tasks. When I saw this project I was pretty excited, but unfortunately it looks like it hasn't been updated since 2009 and doesn't work with the new version of IntelliJ IDEA. I can't find any other libraries like this one that are up to date and working.
This link suggests that others are having similar problems and want a command line interface (the link is a description of a plugin wanted for a contest - the source is IntelliJ IDEA themselves).
Has anyone else set up build automation using this tool set? How did you get it done? The answer I'm looking for ideally doesn't require management of additional configuration files and would allow me to type something on the command line and have the build happen.
IntelliJ IDEA has its own native build system or you can use an external build tool such as Maven, Gradle, Ant, Gant, or sbt (for the Scala plugin) to build and deploy your project. The integration for the majority of the build tools that IntelliJ IDEA supports is bundled and enabled by default.
IntelliJ IDEA doesn't run javac , therefore you can't see the command line. Compiler API is used directly from Java code. If you enable debug logging for build. log file, you may find some more details how the modified and dependent files are compiled and what options are used.
Converting your project to fit with maven is easier to do than customizing Maven to work with your project structure.
Although you could do the latter, most of the time people don't design the way their project is laid out very cleanly at all, and after they adopt the maven layout, their project becomes much more manageable.
If you adapt the good patterns of a default maven project layout, IDEA will automatically read it and understand it completely - even sharing the same compiler output you use on the command line in the IDE. IDEA will use the pom.xml as its configuration file.
You can't do this with Ant, because it's a build process wrapper. Maven is not only a dependency management mechanism - it's an abstraction of a project, which an IDE can use to configure itself.
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