Today’s NetBeans Maven Java SE Application primer tutorial shows a simple application project using Maven, which is a very powerful and dynamic application building automation tool. Let’s see below some of what Wikipedia says about Maven.
Maven is a build automation tool used primarily for Java projects. Maven serves a similar purpose to the Apache Ant tool, but it is based on different concepts and works in a different manner. Like Ant it can also be used to build and manage projects written in Java, C#, Ruby, Scala, and other languages. The Maven project is hosted by the Apache Software Foundation, where it was formerly part of the Jakarta Project.
Maven uses an XML file to describe the software project being built, its dependencies on other external modules and components, the build order, directories, and required plug-ins. It comes with pre-defined targets for performing certain well-defined tasks such as compilation of code and its packaging.
Maven dynamically downloads Java libraries and Maven plug-ins from one or more repositories such as the Maven 2 Central Repository, and stores them in a local cache.[3] This local cache of downloaded artifacts can also be updated with artifacts created by local projects. Public repositories can also be updated.
Maven is built using a plugin-based architecture that allows it to make use of any application controllable through standard input. Theoretically, this would allow anyone to write plugins to interface with build tools (compilers, unit test tools, etc.) for any other language. In reality, support and use for languages other than Java has been minimal. Currently a plugin for the .NET framework exists and is maintained,[4] and a C/C++ native plugin is maintained for Maven 2.[5]
Programming IDEs take a lot of the hard work out of tasks such as compiling and linking in languages such as Java, C, C++, VB.Net and C#. In the case of NetBeans IDE, which this blog reintroduces to you today (it’s customary to shake hands, and no Klingon is necessary), it can create a Java Web Application, for instance, as we do today to create a Tic Tac Toe game as a web application. To cut a long story short, there aint nothin’ wrong with a good ol’ IDE, but beware of IDEs in March.
In saying that about IDEs, and how they make programming easier, often with Open Source programming, it is advantageous to know what goes on “under the hood” (or even “in the ‘hood” … chortle, chortle). So if you ever get an opportunity to get helped creating your own makefile (or make it yourself, even with the Sweet Green Icing … knew it could be worked in!) for something, take the opportunity to learn how to do this, as the Open Source world will become a little easier to navigate with such types of knowledge. You’ve got to admire those early designers of computer languages, and those days when all you had was this tiny bit of memory (64k or “into the heliosphere on 8,000 bytes of memory”) to play with to create your program.
So here, today, we build a simple Maven Java SE Desktop application to ask about the lengths of sides of a triangle, to calculate its area.
NetBeans can be an IDE for much more than Maven (Java SE) … it can supervise other Java and other Maven language assists, PHP, C++, Groovy and HTML/Javascript. In coming days and weeks we’ll look at more.
Link to downloadable NetBeans Maven Java SE Application Java programming source code at App.java
Link to downloadable NetBeans Maven Java SE Application XML configuration file at pom.xml
Link to Maven information from Wikipedia, from where the quite above originated.
Link to Maven “spiritual home” from Apache.
Link to NetBeans “spiritual home” download page at NetBeans.
If this was interesting you may be interested in this too.
27 Responses to NetBeans Maven Java SE Application Primer Tutorial