search

Home  >  Q&A  >  body text

java-web - 使用eclipse创建javaweb 项目 maven报错

使用eclipse创建 dynamic web project

在将项目转换成maven项目时保如下错误

pom文件为eclipse 自动生成没有改动 如下

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

<code><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>test</groupId>

  <artifactId>test</artifactId>

  <version>0.0.1-SNAPSHOT</version>

  <packaging>war</packaging>

  <build>

    <sourceDirectory>src</sourceDirectory>

    <plugins>

      <plugin>

        <artifactId>maven-compiler-plugin</artifactId>

        <version>3.5.1</version>

        <configuration>

          <source>1.8</source>

          <target>1.8</target>

        </configuration>

      </plugin>

      <plugin>

        <artifactId>maven-war-plugin</artifactId>

        <version>2.6</version>

        <configuration>

          <warSourceDirectory>WebContent</warSourceDirectory>

          <failOnMissingWebXml>false</failOnMissingWebXml>

        </configuration>

      </plugin>

    </plugins>

  </build>

</project>

</code>

目前已经试过以下方法 都不奏效

1.强行update项目,报错同上

2.删除.m2/repository下的.lastUpdated文件,clean项目之后 再update

3.将插件版本改为低版本2.0

搜索了好多也没有找到答案 ,求高人指点
===============
settings.xml文件

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

<code>        <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"

                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

          <pluginGroups>

          </pluginGroups>

          <proxies>

 

          </proxies>

            <servers>

                <server>

                <id>releases</id>

                <username>admin</username>

                <password>admin123</password>

                </server>

                <server>

                <id>snapshots</id>

                <username>admin</username>

                <password>admin123</password>

                </server>

            </servers>

            <mirrors>

 

 

 

                <mirror>

                <id>nexus</id>

                <mirrorOf>*</mirrorOf>

                <url>http://192.168.15.1:8080/nexus/content/groups/public/</url>

 

                </mirror>

            </mirrors>

            <profiles>

                <profile>

                <id>nexus</id>

                <repositories>

 

 

                <repository>

                    <id>central</id>

                     <url>http://192.168.15.1:8080/nexus/content/repositories/central/</url>

 

                    <releases>

                        <enabled>true</enabled>

                    <!--    <updatePolicy>always</updatePolicy>-->

                    </releases>

                    <snapshots>

                        <enabled>true</enabled>

                    <!--    <updatePolicy>always</updatePolicy>-->

                    </snapshots>

                </repository>

                </repositories>

 

                <pluginRepositories>

 

                <pluginRepository>

                    <id>central</id>

                 <url>http://192.168.15.1:8080/nexus/content/repositories/central/</url>

 

                    <releases>

                        <enabled>true</enabled>

                    <!--    <updatePolicy>always</updatePolicy>-->

                    </releases>

                    <snapshots>

                        <enabled>true</enabled>

                    <!--    <updatePolicy>always</updatePolicy>-->

                    </snapshots>

                </pluginRepository>

                </pluginRepositories>

                </profile>

            </profiles>

            <activeProfiles>

                <activeProfile>nexus</activeProfile>

            </activeProfiles>

        </settings></code>

nexus页面可以进入

PHP中文网PHP中文网2802 days ago931

reply all(1)I'll reply

  • 阿神

    阿神2017-04-24 09:14:08

    Please check whether your own nexus (192.168.15.1:8080/nexus) maven library agent is working properly and confirm that nexus has the plug-ins you need

    reply
    0
  • Cancelreply