我正在尝试使用epublib代码库。我认为我的Maven文件设置正确。依赖项确实已下载,并且位于我的.m2文件夹中。但是,我无法正确完成Maven构建。
我用过 mvn安装, mvn全新安装, mvn软件包,
如果我删除了epublib依赖项,那么一切正常。那么,在设置pom文件时我会错过什么呢?或者我可以使用其他什么方式使用epublib库。
<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>epub</groupId>
<artifactId>epubfix</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>EPub file Correction</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-
8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>nl.siegmann.epublib</groupId>
<artifactId>epublib-core</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>nl.siegmann.epublib</groupId>
<artifactId>epublib-tools</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>nl.siegmann.epublib</groupId>
<artifactId>epublib-parent</artifactId>
<version>3.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
I expect to see something like
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------------------------------------------------
[INFO] Building EPub file Correction 0.0.1-SNAPSHOT
[INFO] -------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources)
@ epubfix ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @
epubfix ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-
testResources) @ epubfix ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
/Users/dyk/Eclipse/workspace/epub/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-
testCompile) @ epubfix ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @
epubfix ---
[INFO] Surefire report directory:
/Users/dyk/Eclipse/workspace/epub/target/surefire-reports
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ epubfix ---
[INFO] Building jar:
/Users/dyk/Eclipse/workspace/epub/target/epubfix-0.0.1-SNAPSHOT.jar
[INFO] META-INF/maven/epub/epubfix/pom.xml already added, skipping
[INFO] META-INF/maven/epub/epubfix/pom.properties already added,
skipping
[INFO] -------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] -------------------------------------------------------------
[INFO] Total time: 1.269 s
[INFO] Finished at: 2019-04-12T10:57:11-06:00
[INFO] Final Memory: 12M/309M
[INFO] -------------------------------------------------------------
However, I am getting this error.
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------------------------------------------------
[INFO] Building EPub file Correction 0.0.1-SNAPSHOT
[INFO] -------------------------------------------------------------
[INFO] Downloading:
https://repo.maven.apache.org/maven2/nl/siegmann/epublib/epublib-
core/3.1/epublib-core-3.1.pom
[WARNING] The POM for nl.siegmann.epublib:epublib-core:jar:3.1 is
missing, no
dependency information available
[INFO] Downloading:
https://repo.maven.apache.org/maven2/nl/siegmann/epublib/epublib-
tools/3.1/epublib-tools-3.1.pom
[WARNING] The POM for nl.siegmann.epublib:epublib-tools:jar:3.1 is
missing, no
dependency information available
[INFO] Downloading:
https://repo.maven.apache.org/maven2/nl/siegmann/epublib/epublib-
parent/3.1/epublib-parent-3.1.pom
[WARNING] The POM for nl.siegmann.epublib:epublib-parent:pom:3.1 is
missing, no
dependency information available
[INFO] Downloading:
https://repo.maven.apache.org/maven2/nl/siegmann/epublib/epublib-
core/3.1/epublib-core-3.1.jar
[INFO] Downloading:
https://repo.maven.apache.org/maven2/nl/siegmann/epublib/epublib-
tools/3.1/epublib-tools-3.1.jar
[INFO] -------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] -------------------------------------------------------------
[INFO] Total time: 1.293 s
[INFO] Finished at: 2019-04-12T10:11:37-06:00
[INFO] Final Memory: 13M/309M
[INFO] -------------------------------------------------------------
[ERROR] Failed to execute goal on project epubfix: Could not resolve
dependencies for project epub:epubfix:jar:0.0.1-SNAPSHOT: The
following
artifacts could not be resolved: nl.siegmann.epublib:epublib-
core:jar:3.1,
nl.siegmann.epublib:epublib-tools:jar:3.1,
nl.siegmann.epublib:epublib-
parent:pom:3.1: Could not find artifact nl.siegmann.epublib:epublib-
core:jar:3.1 in central (https://repo.maven.apache.org/maven2) ->
[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/DependencyResolutionException
答案 0 :(得分:0)
依赖项
<dependency>
<groupId>nl.siegmann.epublib</groupId>
<artifactId>epublib-core</artifactId>
<version>3.1</version>
</dependency>
不在MavenCentral中。您需要配置正确的存储库(或者,如果是拼写错误,请对其进行更正)。