Home > OS >  Does every IDE use a build tool like Maven?
Does every IDE use a build tool like Maven?

Time:05-05

I am new in Java and I am wondering what builds a java project if it is not Maven or Gradle.

In an IDE, you can also compile your java project and you do not need to use a Maven. Does it mean that such IDE (IntelliJ for example) has an own build tool behind the scene that is used for downloading all dependencies, running test and all that stuff?

CodePudding user response:

Almost any project that grows past a few files requires a build tool of some sort. In the Java world Maven and Gradle are common with Ant and Ivy being somewhat less used anymore. Other programming environments have similar concepts and tools.

The IDE may not require this and has it's own build environment. But once you leave the IDE you still need a way to build - for example, in a build pipeline in a CI/CD environment. So it's better to start with some sort of build tool up front. Additionally, if you ever wanted to change your IDE you no longer have the same way to build. By using a build tool you are consistent across environments.

CodePudding user response:

While I highly recommend a build tool, most build tools (at least the ones I'm familiar with) don't actually compile, that gets handed off to javac in the installed jdk.

Setting up a more sophisticated project, e.g. building a webapp, can be done without any build tool, but you'll need to (either manually or with a script) do the assembly (e.g. moving files into the right locations, preparing the deployment artifact, etc...). Doing that "custom" is a righteous PITA, hence build tools.

CodePudding user response:

In the olden days, every IDE had its own proprietary build system.

This meant that if you wanted to migrate your project from one IDE to another, you had to recreate the project from scratch, move files over manually, and reconfigure actions to be done during compilation, testing, and building. Some migration tools were built to automate this tedious work, but they were often imperfect or incomplete.

With the growing success of tools like Ant, Maven, and Gradle, the IDEs began adding support for users to choose those tools in place of the IDE’s own proprietary features. The IDEs eventually embraced these tools so well that now a Maven-driven project or Gradle-driven project can be easily moved from one IDE to another with virtually no effort and no modifications. You can even build your project without any IDE, just using the command-line interface to the Maven/Gradle tools.

Today’s freedom to easily move between IDEs eliminates the fear of vendor lock-in.

IDEs today still carry their own build technologies. But I believe they are rarely or never used nowadays by the bulk of Java developers. The open tooling provides all needed functionality.

  • Related