maven pom文件有html代码而不是xml

时间:2016-07-14 14:48:46

标签: xml maven pom.xml

我从命令行运行mvn install,我收到以下错误......

[ERROR] 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: 1 problem was encountered while building the effective model
[ERROR] [FATAL] Non-parseable POM C:\Users\Gary\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.6\maven-resources-plugin-2.6.pom: entity reference names can not start with character '&' (position: START_TAG seen ...nction d(a){var c,d,e,f=b.createElement("canvas"),g=f.getContext&&... @14:89)  @ line 14, column 89

我决定在我的本地maven存储库中打开maven-resources-plugin:2.6的pom文件,这就是我发现的:

行家资源-插件-2.6.pom

<!DOCTYPE html>
<html lang="de-DE">
<head>
<title>Mein Block &#8211; Ein weiterer WordPress-Blog</title>
<meta name='robots' content='noindex,follow' />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="template" content="Ignite 1.60" />
<meta name="generator" content="WordPress 4.5.3" />
<link rel="alternate" type="application/rss+xml" title="Mein Block &raquo; 
...

出于某种原因,这是一个德语wordpress博客文件。

我的settings.xml是.m2目录和conf目录中的默认文件。我还更新了最新版本的Maven。

还有一件事,我注意到可能有用的是与poms在同一目录中的文件_remote.repositories,其中包含以下内容:

#NOTE: This is an Aether internal implementation file, its format can be    changed without prior notice.
#Thu Jul 14 10:22:00 EDT 2016
maven-resources-plugin-2.6.pom>release-repo1.php-maven.org=
maven-resources-plugin-2.6.pom>central=

您能否帮我弄清楚为什么我的项目无法正确构建?感谢。

2 个答案:

答案 0 :(得分:2)

当我在项目中有公司存储库,而我不在VPN上时,我就拥有这个。要获取所有库,我可以这样做:

1._I首先将Mvn依赖项添加到pom.xml中(如果您没有,则可以省略此步骤):

<repositories>
    <repository>
        <id>mvn</id>
        <name>mvn</name>
        <url>http://maven.icm.edu.pl/artifactory/repo/</url>
    </repository>
...other resps

2 .__ I删除整个.m2 / repositories目录,或者使用以下命令搜索损坏的文件:

grep -R -l -L groupId  --include \*.pom   //Search all that not contain groupId string

(在.m2目录中执行此操作)

答案 1 :(得分:0)

我在Maven central中查找了maven-resources-plugin 2.6的pom,它只是一个普通的pom,而不是你所拥有的奇怪的HTML文件。因此,您可能应该删除(部分)本地存储库并从Maven Central重新加载文件。