maven没有在Eclipse

时间:2016-11-17 08:17:48

标签: java eclipse maven itext7

1)我正在尝试在Eclipse中创建一个itext项目(Neon.1a Release(4.6.1))。

2)要在我的项目中添加iText7,我会从链接https://www.youtube.com/watch?v=sxArv-GskLc关注视频教程。

3)我按照视频中的描述进行了操作,但maven依赖项未添加到项目中。这样我就可以从http://developers.itextpdf.com/content/itext-7-jump-start-tutorial/installing-itext-7

复制依赖代码

4)然后将其添加到pom.xml文件并将项目作为maven install运行。但仍未将maven依赖项添加到项目中。我附上了笔记本电脑屏幕的屏幕截图供参考。

enter image description here

这是我按照这些步骤进行视频的另一个屏幕截图,

enter image description here

请指导我解决这个问题。提前致谢。 :)

这是我的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>com.itextpdf</groupId>
  <artifactId>jumpstart</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>iText7 jumpstart</name>
  <description>jumpstarting itext7</description>
  <dependencies>
    <dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>kernel</artifactId>
        <version>7.0.0</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>io</artifactId>
        <version>7.0.0</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>layout</artifactId>
        <version>7.0.0</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>forms</artifactId>
        <version>7.0.0</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>pdfa</artifactId>
        <version>7.0.0</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>pdftest</artifactId>
        <version>7.0.0</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.7.18</version>
    </dependency>
</dependencies>
</project>

1 个答案:

答案 0 :(得分:1)

Finally it work. Here what I did,
In Eclipse,
1) Go to windows tab-> preferences ->maven,
   Here I check the box for,
  1) Download Artifacts for JavaDoc
  2) Download repository index updates on startup.

2) clean All project,
  1) Project tab ->clean.

3) Restarted Eclipse, and Run As maven install. Done.