Leveraging AgroSense, GeoViewer, and Maven
By Geertjan-Oracle on May 08, 2012
AgroSense is a Java open-source services platform for farm management. It looks like an extremely cool and well-designed app, on top of SwingX, GeoTools, the Flamingo Ribbon bar, the NetBeans Platform, and many other libraries. Click to enlarge the image to get a better view:
As an open source project, the team is constantly looking for new developers to work with them, especially if you're interested in farm software. In fact, forget about creating your own farm software, just port your code to plugins for AgroSense. Come one, come all and join this truly useful Java project. (One simple way to join is to leave a message at the end of this blog entry and then you'll be contacted.)
The project is built via Maven. Here's the source structure in the IDE, from a Mercurial check out that I did today:
(Tushar Joshi from India should recognize part of the above project structure!)
Artifacts from AgroSense are checked into Maven central, so parts of the above application can very easily be reused within your own Maven-based NetBeans Platform applications. For example, let's assume we want to reuse the mapping functionality from AgroSense, as provided by the "geoviewer" suite in the project structure above.
Here's what you need to do to achieve the above.
1. Create a new Maven based NetBeans Platform application:
2. Give the application a name and other Maven properties:
3. Add these dependencies in the POM file of the NetBeans Platform application module:
<dependency> <groupId>nl.cloudfarming.client</groupId> <artifactId>geoviewer-api</artifactId> <version>1.0.24</version> </dependency> <dependency> <groupId>nl.cloudfarming.client</groupId> <artifactId>geoviewer-jxmap</artifactId> <version>1.0.24</version> </dependency>
4. Build and run the application and you should see this:
Note: An example of AgroSense API usage for the GeoViewer is included in the "examples" folder in the Mercurial repository:http://java.net/projects/agrosense/sources/core/show
I intend to discuss this example in an upcoming blog entry soon.