[英]Maven javadoc plugin - package does not exist
I have a little problem with the maven javadoc plugin.我对 maven javadoc 插件有一点问题。 Actually I try to create a javadoc, which only contains two of my java classes.实际上我尝试创建一个 javadoc,它只包含我的两个 java 类。 But when try to build, I always get a list of errors, for example a 'package does not exist' error, but this package is a package, which I created myself in Eclipse.但是当尝试构建时,我总是得到一个错误列表,例如“包不存在”错误,但这个包是我在 Eclipse 中自己创建的包。
Just for information: I use Java 8, Eclipse Mars, m2eclipse.仅供参考:我使用 Java 8、Eclipse Mars、m2eclipse。 I build with the default "Maven install" command of m2eclipse.我使用 m2eclipse 的默认“Maven install”命令构建。
Here is my pom.xml file这是我的 pom.xml 文件
<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>de.sumafu</groupId>
<artifactId>ChestBackpack</artifactId>
<version>1.1.0</version>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>resources</directory>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
<archive>
<manifest>
<mainClass>org.sample.App</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<sourceFileIncludes>
<include>DataHandler.java</include>
<include>ChestBackpackAPI.java</include>
</sourceFileIncludes>
<sourcepath>${basedir}/src/de/sumafu/ChestBackpack/Tools/;${basedir}/src/de/sumafu/ChestBackpack/Data/;${basedir}/src/de/sumafu/ChestBackpack/main/</sourcepath>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20150729</version>
</dependency>
<dependency>
<groupId>Spigot</groupId>
<artifactId>org.spigotmc</artifactId>
<version>1.8.8</version>
<scope>system</scope>
<systemPath>${project.basedir}/spigot-1.8.8.jar</systemPath>
</dependency>
</dependencies>
</project>
And the maven output this (you can ignore the first warning, I know it ;) ) Maven 输出这个(你可以忽略第一个警告,我知道;))
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for de.sumafu:ChestBackpack:jar:1.1.0
[WARNING] 'dependencies.dependency.systemPath' for Spigot:org.spigotmc:jar should not point at files within the project directory, ${project.basedir}/spigot-1.8.8.jar will be unresolvable by dependent projects @ line 101, column 18
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ line 57, column 15
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ line 69, column 11
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ChestBackpack 1.1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ChestBackpack ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ ChestBackpack ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ ChestBackpack ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ ChestBackpack ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ ChestBackpack ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ ChestBackpack ---
[INFO] Building jar: /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/ChestBackpack-1.1.0.jar
[INFO]
[INFO] --- maven-assembly-plugin:2.2-beta-5:attached (default) @ ChestBackpack ---
[INFO] META-INF/ already added, skipping
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] org/ already added, skipping
[INFO] META-INF/maven/ already added, skipping
[INFO] META-INF/ already added, skipping
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] org/ already added, skipping
[INFO] org/openrdf/ already added, skipping
[INFO] META-INF/maven/ already added, skipping
[INFO] META-INF/maven/org.openrdf.sesame/ already added, skipping
[INFO] META-INF/ already added, skipping
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] org/ already added, skipping
[INFO] org/openrdf/ already added, skipping
[INFO] META-INF/maven/ already added, skipping
[INFO] META-INF/maven/org.openrdf.sesame/ already added, skipping
[INFO] META-INF/ already added, skipping
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] org/ already added, skipping
[INFO] META-INF/maven/ already added, skipping
[INFO] Building jar: /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/ChestBackpack-1.1.0.jar
[INFO] META-INF/ already added, skipping
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] org/ already added, skipping
[INFO] META-INF/maven/ already added, skipping
[INFO] META-INF/ already added, skipping
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] org/ already added, skipping
[INFO] org/openrdf/ already added, skipping
[INFO] META-INF/maven/ already added, skipping
[INFO] META-INF/maven/org.openrdf.sesame/ already added, skipping
[INFO] META-INF/ already added, skipping
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] org/ already added, skipping
[INFO] org/openrdf/ already added, skipping
[INFO] META-INF/maven/ already added, skipping
[INFO] META-INF/maven/org.openrdf.sesame/ already added, skipping
[INFO] META-INF/ already added, skipping
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] org/ already added, skipping
[INFO] META-INF/maven/ already added, skipping
[WARNING] Configuration options: 'appendAssemblyId' is set to false, and 'classifier' is missing.
Instead of attaching the assembly file: /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/ChestBackpack-1.1.0.jar, it will become the file for main project artifact.
NOTE: If multiple descriptors or descriptor-formats are provided for this project, the value of this file will be non-deterministic!
[WARNING] Replacing pre-existing project main-artifact file: /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/ChestBackpack-1.1.0.jar
with assembly file: /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/ChestBackpack-1.1.0.jar
[INFO]
[INFO] >>> maven-source-plugin:2.4:jar (attach-sources) > generate-sources @ ChestBackpack >>>
[INFO]
[INFO] <<< maven-source-plugin:2.4:jar (attach-sources) < generate-sources @ ChestBackpack <<<
[INFO]
[INFO] --- maven-source-plugin:2.4:jar (attach-sources) @ ChestBackpack ---
[INFO] Building jar: /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/ChestBackpack-1.1.0-sources.jar
[INFO]
[INFO] --- maven-javadoc-plugin:2.10.3:jar (attach-javadocs) @ ChestBackpack ---
[WARNING] Source files encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO]
Loading source file /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/Data/DataHandler.java...
Loading source file /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/main/ChestBackpackAPI.java...
Constructing Javadoc information...
Standard Doclet version 1.8.0_20
Building tree for all the packages and classes...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/de/sumafu/ChestBackpack/Data/DataHandler.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/de/sumafu/ChestBackpack/main/ChestBackpackAPI.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/overview-frame.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/de/sumafu/ChestBackpack/Data/package-frame.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/de/sumafu/ChestBackpack/Data/package-summary.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/de/sumafu/ChestBackpack/Data/package-tree.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/de/sumafu/ChestBackpack/main/package-frame.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/de/sumafu/ChestBackpack/main/package-summary.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/de/sumafu/ChestBackpack/main/package-tree.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/constant-values.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/de/sumafu/ChestBackpack/Data/class-use/DataHandler.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/de/sumafu/ChestBackpack/main/class-use/ChestBackpackAPI.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/de/sumafu/ChestBackpack/Data/package-use.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/de/sumafu/ChestBackpack/main/package-use.html...
Building index for all the packages and classes...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/overview-tree.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/index-all.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/deprecated-list.html...
Building index for all classes...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/allclasses-frame.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/allclasses-noframe.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/index.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/overview-summary.html...
Generating /Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs/help-doc.html...
2 errors
13 warnings
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.084 s
[INFO] Finished at: 2015-11-23T20:45:36+01:00
[INFO] Final Memory: 20M/314M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:jar (attach-javadocs) on project ChestBackpack: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/Data/DataHandler.java:13: error: package de.sumafu.ChestBackpack.Tools does not exist
[ERROR] import de.sumafu.ChestBackpack.Tools.InventoryStringDeSerializer;
[ERROR] ^
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/Data/DataHandler.java:14: error: cannot find symbol
[ERROR] import de.sumafu.ChestBackpack.main.ChestBackpack;
[ERROR] ^
[ERROR] symbol: class ChestBackpack
[ERROR] location: package de.sumafu.ChestBackpack.main
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/Data/DataHandler.java:23: error: cannot find symbol
[ERROR] public DataHandler(ChestBackpack plugin){
[ERROR] ^
[ERROR] symbol: class ChestBackpack
[ERROR] location: class DataHandler
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/Data/DataHandler.java:46: error: cannot find symbol
[ERROR] private ChestBackpack plugin;
[ERROR] ^
[ERROR] symbol: class ChestBackpack
[ERROR] location: class DataHandler
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/Data/DataHandler.java:50: error: cannot find symbol
[ERROR] private DatabaseConnector connector = null;
[ERROR] ^
[ERROR] symbol: class DatabaseConnector
[ERROR] location: class DataHandler
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/Data/DataHandler.java:51: error: cannot find symbol
[ERROR] private FlatfileHandler filehandler = null;
[ERROR] ^
[ERROR] symbol: class FlatfileHandler
[ERROR] location: class DataHandler
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/main/ChestBackpackAPI.java:17: error: package de.sumafu.ChestBackpack.Tools does not exist
[ERROR] import de.sumafu.ChestBackpack.Tools.InventoryStringDeSerializer;
[ERROR] ^
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/main/ChestBackpackAPI.java:27: error: cannot find symbol
[ERROR] public ChestBackpackAPI(ChestBackpack plugin){
[ERROR] ^
[ERROR] symbol: class ChestBackpack
[ERROR] location: class ChestBackpackAPI
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/main/ChestBackpackAPI.java:31: error: cannot find symbol
[ERROR] private ChestBackpack plugin = null;
[ERROR] ^
[ERROR] symbol: class ChestBackpack
[ERROR] location: class ChestBackpackAPI
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/main/ChestBackpackAPI.java:51: error: cannot find symbol
[ERROR] public Inventory getInventory(UUID uuid) throws CannotLoadBackpackException{
[ERROR] ^
[ERROR] symbol: class CannotLoadBackpackException
[ERROR] location: class ChestBackpackAPI
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/main/ChestBackpackAPI.java:95: error: cannot find symbol
[ERROR] public boolean openBackpack(UUID uuid) throws CannotLoadBackpackException{
[ERROR] ^
[ERROR] symbol: class CannotLoadBackpackException
[ERROR] location: class ChestBackpackAPI
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/main/ChestBackpackAPI.java:151: error: cannot find symbol
[ERROR] public ItemStack addItemStack(UUID uuid, ItemStack itemstack) throws CannotLoadBackpackException{
[ERROR] ^
[ERROR] symbol: class CannotLoadBackpackException
[ERROR] location: class ChestBackpackAPI
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/main/ChestBackpackAPI.java:193: error: cannot find symbol
[ERROR] public boolean containsItemStack(UUID uuid, ItemStack itemstack) throws CannotLoadBackpackException{
[ERROR] ^
[ERROR] symbol: class CannotLoadBackpackException
[ERROR] location: class ChestBackpackAPI
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/Data/DataHandler.java:80: error: reference not found
[ERROR] * @param invString Backpack as serialized String, see {@link InventoryStringDeSerializer}
[ERROR] ^
[ERROR] /Users/user/Entwicklung/Bukkit/java/ChestBackpack/src/de/sumafu/ChestBackpack/main/ChestBackpackAPI.java:49: error: reference not found
[ERROR] * @throws CannotLoadBackpackException Throw if backpack cannot be loaded
[ERROR] ^
[ERROR]
[ERROR] Command line was: /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/jre/../bin/javadoc @options @argfile
[ERROR]
[ERROR] Refer to the generated Javadoc files in '/Users/user/Entwicklung/Bukkit/java/ChestBackpack/target/apidocs' dir.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
My code is open source and you can finde it on my BitBucket page我的代码是开源的,你可以在我的BitBucket 页面上找到它
I hope you can help me.我希望你能帮助我。
Try this:尝试这个:
<configuration>
<sourceFileIncludes>
<include>**/DataHandler.java</include>
<include>**/ChestBackpackAPI.java</include>
</sourceFileIncludes>
</configuration>
Sourcepaths
must point to the root folder of the sources, they must not include package information. Sourcepaths
必须指向源的根文件夹,它们不能包含包信息。 The sourceFileIncludes
must contain package information. sourceFileIncludes
必须包含包信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.