Java – Maven version cannot be changed in the eclipse ide

There was no MVN package inside eclipse, but after success in the terminal, I realized that eclipse was running Maven 3.3 3. Terminal operation 9. I try to succeed through all obvious accounts, reconfigure eclipse by accessing eclipse – > preferences – > maven – > install and point to my 3.3 9 folders I restarted eclipse and tried again, but nothing was available In addition, when you try to build, you do not confirm the connection to POM Changes to XML files I inserted inappropriate slashes and other characters. I can only generate this error:

Error assembling War: Web. Is required XML attribute (pre-existing WEB-INF / Web. XML if executed in update mode)

I modified my POM file according to this recommendation, but as I said, Maven didn't recognize the changes to POM, and I couldn't run MVN – version to generate 3.3 9. I attached my POM below 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.javawebtutor</groupId>
<artifactId>LoginWebApp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>LoginWebApp Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
    </dependency>
    <dependency>
        <groupId>MysqL</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.30</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
    </dependency>
</dependencies>
<build>
    <finalName>LoginWebApp</finalName>
    <plugins>
    <plugin>            
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-war-plugin</artifactId>
      <configuration>
        <webXml>src\main\webapp\WEB-INF\web.xml</webXml>        
      </configuration>
    </plugin>
    </plugins>
</build>

Solution

Try setting up the runtime configuration, or check to see if you already have one

In eclipse, right-click the project – > run as - > run configuration Find the M2 Maven build section on the left If there is one under the project name, edit it, otherwise create one There is a drop-down list at the bottom of the dialog box that allows you to select the Maven configuration to run:

This gives me the following output:

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11 10T11:41:47-05:00)
Maven home: C:\Program Files\Java\apache-maven-3.3.9
Java version: 1.7.0_80,vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_80\jre
Default locale: en_US,platform encoding: UTF-8
OS name: "windows 8.1",version: "6.3",arch: "amd64",family: "windows"
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>