GaneshP
GaneshP

Reputation: 766

New to maven creating maven project in Netbean getting error

I am beginner to Maven , i am using it in Net-bean while creating first project i got following error

Archetype defined by properties
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 5.128s
Finished at: Wed Sep 11 22:45:58 IST 2013
Final Memory: 14M/133M
------------------------------------------------------------------------
**Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: null: MojoFailureException: NullPointerException -> [Help 1]**

when using command-line maven i can create project but only in netbean i am having problem.

Upvotes: 3

Views: 2063

Answers (1)

DYezek
DYezek

Reputation: 344

I just found the answer to this myself, after struggling all day. Here's what you do to find more about the problem cause:

  1. Go to Tools->Options
  2. Choose the Java tile at dialog top (2nd from left in NetBeans 7.4).
  3. Choose the Maven tab (two right from Ant tab).
  4. Under the execution category add the text "-e" (no quotes) in the Global Execution Options. (This will tell Maven to show the full error messages. OPTIONAL: list -X for full debug dump.)
  5. Click OK on the Options dialog to close it and save the changes.

In my case, the extra logging told me:

 org.apache.maven.archetype.exception.UnknownArchetype java.util.zip.ZipException: error in opening zip file.

Which meant it couldn't read the jar file (as Windows programs seem to treat jars like zip folders). So the fix was simple:

  1. Find the folder containing the corrupt jar in your local repo (/m2/repository) and delete it.
  2. Download the jar and it's pom file (save POM as a .POM and not an .XML) from maven central repository (see comment below for URL).
  3. Go to File->New Project->Maven and choose your Maven Project template (Java Application, Web Application, whatever).
  4. Give project a name and set the location you want to put it.
  5. Click Finish button.

NetBeans should then run to completion and create the project for you. The default storage location for windows users is C:\Users\\.

Hope this helps.

Upvotes: 2

Related Questions