Maven/IDEA

HomePage | Maven | RecentChanges | Preferences

The Maven IDEA plugin does not respect <exclusions>.

$ mvn archetype:create -DgroupId=com.example -DartifactId=myapp
$ cd myapp
$ mvn idea:idea
... 
   (works correctly)

Now add a dependency to pom.xml:

    <dependency>
       <groupId>htmlunit</groupId>
       <artifactId>htmlunit</artifactId>
       <version>1.8</version>
   </dependency>

The build fails due to a missing dependency: javax.xml:jsr173:jar:1.0

So add the exclusion:

        <dependency>
            <groupId>htmlunit</groupId>
            <artifactId>htmlunit</artifactId>
            <version>1.8</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.xml</groupId>
                    <artifactId>jsr173</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

Retry 'mvn install' (works fine) but mvn idea:idea says:

$ mvn idea:idea
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'idea'.
[INFO] -------------------------------------------------------------------------
---
[INFO] Building Maven Quick Start Archetype
[INFO]    task-segment: [idea:idea]
[INFO] -------------------------------------------------------------------------
---
[INFO] Preparing idea:idea
[INFO] No goals needed for project - skipping
[INFO] [idea:idea]
[WARNING]
        Artifact junit:junit:jar:3.8.1:test retains local scope 'test' overridin
g broader scope 'compile'
        given by a dependency. If this is not intended, modify or remove the loc
al scope.

Downloading: http://repo1.maven.org/maven2/javax/xml/jsr173/1.0/jsr173-1.0.jar
[WARNING] Unable to get resource from repository central (http://repo1.maven.org
/maven2)
[WARNING] An error occurred during dependency resolution of the following artifa
ct:

    com.example:myapp1.0-SNAPSHOT

Caused by: Missing:
----------
1) javax.xml:jsr173:jar:1.0

  Try downloading the file manually from:
      http://java.sun.com/webservices/downloads/webservicespack.html

  Then, install it using the command:
      mvn install:install-file -DgroupId=javax.xml -DartifactId=jsr173            -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file

  Path to dependency:
        1) com.example:myapp:jar:1.0-SNAPSHOT
        2) htmlunit:htmlunit:jar:1.8
        3) dom4j:dom4j:jar:1.5
        4) javax.xml:jsr173:jar:1.0

----------
1 required artifact is missing.

for artifact:
  com.example:myapp:jar:1.0-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  Apache Snapshots (http://cvs.apache.org/maven-snapshot-repository/)

[INFO] Adding resource directory: c:\temp\myapp\src\main\resources
[INFO] jdkName is not set, using [java version1.5.0_06] as default.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Tue Mar 28 18:10:40 MST 2006
[INFO] Final Memory: 3M/6M
[INFO] ------------------------------------------------------------------------

The resulting IDEA config files do not include any libraries. (Settings -> Modules -> Libraries (Classpath) has only src/main/resources listed.


This is 'mvn idea:idea' from /svn/maven/plugins. Apparently 'Dependency Maven Plugin' needs a snapshot of Javadoc Plugin, but the snapshot repo isn't configured.

Same deal with the Eclipse Plugin wanting a snapshot of Surefire Plugin.

fix:

   cd maven-javadoc-plugin; mvn install; cd ../
   cd maven-surefire-plugin; mvn install; cd ../
   cd maven-compiler-plugin; mvn install; cd ../

[INFO] Building Maven Javadoc Plugin
[INFO]    task-segment: [idea:idea]
[INFO] -------------------------------------------------------------------------
---
[INFO] Preparing idea:idea
[INFO] [modello:java {execution: default}]
[INFO] outputDirectory: e:\svn\maven\plugins\maven-javadoc-plugin\target\generat
ed-sources\modello
[INFO] [idea:idea]
[INFO] -------------------------------------------------------------------------
---
[INFO] Building Dependency Maven Plugin
[INFO]    task-segment: [idea:idea]
[INFO] -------------------------------------------------------------------------
---
[INFO] Preparing idea:idea
Downloading: http://cvs.apache.org/maven-snapshot-repository/org/apache/maven/pl
ugins/maven-javadoc-plugin/2.1-SNAPSHOT/maven-javadoc-plugin-2.1-SNAPSHOT.jar
[WARNING] Unable to get resource from repository Apache Snapshot Repository (htt
p://cvs.apache.org/maven-snapshot-repository)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] A required plugin was not found: Plugin could not be found - check that t
he goal name is correct: Unable to download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command:
    mvn install:install-file -DgroupId=org.apache.maven.plugins -DartifactId=mav
en-javadoc-plugin          -Dversion=2.1-SNAPSHOT -Dpackaging=maven-plugin -Dfile=/path/to/file


  org.apache.maven.plugins:maven-javadoc-plugin:maven-plugin:2.1-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  Apache Snapshot Repository (http://cvs.apache.org/maven-snapshot-repository)

  org.apache.maven.plugins:maven-javadoc-plugin:maven-plugin:2.1-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  Apache Snapshot Repository (http://cvs.apache.org/maven-snapshot-repository)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Sun Jun 11 10:32:02 MST 2006
[INFO] Final Memory: 12M/23M
[INFO] ------------------------------------------------------------------------

HomePage | Maven | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited June 11, 2006 10:38 am by WendySmoak (diff)
Search: