0

I'm having trouble correctly importing a library into a project that I'm running. I have added the library as a dependency in the .pom, refreshed the pom, run mvn clean install, and I have set auto-import up so that the project gets updated correctly, but the project does not get added as an External Library, and I can't use it in my project. I get no errors. What am I doing wrong?

Here is the relevant part of my pom

 ..properties
 <crowd.version>2.5.0</crowd.version>
 .. end properties

<dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.atlassian.crowd</groupId>
        <artifactId>crowd-integration-springsecurity</artifactId>
        <version>${crowd.version}</version>
        <scope>runtime</scope>
      </dependency>
    </dependencies>
</dependencyManagement>

Here is the question I was following to debug my error: Import Maven dependencies in IntelliJ IDEA

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Rafa
  • 3,219
  • 4
  • 38
  • 70
  • nothing, unfortunately – Rafa Feb 20 '17 at 21:02
  • Is this dependency in maven central or any other repo that you refer to in your settings.xml. [mvnrepository.com](http://mvnrepository.com/artifact/com.atlassian.crowd/crowd-integration-springsecurity) shows some crazy dependency version :-). – Kedar Mhaswade Feb 20 '17 at 21:05
  • @CrazyCoder I have tried `compile` and `test` based off your suggestion, but it hasn't worked. – Rafa Feb 20 '17 at 21:06

1 Answers1

2

I think you missed the point of dependency management; read more in official docs. This is a feature that you can centralize common dependency information that is then shared been different projects. All by itself, this definioition will not import the dependency.

What you probably want is just a plain dependency: drop the dependencyManagement tags, and move you dependency into the correct block in the pom.

SiKing
  • 10,003
  • 10
  • 39
  • 90