1

I have pom.xml file with a list of dependencies:

    <dependencies>
    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
    </dependency>

My task is to find out answer to the following questions:

  1. Is it the latest version of dependency, or newer already exists?
  2. Is there some conflicts between two dependencies, which is mean that they using the same jar files with a different versions?
  3. Will be nice to know is there any possibility to retrieve quick documentation about the dependency without leaving IntelliJ IDEA 14.x?
Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
Light Harut
  • 159
  • 1
  • 1
  • 8
  • Re 3.: What do you mean by „_quick documentation_“? The library's web site? The JavaDoc? Something else? – Gerold Broser Oct 29 '15 at 10:14
  • Popup should contain JavaDoc information for selected dependency in pom.xml file opened under cursor in Intellij IDEA. If there isn't such keymap, maybe you know Intellij IDEA plugin, which is able to provide same functionality? – Light Harut Oct 29 '15 at 14:27

2 Answers2

1

For number one have a look at the question Maven check for updated dependencies in repository.

For number two: that's harder to tell since maven resolves same dependencies (same groupId, artifactId, classifier, version) on their distance. So if defined in your own pom.xml that will always win. Transitive dependencies win if their distance to your pom is lower than others. I think mvn dependency:tree -Dverbose=true will print that out:

...
[INFO] |        +- (commons-lang:commons-lang:jar:2.6:compile - version managed from 2.5; omitted for duplicate)
[INFO] |        +- (commons-collections:commons-collections:jar:3.0:compile - omitted for duplicate)
....

Number three: what information do you search? In the maven panel if you right click on a module or pom you can show the maven dependencies. In that view you can simply type for searching (its some sort of dependency graph). See JetBrains docs.

Community
  • 1
  • 1
wemu
  • 7,952
  • 4
  • 30
  • 59
1
  1. Is it the latest version of dependency, or newer already exists?

    See the display-dependency-updates goal of the Versions Maven Plugin (as also linked in the answer wemu referred to in his answer, but codehaus.org terminated all its services so the links there do not work properly any more):

    scans a project's dependencies and produces a report of those dependencies which have newer versions available.

  2. Is there some conflicts between two dependencies, which is mean that they using the same jar files with a different versions?

    Use the Dependency Convergence rule of the Maven Enforcer Plugin:

    This rule requires that dependency version numbers converge. If a project has two dependencies, A and B, both depending on the same artifact, C, this rule will fail the build if A depends on a different version of C then than the version of C depended on by B.

    [Typo correction by me.]

  3. Will be nice to know is there any possibility to retrieve quick documentation about the dependency without leaving IntelliJ IDEA 14.x?

    See Maven Dependency Sync:

    When a library is first fetched source and javadoc are automatically fetched. If they were not available from the remote repository you can install them in a local maven repository and then right click the library in the Project View -> Fetch Source and Javadoc.

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107