Dieses Projekt kann nicht hinzugefügt werden, da mit einem Ant-Skript keine JAR-Datei erstellt wird
Im Anschluss an meineFrage hier Ich bin jetzt auf dieses Problem gekommen. Ich verwende NetBeans 8.
Ich habe ein Maven-Projekt erstellt, nennen wir es MyLibMaven (ich habe New Project -> Maven -> Java Aplication verwendet) und meine Bibliothek, nennen wir es MyLib, in dieses Maven-Projekt verschoben.
Wenn ich jetzt zu meinem normalen Java-Projekt gehe (nennen wir es MyProject) und versuche, MyLibMaven als Bibliothek zu MyProject hinzuzufügen, wird in Netbeans das folgende Popup angezeigt:
This project cannot be added because it does not produce a JAR file using an Ant script
Was mache ich hier falsch?
Hier ist meine pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.dwnz.my.lib</groupId>
<artifactId>MyLib</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<name>MyLib</name>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>17.0</version>
</dependency>
</dependencies>
</project>
///////////////////////// EDIT //////////////////////// //////
Ich habe mein Projekt in ein Maven-Projekt verschoben und MyLibMaven als Abhängigkeit hinzugefügt. Aber jetzt, wenn ich versuche, mein Projekt auszuführen, erhalte ich diesen Fehler:
--- 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.<init>(ImageIcon.java:217)
at view.toolbar.ToolBar.createIcon(ToolBar.java:171)
at view.toolbar.ToolBar.<init>(ToolBar.java:53)
at view.MainFrame.<init>(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) -> [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