【发布时间】:2013-11-14 08:37:28
【问题描述】:
我有一个在 Eclipse 中使用 Maven 的动态 Web 项目。
每次重启 Eclipse 时,Maven 依赖项都会在“Web 部署程序集”下的项目属性中消失。
每次重启eclipse后都要手动添加maven依赖,很烦。有没有遇到同样的问题?
这是我的 pom.xml(即使我认为这不是 maven 问题而是 eclipse 问题):
<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>de.synapsis</groupId>
<artifactId>whm</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0-beta9</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0-beta9</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901.jdbc4</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.4</version>
</dependency>
</dependencies>
</project>
【问题讨论】:
-
也许 Eclipse 在关闭时无法保存工作区配置。或者文件不可写。
-
你在使用插件吗?如果有,是哪个?
-
我正在使用 m2e 插件 1.4.0.20130601-0317
-
和以下 Eclipse:面向 Web 开发人员的 Eclipse Java EE IDE。版本:Juno Service Release 1 Build id:20120920-0800
-
重启 eclipse 后你的 pom.xml 文件有变化吗?你能拍下pom文件的快照并比较一下吗,我从来没有见过这个东西
标签: java eclipse maven servlets