簡體   English   中英

更新Maven配置時出錯

[英]Error Updating Maven Configuration

我下載了這個項目(將項目名稱轉換為Pdf轉換為文檔) https://github.com/yeokm1/docs-to-pdf-converter在github上,然后我嘗試在Eclipse中導入,但是出了點問題。 我得到這個錯誤。

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6

我的pom.xml中也有錯誤(此文件上有紅叉),但這是我的第一個maven項目,無法檢測到該問題。 這里的代碼:

<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>docs-to-pdf-converter</groupId>
    <artifactId>docs-to-pdf-converter</artifactId>
    <version>1.8</version>
    <build>
        <sourceDirectory>src</sourceDirectory>
        <resources>
            <resource>
                <directory>src</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>args4j</groupId>
            <artifactId>args4j</artifactId>
            <version>2.32</version>
        </dependency>
        <dependency>
            <groupId>org.docx4j</groupId>
            <artifactId>docx4j</artifactId>
            <version>3.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.12</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>3.12</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-scratchpad</artifactId>
            <version>3.12</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>org.apache.poi.xwpf.converter.pdf</artifactId>
            <version>1.0.5</version>
        </dependency>
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itextpdf</artifactId>
            <version>5.5.6</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>org.odftoolkit.odfdom.converter.pdf</artifactId>
            <version>1.0.5</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>fr.opensagres.xdocreport.itext.extension</artifactId>
            <version>1.0.5</version>
        </dependency>
    </dependencies>
</project>

我試圖通過許多解決方案來解決其他許多問題,但是沒有人為我工作。

1)我試圖刪除.m2文件夾:不起作用

2)嘗試右鍵單擊該項目,然后單擊“ Maven更新項目:相同錯誤”。 不起作用

3)我嘗試轉到WINDOW-PREFERENCE-MAVEN-INSTALLATION,然后使用包含Maven的文件夾更改了Embedded,在我的情況下,C:\\ Maven不起作用

4)我嘗試去安裝了WINDOW-PREFERENCE-JAVA的JRE,開始時我只有C:\\ Program Files \\ Java \\ jre1.8.0_65,然后我讀了一些需要Jdk 7的地方,所以我下載了安裝它,但也無法正常工作。 所以,現在我有了這兩個C:\\ Program Files \\ Java \\ jdk1.7.0_79和C:\\ Program Files \\ Java \\ jre1.8.0_65

我還發布了有關Environment變量的圖片(我沒有足夠的聲譽來發布兩個,以便也查看Path Environment Variable),也許我看不到明顯的東西。 在此處輸入圖片說明

預先很抱歉,因為這可能是一個非常簡單的問題,但是正如我上面所說,這是我的第一個使用maven / eclipse的項目,我不是該領域的專家。

我下載了該項目,並使用Eclipse Mars對其進行了很好的編譯。

聽起來您的Maven安裝不知道如何上網查找工件。 可能會有防火牆嗎?

另外,在Eclipse中,轉到“窗口/首選項/ Maven /用戶設置”。 確保settings.xml與外部Maven安裝所使用的相同(假設您正在使用外部Maven引擎)。 例如,我將全局和用戶配置文件都設置為C:\\ development \\ tools64 \\ apache-maven-3.3.3 \\ conf \\ settings.xml

我檢查了settings.xml,沒有指向Maven中央存儲庫的配置-Maven 3必須知道在哪里可以找到它。

在第一次編譯時,您應該看到很多信息消息,說明Maven正在下載工件。 下次您編譯時,這些消息將不會出現,因為相關性現在已緩存在本地存儲庫中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM