简体   繁体   English

pom.xml中的错误,maven问题

[英]Error in pom.xml, maven issue

Few days back my maven project was running fine. 几天后,我的maven项目运行良好。 Out of nowhere I started getting this weird error. 无处不在,我开始得到这个奇怪的错误。

org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration) org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject,org.apache.maven.archiver.MavenArchiveConfiguration)

I am attaching image also to show how it actually shows this error. 我附加图像也显示它实际上是如何显示此错误。 pom文件中的实际错误

My pom file looks like this... 我的pom文件看起来像这样......

    <?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>SS</artifactId>
        <groupId>com.rolta.dss</groupId>
        <version>5.2.0.16</version>
    </parent>

    <artifactId>AndroidImpl</artifactId>

    <packaging>apk</packaging>
    <name>AndroidImpl</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <platform.version></platform.version>
        <android.plugin.version>3.8.2</android.plugin.version>
        <jdk.version>6</jdk.version>
        <jdk>${env.JAVA_HOME}</jdk>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.rolta.dss</groupId>
            <artifactId>Core</artifactId>
            <version>5.2.0.16</version>
        </dependency>
        <dependency>
            <groupId>com.rolta.support</groupId>
            <artifactId>android-support</artifactId>
            <version>v13</version>

        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.12</version>
        </dependency>

        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android</artifactId>
            <version>4.1.1.4</version>
            <scope>provided</scope>
        </dependency>


    </dependencies>
    <build>
        <finalName>${env.BUILD_NAME}</finalName>
        <sourceDirectory>src</sourceDirectory>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                    <artifactId>android-maven-plugin</artifactId>
                    <version>3.9.0-rc.2</version>
                    <extensions>true</extensions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <configuration>
                    <sdk>
                        <platform>19</platform>
                    </sdk>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                    <executable>${jdk}/bin/javac</executable>
                    <fork>true</fork>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
                <configuration>
                    <jvm>${jdk}/bin/java</jvm>
                    <forkMode>once</forkMode>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

I have tried removing .m2 folder, checked if any of the dependency was missing in .m2 folder(everything is present). 我已经尝试删除.m2文件夹,检查.m2文件夹中是否缺少任何依赖项(一切都存在)。 When i do maven clean and maven install i get build success message. 当我做maven clean和maven安装时,我得到构建成功消息。 I have also checked jdk version(it's 1.6).Even i tried in new eclipse still the issue persists. 我还检查了jdk版本(它是1.6)。即使我在新的日食中尝试过,问题仍然存在。

Is there anything else which i am missing? 还有什么我想念的吗? Thanks in advance. 提前致谢。

The issue is related with the m2e-plugin in eclipse. 这个问题与eclipse中的m2e-plugin有关。 You can verify by running maven from commandline (which you already did), which should give no error. 你可以通过从命令行(你已经做过)运行maven来验证,这应该没有错误。

It's because of UTF-8 formatted (BOM at the beginning) pom. 这是因为UTF-8格式化(开头的BOM)pom。

https://github.com/tesla/m2eclipse-mavenarchiver/issues/6 https://github.com/tesla/m2eclipse-mavenarchiver/issues/6

You could try with the latest: https://otto.takari.io/content/sites/m2e.extras/m2eclipse-mavenarchiver/0.17.0/N/LATEST/ 您可以尝试使用最新的: https//tto.takari.io/content/sites/m2e.extras/m2eclipse-mavenarchiver/0.17.0/N/LATEST/

While searching the cause of the issue i stumbled on this link eclipse issue with the pom 在搜索问题的原因时,我偶然发现这个链接与pom的eclipse问题

So I checked my current version of the m2e plugin and the sonatype version it was something 所以我检查了我当前版本的m2e插件和sonatype版本它是什么

m2e - Maven Integration for Eclipse 1.4.0.20130601-0317 org.eclipse.m2e.feature.feature.group and m2e - Eclipse的Maven集成1.4.0.20130601-0317 org.eclipse.m2e.feature.feature.group

0.17.0.201502101659 org.sonatype.m2e.mavenarchiver.feature.feature.group Sonatype, Inc. respectively. 分别为0.17.0.201502101659 org.sonatype.m2e.mavenarchiver.feature.feature.group Sonatype,Inc

I checked current version this way (Help > about eclipse > installation details) 我用这种方式检查了当前版本(帮助>关于eclipse>安装细节)

Then i uninstalled those two plugins and issue was resolved. 然后我卸载了这两个插件,问题解决了。

To uninstall (Help > about eclipse > installation details > select the plugin > uninstall) 要卸载(帮助>关于eclipse>安装细节>选择插件>卸载)

I uninstalled them because i wanted to upgrade the m2e to the latest version ie 1.6 update m2e link 我卸载它们是因为我想将m2e升级到最新版本,即1.6 更新m2e链接

I was unable to upgrade due to someother reason so i tried uninstalling the previous version and thought of updating the latest one. 由于其他原因,我无法升级所以我尝试卸载以前的版本,并考虑更新最新版本。 But once I uninstalled the previous version issue was resolved. 但是一旦我卸载了以前的版本问题就解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM