ssayyed
ssayyed

Reputation: 796

Maven repository structure

I don't understand how to drop jars manually to a local maven repository, and using this structure to write the project POM. here is an example, I'm trying to add a dependency "spring-dao" jar to my project

a snippet from the pom

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-dao</artifactId>
        <version>2.0.3.RELEASE</version>
    </dependency> 

And the jar is located at path/to/maven-repo/org/springframework/spring-dao/2.0.3.RELEASE/spring-dao-2.0.3.RELEASE.jar

However, dependency still not recognised.

Can anybody please explain how this works?

Thanks.

Upvotes: 0

Views: 414

Answers (1)

Petr Mensik
Petr Mensik

Reputation: 27496

Is your repository located on the default path?Like /home/username/.m2/?Because if not, you have to specify it in settings.xml like

<localRepository>/dev/m2repo</localRepository>

And then build your project with mvn install -s path/to/settings.xml

Btw spring-dao is in Maven central so why don't use the dependency from there?

Upvotes: 1

Related Questions