title: This project cannot be added because it does not produce a JAR file using an Ant script
body: <p>Following my <a href="https://stackoverflow.com/questions/24898805/exception-in-thread-main-java-lang-noclassdeffounderror-using-a-library-wit">question here</a> I now came up to this problem.
  I'm using NetBeans 8.</p>
  
  <p>I've created a Maven Project, let's call it MyLibMaven, (I used New Project -> Maven -> Java Aplication) and I moved my library, let's call it MyLib, into this Maven Project.</p>
  
  <p>Now when I go to my normal Java Project (let's call it MyProject) and I try to add MyLibMaven as a library to MyProject I get this popup in Netbeans saying: </p>
  
  <pre><code>This project cannot be added because it does not produce a JAR file using an Ant script
  </code></pre>
  
  <p>What am I doing wrong here?</p>
  
  <p>Here's my pom.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.dwnz.my.lib&lt;/groupId&gt;
      &lt;artifactId&gt;MyLib&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;maven.compiler.source&gt;1.7&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;1.7&lt;/maven.compiler.target&gt;
      &lt;/properties&gt;
      &lt;name&gt;MyLib&lt;/name&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.guava&lt;/groupId&gt;
              &lt;artifactId&gt;guava&lt;/artifactId&gt;
              &lt;version&gt;17.0&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p><strong>///////////////////////// EDIT //////////////////////////////</strong></p>
  
  <p>I moved my project to a maven project and added the MyLibMaven as a dependency. But now when I try to run my project I get this failed error: </p>
  
  <pre><code>--- exec-maven-plugin:1.2.1:exec (default-cli) @ TeseMaven ---
  Could not load the icon: /view/images/enable-server-icon.png
  Exception in thread "main" java.lang.NullPointerException
      at javax.swing.ImageIcon.&lt;init&gt;(ImageIcon.java:217)
      at view.toolbar.ToolBar.createIcon(ToolBar.java:171)
      at view.toolbar.ToolBar.&lt;init&gt;(ToolBar.java:53)
      at view.MainFrame.&lt;init&gt;(MainFrame.java:98)
      at view.MainFrame.newInstance(MainFrame.java:586)
      at view.Main.main(Main.java:98)
  ------------------------------------------------------------------------
  
  ------------------------------------------------------------------------
  BUILD FAILURE
  ------------------------------------------------------------------------
  Total time: 2.382s
  Finished at: Wed Jul 23 02:13:22 BST 2014
  Final Memory: 5M/126M
  ------------------------------------------------------------------------
  Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project MyProjectMaven: Command execution failed. Process exited with an error: 1 (Exit value: 1) -&gt; [Help 1]
  
  To see the full stack trace of the errors, re-run Maven with the -e switch.
  Re-run Maven using the -X switch to enable full debug logging.
  
  For more information about the errors and possible solutions, please read the following articles:
  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>