Galli
Galli

Reputation: 23

Proper adding repositories in Maven 3 pom.xml

Every time i build something with Mavent i muss struggle with the searching a proper repo for the required Maven artifact. As now i am searching the repo for the spring-aop but can not find one. Actual pom.xml follows.

How can i approach assembling pom.xml properly?

Thanks.

<repositories>
    <repository>
        <id>springsource-milestone</id>
        <url>http://maven.springframework.org/milestone</url>
    </repository>
    <repository>
        <id>org.springframework.repository.maven</id>
        <name>SpringSource Maven Repository</name>
        <url>http://repository.springframework.org/maven/</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.aop</artifactId>
        <version>3.1.1.RELEASE</version>
    </dependency>
</dependencies>

Upvotes: 2

Views: 8698

Answers (2)

khmarbaise
khmarbaise

Reputation: 97359

I would recommend to use a repository manager instead of added repositories to the pom.

Upvotes: 0

Raghuram
Raghuram

Reputation: 52625

The artifact spring-aop is present in maven central repo.

Normally most of the released artifacts are present in maven central which need not be explicitly specified in pom.xml. You can use the search option of the central repo for this.

In the question above, you would need to include the additional spring repos only if you were looking for milestone (alpha/beta) releases.

Upvotes: 1

Related Questions