Let’s get started
So in my free time I do some hobby development, just for fun. And I thought, I could share this with the world. And it’s also a good way to show, how we work.
Let’s start with a brief introduction. We do a project. Agile. Very agile, because we do not have any plan, just a rough concept what we want to do. And as we go further, our concept changes and we do a lot of refactoring and re-working.
About the application: we will develop a “sipmle” application for handling of shipping notes. So we need a database, eventually a GUI for maintaining the data. And we do all this with Java. 🙂
OK, getting the project. We start with creating a simple Maven Java application. Why are we not starting with a webapp using maven’s other archetype? At the beginning we do not need any JSP site, and it’s not so difficult to enrich a Java application with a Web GUI (and reconfigure the project).
<br /> mvn archetype:create -DgroupId=biz.hahamo.dev.variations -DartifactId=variations<br />
After we run a maven clean install, we get a jar executable, and let’s say, we try to run the simple application, we get… Yes, an exception.
<br /> $ java -jar target/variations-1.0-SNAPSHOT.jar<br /> Exception in thread "main" java.lang.NullPointerException<br /> at sun.launcher.LauncherHelper.getMainClassFromJar(Unknown Source)<br /> at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)<br />
Not the best, or? So we update the pom.xml with following lines:
<br /> <build><br /> <plugins><br /> <plugin><br /> <groupId>org.apache.maven.plugins</groupId><br /> <artifactId>maven-jar-plugin</artifactId><br /> <configuration><br /> <archive><br /> <manifest><br /> <addClasspath>true</addClasspath><br /> <mainClass>biz.hahamo.dev.variations.App</mainClass><br /> </manifest><br /> </archive><br /> </configuration><br /> </plugin><br /> </plugins><br /> </build><br />
Line 10 tells that our Main Class is
— and adds it to the MANIFEST.MF file in the jar.
This for the first post. In the next posts we will describe the basic database schema, add data to the database (and we create the database), add a database handling layer, and so on. 😉
Of course: you can get the sources from GitHub. Eventually I’ll package each stage of the mini-project to avoid looking through each commit at the hub.