7

When including into pom.xml

<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>org.springframework.security.web</artifactId>
    <version>3.0.5.RELEASE</version>
</dependency>

with repositories

    <repository>
        <id>com.springsource.repository.bundles.milestone</id>
        <name>EBR Spring Milestone Repository</name>
        <url>http://repository.springsource.com/maven/bundles/milestone</url>
    </repository>
    <repository>
        <id>org.springframework.maven.milestone</id>
        <name>Maven Central Compatible Spring Milestone Repository</name>
        <url>http://maven.springframework.org/milestone</url>
    </repository>
    <repository>
        <id>com.springsource.repository.bundles.release</id>
        <name>EBR Spring Release Repository</name>
        <url>http://repository.springsource.com/maven/bundles/release</url>
    </repository>
    <repository>
        <id>com.springsource.repository.bundles.external</id>
        <name>EBR External Release Repository</name>
        <url>http://repository.springsource.com/maven/bundles/external</url>
    </repository>

I get the following error message when doing the maven build:

The POM for org.springframework.security:org.springframework.security.web:jar:3.0.5.RELEASE is missing, no dependency information available

Other spring libraries are included well. What's going wrong? Thank you for any help.


Update

I simplified pom.xml to

<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<packaging>jar</packaging>
<version>1.0.1</version>
<name>test</name>
<url>http://test</url>
<dependencies>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>org.springframework.security.web</artifactId>
        <version>3.0.5.RELEASE</version>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>com.springsource.repository.bundles.milestone</id>
        <name>EBR Spring Milestone Repository</name>
        <url>http://repository.springsource.com/maven/bundles/milestone</url>
    </repository>
    <repository>
        <id>org.springframework.maven.milestone</id>
        <name>Maven Central Compatible Spring Milestone Repository</name>
        <url>http://maven.springframework.org/milestone</url>
    </repository>
    <repository>
        <id>com.springsource.repository.bundles.release</id>
        <name>EBR Spring Release Repository</name>
        <url>http://repository.springsource.com/maven/bundles/release</url>
    </repository>
    <repository>
        <id>com.springsource.repository.bundles.external</id>
        <name>EBR External Release Repository</name>
        <url>http://repository.springsource.com/maven/bundles/external</url>
    </repository>
</repositories>
</project>

and when calling mvn -U install (forces update check) it gives

[ERROR] Failed to execute goal on project test: Could not resolve dependencies for project test:test:jar:1.0.1: Could not find artifact org.springframework.security:org.springframework.security.web:jar:3.0.5.RELEASE in com.springsource.repository.bundles.milestone (http://repository.springsource.com/maven/bundles/milestone)
Lars Blumberg
  • 19,326
  • 11
  • 90
  • 127
  • Why are you using all those non-standard repositories? – Donal Fellows Apr 16 '11 at 07:38
  • What is the standard repository so we can get rid off the others? – Lars Blumberg Apr 20 '11 at 06:11
  • @Lars: Sean's answer has a link to it. – Donal Fellows Apr 20 '11 at 07:48
  • @Donal: I cannot extract the repository URL as it contains also the version number. Shall I just take `http://repo2.maven.org/maven2/` as the repository for all spring modules? – Lars Blumberg Apr 20 '11 at 08:33
  • @Lars: Yes. Unless you've got a **very** unusual local configuration, you'll have the right repository by default too. This means you can (probably) just remove that `` section. – Donal Fellows Apr 20 '11 at 09:05
  • @Donal: Thank you, I will try that repository. I was also wondering why we've got so many Spring repositories, I assume it dates back to the research work my colleagues have done. – Lars Blumberg Apr 20 '11 at 10:38
  • @Lars: The rule of thumb I use is this: only put a repository in explicitly if you have to (e.g., because the code isn't in Central — irritatingly still the case for some things I use — or because it's your project's snapshot repo). I also try to avoid using snapshots if possible; too likely to have random temporary problems. – Donal Fellows Apr 21 '11 at 08:33

3 Answers3

8

I see that the repository is properly populated, so the problem is a wrong artifactId. It's spring-security-web, not org.springframework.security.web.

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215
  • So there's a wrong example out in http://static.springsource.org/spring-security/site/petclinic-tutorial.html that I was following. Thanks for pointing that out Donal! Interestingly `org.springframework.security.web` works well with version 3.0.3.RELEASE. – Lars Blumberg Apr 16 '11 at 07:39
  • @Lars: You have to *really* watch it with the Spring documentation; it's full of these sorts of subtle errors. (Well, maybe not “full” but I've certainly hit a few in the past, enough that I don't trust it any more…) – Donal Fellows Apr 16 '11 at 07:45
  • The next thing is that the petclinic example is not working anymore. See my comment down at Sean's answer. Spring has gone, it's going to be summer now... – Lars Blumberg Apr 16 '11 at 07:48
3

You are using the wrong artifactId. Use this:

<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-web</artifactId>
    <version>3.0.5.RELEASE</version>
</dependency>

And you don't need any custom repositories, you can find it in Maven Central.

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
0

http://static.springsource.org/spring-security/site/petclinic-tutorial.html gives a wrong artificact Id where I copied the dependency from. Interestingly it works with version 3.0.3.RELEASE but not with 3.0.5.RELEASE.

Thanks for the hint Sean, I updated the answer.

Lars Blumberg
  • 19,326
  • 11
  • 90
  • 127
  • Thanks Sean, I updated my answer. The petclinic example doesn't work at all. Despite its wrong artifact Id for spring security someone has changed the trunk to a version that does not process static resources correctly anymore. But that's another topic. – Lars Blumberg Apr 16 '11 at 07:47