...
Info | ||
---|---|---|
| ||
Make sure you have You must use a Java 1.5.0 JDK, because org.lcsim requires it. |
I will also briefly describe how to import and build a Maven-based project within Netbeans.
Warning | ||
---|---|---|
| ||
These linux specific instructions are not up-to-date. You should just follow the generic instructions. |
Downloads
Java
Java 1.5.0 can be downloaded at http://java.sun.com/j2se/1.5.0/download.jsp.Make sure to set
Info | ||
---|---|---|
| ||
Set the JAVA_HOME variable to your JDK root area. Otherwise, Maven may not pick up the correct Java compiler. |
At SLAC, you can setup the shared Java 1.5.0 JDK on Linux by executing this command.
No Format |
---|
export JAVAVER=1.5 |
Netbeans Installer
Get the install files for Netbeans from http://www.netbeans.org/index.html.
...
No Format |
---|
wget http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-1.0.2.tar.gz |
Maven NBM
Mevenide provides Maven support in the Netbeans IDE. You need to get the "nbm" files for Maven support within Netbeansfrom the Mevenide Downloads Area .
download
No Format |
---|
wget http://mevenide.codehaus.org/download/mevenide-netbeans-autoupdate-1.0.nbm wget http://mevenide.codehaus.org/download/mevenide-netbeans-grammar-0.6.1.nbm |
Note | ||
---|---|---|
| ||
As of now, if you want to install the most recent Netbeans, 4.1beta, you will need the special NBM file for XML grammar listed above. If, instead, you choose to use 4.0, you may not need to install the grammar pack separately. Thus, the instructions throughout this guide about this special setup should be ignored if you are using Netbeans 4.0 and not 4.1beta. |
Summary
You should now have the following files for the installation.
No Format |
---|
mevenide-netbeans-autoupdate-1.0.nbm mevenide-netbeans-grammar-0.6.1.nbm netbeans-4_1-beta-linux.bin maven-1.0.2.tar.gz |
...
Warning | ||
---|---|---|
| ||
"maven" has been mispelled as "meven" |
...
throughout the Maven IDE installation kit. |
Obviously, the exact versions will change as Netbeans and Maven are updated.
...
Make sure to select a Java 1.5.0 JDK.
For instance, this is shows the shared install when using Linux used at SLAC.
You can set it up by executing this command.
...
...
export JAVAVER=1.5
When finished, startup Netbeans.
...
Warning | ||
---|---|---|
| ||
I noticed that if the module installation steps were performed incorrectly, Netbeans would often complain once at restart about missing dependencies and then not allow reinstallation of the modules using the Update Manager, at least not in an obvious way. So be careful and make sure you try to do it correctly the first time, or Netbeans may need to be reinstalled entirely. (Probably, there is a way to have it rescan modulesfor module updates, but I have not found it.) |
Now you need to install Maven grammar support. This is a version The one you downloaded is especially for Netbeans 4.1beta.
...
You should see Meven IDE XML Grammar under Include in Install on the lefthand side.
Click Next.
Now select the boxes under Include and Global for Meven IDE XML Grammar. Click Accept or Yes to get past the boilerplate warnings.
Click Next.
Info | ||
---|---|---|
| ||
It is my preference to put the Maven IDE support in the Netbeans install area, i.e. Global, but it is not necessary for the install to work. |
...
Go back to Tools -> Update Center and select Check the Web .... Deselect Development Update Center and make sure that Mevenide Update Center is selected.
Click Next.
Under Available Updates and New Modules, you should see a number of modules under Mevenide Update Center. Click the Double Arrow to put these all into Include in Install. Now use the Single Arrow to deselect the installation of Mevenide-Grammar, as you installed this previously.
Click Next and finish the installation exactly as before, making sure to select Include for all modules in the Modules to Install box.
...
You can open an existing Maven project using File -> Open Project. Valid folders will have a yellow box on them. Select one in the lower right of the folder icon. For instance, I could choose the GeomConverter or lcsim folders below.
Select a valid folder in the chooser window and click Open Project Folder.
Netbeans will now scan the project for classes and the like, which takes awhile. Once it is finished, you should see the project in the lefthand window.
Here is the GeomConverter project with some expanded folders.
Building the Project
To build the project using Maven, simply right click on the project in the lefthand pane and click Build.
Alternately, you can select the menu item Build -> Build Main Project or press F11.
You should see the Maven splash screen in the console and scrolling messages as the project is built.
Congratulations, you now have Maven support in Netbeans.