How can I remove maven dependency jar in Eclipse

JSmith :

I'm really new to Maven and just converted my app-engine project to a Maven project. I've added dependencies in the pom.xml file in order to get rid of the errors. but now I get in my code

The method getPart(String) is undefined for the type HttpServletRequest

So after doing a bit of research on Stack Overflow it appears I need to have a single and updated package of servlet-api to make that work properly.

Apparently I may have a conflict with an older version that is in my Maven dependencies but I never added it in the pom.xml and now I'm stuck with this jar not knowing why it is imported and how I can delete it.

Here is my pom.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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>my-project</groupId>
  <artifactId>my-project</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.2.1</version>
            <configuration>
                 <webResources>
                    <resource>
                        <directory>${basedir}/src/main/webapp/WEB-INF</directory>
                        <filtering>true</filtering>
                        <targetPath>WEB-INF</targetPath>
                    </resource>
                </webResources>
            </configuration>
      </plugin>
      <plugin>
        <groupId>com.google.cloud.tools</groupId>
        <artifactId>appengine-maven-plugin</artifactId>
         <version>1.3.1</version>
            <configuration>
                 <deploy.promote>true</deploy.promote>
                <deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
            </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
    </dependency>
    <dependency>
        <groupId>com.mailjet</groupId>
        <artifactId>mailjet-client</artifactId>
        <version>4.2.1</version>
    </dependency>
    <dependency>
        <groupId>com.google.appengine.tools</groupId>
        <artifactId>appengine-gcs-client</artifactId>
        <version>0.8</version>
    </dependency>
  </dependencies>
  <properties>
  <maven.compiler.source>1.8</maven.compiler.source>
  <maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>

and here are images of what I get in Maven dependencies in my build path.

my guess is that the error comes from having a 2.5 version of the servlet-api.

build path section eventual conflict with servlet-api 2.5 and 3.1

So any help is greatly appreciated, I saw something about the exclusion tag but don't even know where to put it as it doesn't look like anything in the pom.xml is asking for this jar.

Little Santi :

You'd better open in Eclipse your pom.xml file and switch to the "dependency hierarchy" tab. Look for the undesired library (type in "serlvet" in the filter) and add exclusion on it through the context menu. This will modify your pom.xml file.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How do I add a Maven dependency in Eclipse?

From Java

How to tell Maven to include the jar dependency, not the subproject source directory in Eclipse?

From Dev

Eclipse - How to add a project as a Maven dependency to another, instead of adding as a jar?

From Dev

How can I get Jetty to scan the Maven dependency jar files in the class path?

From Java

How can I add JDT as a Maven dependency?

From Dev

How can I add LIRE dependency to Maven?

From Dev

how to add jar dependency in maven?

From Java

How do I enable index downloads in Eclipse for Maven dependency search?

From Dev

How can I use a Maven project as a dependency to another Maven project?

From

Eclipse Maven dependency jar grayed out, can't import classes from it

From Java

How can I build WAR with Maven in Eclipse?

From Dev

How can I determine if upgrading a dependency will break a jar file?

From Dev

Eclipse can't find Maven dependency package

From Java

How can I have a Maven dependency on the runtime classpath but not the test classpath?

From Dev

How can I access a class from a external maven dependency in GWT?

From Dev

How can I determine the maven dependency for org.testobject

From Dev

How can I select the output of maven dependency:list?

From Java

Can I add a directory containing a jar and its dependant jars as a maven dependency?

From Java

How to download maven dependency as *.jar file?

From Java

How to find the usage of a jar imported by maven dependency?

From Java

How to get path to dependency jar with maven

From Java

How do I remove Maven from a Eclipse java project?

From Dev

Eclipse (Photon) couldn't find my maven dependency jar

From Dev

How can I remove dependency on body-parser?

From Dev

How can I remove a dependency between two gesture recognizers?

From Dev

How can I remove/refactor a «friend» dependency declaration properly?

From Dev

Why can't I get the wss4j maven dependency in eclipse?

From Java

How to search for a maven dependency automatically in eclipse?

From Java

How to fix Maven, Maven Configuration and Maven Dependency Problems in Eclipse

Related Related

  1. 1

    How do I add a Maven dependency in Eclipse?

  2. 2

    How to tell Maven to include the jar dependency, not the subproject source directory in Eclipse?

  3. 3

    Eclipse - How to add a project as a Maven dependency to another, instead of adding as a jar?

  4. 4

    How can I get Jetty to scan the Maven dependency jar files in the class path?

  5. 5

    How can I add JDT as a Maven dependency?

  6. 6

    How can I add LIRE dependency to Maven?

  7. 7

    how to add jar dependency in maven?

  8. 8

    How do I enable index downloads in Eclipse for Maven dependency search?

  9. 9

    How can I use a Maven project as a dependency to another Maven project?

  10. 10

    Eclipse Maven dependency jar grayed out, can't import classes from it

  11. 11

    How can I build WAR with Maven in Eclipse?

  12. 12

    How can I determine if upgrading a dependency will break a jar file?

  13. 13

    Eclipse can't find Maven dependency package

  14. 14

    How can I have a Maven dependency on the runtime classpath but not the test classpath?

  15. 15

    How can I access a class from a external maven dependency in GWT?

  16. 16

    How can I determine the maven dependency for org.testobject

  17. 17

    How can I select the output of maven dependency:list?

  18. 18

    Can I add a directory containing a jar and its dependant jars as a maven dependency?

  19. 19

    How to download maven dependency as *.jar file?

  20. 20

    How to find the usage of a jar imported by maven dependency?

  21. 21

    How to get path to dependency jar with maven

  22. 22

    How do I remove Maven from a Eclipse java project?

  23. 23

    Eclipse (Photon) couldn't find my maven dependency jar

  24. 24

    How can I remove dependency on body-parser?

  25. 25

    How can I remove a dependency between two gesture recognizers?

  26. 26

    How can I remove/refactor a «friend» dependency declaration properly?

  27. 27

    Why can't I get the wss4j maven dependency in eclipse?

  28. 28

    How to search for a maven dependency automatically in eclipse?

  29. 29

    How to fix Maven, Maven Configuration and Maven Dependency Problems in Eclipse

HotTag

Archive