0

Hello stackoverflow users. I created a maven project, but there is no place called "Maven Dependecies" in the project explorer. How can I solve this.

Project Explorer

The content of 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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>test</groupId> <artifactId>01-com.maven</artifactId> <version>0.0.1-SNAPSHOT</version> </project> 
2
  • Which project explorer? Commented Dec 19, 2020 at 12:40
  • Did you read official docs? Commented Dec 19, 2020 at 12:43

2 Answers 2

2

Because you don't have any dependency the Maven Dependencies section will be empty. Take a look the the official documentation and follow the instructions how to add a dependency with the desired scope e.g.

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>test</groupId> <artifactId>01-com.maven</artifactId> <version>0.0.1-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.11</version> <!-- this is a compile scoped dependency so it available in production code and the tests and in runtime --> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> <version>5.7.0</version> <scope>test</scope> <!-- it will be only available during compiling and running test classes --> </dependency> </dependencies> </project> 
Sign up to request clarification or add additional context in comments.

Comments

0

You might want to add the dependencies section to your 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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>test</groupId> <artifactId>01-com.maven</artifactId> <version>0.0.1-SNAPSHOT</version> <dependencies> <dependency> <groupId>group-a</groupId> <artifactId>artifact-a</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>group-a</groupId> <artifactId>artifact-b</artifactId> <version>1.0</version> <type>bar</type> <scope>runtime</scope> </dependency> </dependencies> </project> 

Excerpt from Maven's documentation

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.