At IDR Solutions I spend a lot of time on working on the development of our Java PDF Library. Click here to read why we converted from Ant to Maven.
For this tutorial, I will create a simple NetBeans plugin with an Action that pop’s up a ‘Hello NetBeans Plugin’ when clicked.
Before we convert this project to maven, we have to be aware of the Maven Directory structure and where which file should be placed.
Lets have a look at the image of this Maven Project Below.
So Let’s Start Converting
First of make a zip copy of your Ant project so you can always go revert back. In NetBeans, lets create a new Maven Plugin Module, this time i will call it TestMavenXX change the Group ID to the code base name of your Ant Plugin and click next and Finish.
You can now copy and paste all non java files excluding Bundle.properties from TestModule/src/org/yourcomp/testmodule to TestModuleXX/src/main/resources/org/yourcomp/testmodulexx
At this stage we can delete the TestMaven Project.Once done Right click on TestModuleXX in NetBeans and select Rename. You can Rename it to TestModule now.
Now do a Clean and Build on your project. If you get an error like this
Project uses classes from transitive module org.netbeans.api:org-openide-util:jar:RELEASE80 which will not be accessible at runtime.
Check in the imports of your java classes you should see a yellow triangular sign on one or more of your imports.To fix the problem,we need to add this module as direct dependency in our pom.xml. Once done you should see the triangle disappear.
Hopefully you have found this quick guide useful.
Are you a Developer working with PDF files?
Our developers guide contains a large number of technical posts to help you understand the PDF file Format.
Do you need to solve any of these problems?
|Display PDF documents in a Web app|
|Use PDF Forms in a web browser|
|Convert PDF Documents to an image|
|Work with PDF Documents in Java|