0

I have a dynamic web project using Maven in eclipse.

Each time eclipse is restarted the Maven dependencies are disappearing in the project properties under "Web Deployment Assembly".

I have to add the maven dependencies after each restart of eclipse manually, which is very annoying. Does anyway encountered the same issue?

Here is my pom.xml (even if I think it is not a maven problem but an eclipse problem):

<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>
t7bdh3hdhb
  • 438
  • 3
  • 15

1 Answers1

0

Your maven project should be of type war (if you don't specify, it will be of type jar).

Also, I suspect you're doing some manual configuration of Eclipse. Usually the best way is to start with a clean project with no eclipse metadata (delete .project, .classpath, and .settings), then import the project with Import -> Maven Project. The m2e built into Eclipse will configure the project for you.

artbristol
  • 32,010
  • 5
  • 70
  • 103