how to configure dependencies in maven pom.xml?

pushya

I am converting my simple working web application (runs from eclipse) to a maven project. This is my first maven project. I have 3 external jar dependencies to it and i added then to the pom.xml my build is failing saying that it can't find those 3 dependencies. here my pom.xml file

enter image description here The build is saying that the 3 packages does not exist.

package javax.servlet does not exist
package org.apache.commons.codec.binary does not exist
package org.apache.commons.configuration does not exist

What i am missing? I am running my application from Mac and in the .m2/repository i see these 3 libraries/packages present.

Jonathan

You need to either remove the dependencyManagement tags that surround dependencies or add the dependencies again but nested within the project tag, i.e. at the same level as dependencyManagement.

dependencyManagement allows you to fix information about dependencies across a multi-module project - e.g. like version numbers - however you still need to provide a dependencies section alongside that so that Maven knows to include them.

If your project is not a multi-module project I would be tempted to not use a dependencyManagement section at all.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to configure "tomcat7-maven-plugin" in pom.xml?

jBPM Maven dependencies not showing in pom.xml

Maven POM dependencies to ivy.xml file

maven dose not download dependencies in pom.xml

How to download Maven dependencies into a local repository, only from pom.xml, not from Maven itself

Maven: Include dependencies from pom.xml located in one of the dependencies

How to sort dependencies in a section of a Maven POM file

How does Maven satisfy GroupID:Artifact dependencies defiend in the pom.xml?

How can I add additional dependencies for my maven project without committing it to pom.xml file?

how to configure maven exec to run class from the jar deployed from its pom.xml?

How do you configure a Maven/SpringBoot Project's pom.xml for docker?

Maven update dependencies in POM

Maven dependencies are added automatically to my pom.xml

Maven- Significance of ordering of dependencies in POM.xml

Can't add dependencies on maven pom.xml file

Reading a version through property in Maven pom.xml dependencies

Configure Sonar to exclude files from Maven pom.xml

Configure maven plugin version without changing pom.xml manually

How to simplify same exclusion on multiple dependencies in maven pom

How to generate custom maven archetype with selected dependencies from the pom?

How to configure intellij to run all maven plugins specified in the pom file

maven pom xml variables

How to handle different dependencies requirements for web servers in pom.xml

How to configure mvn dependency:analyze in the pom.xml

How to configure Eclipse build path to use Maven dependencies?

Maven: package org.junit does not exist even though it is declared in dependencies list in pom.xml

maven-enforcer-plugin complains about dependencies that I cannot find in pom.xml files

How to rewrite MAVEN POM.XML COMBINE.SELF

How to variablize shell script output on maven pom.xml to use