Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5252

Cannot build modules in Maven 3

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.0.4
    • None
    • None

    Description

      I'm not totally sure if this is a bug or a feature, but you cannot build individual modules without first building/installing the parent. Among other things, this makes it difficult to work with groups where some modules are not compiling.

      For example, using the j2ee-simple archetype:

      $ mvn archetype:generate -DgroupId=com.example -DartifactId=example -Dversion=1.0-SNAPSHOT -DpackageName=com.example -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-j2ee-simple

      [INFO] Scanning for projects...
      [INFO] Searching repository for plugin with prefix: 'archetype'.
      [INFO] ------------------------------------------------------------------------
      [INFO] Building Maven Default Project
      [INFO] task-segment: [archetype:generate] (aggregator-style)
      [INFO] ------------------------------------------------------------------------
      [INFO] Preparing archetype:generate
      [INFO] No goals needed for project - skipping
      [INFO] [archetype:generate

      {execution: default-cli}

      ]
      [INFO] Generating project in Interactive mode
      [INFO] Archetype [org.apache.maven.archetypes:maven-archetype-j2ee-simple:1.0] found in catalog remote
      [INFO] Using property: groupId = com.example
      [INFO] Using property: artifactId = example
      [INFO] Using property: version = 1.0-SNAPSHOT
      [INFO] Using property: package = com.example
      Confirm properties configuration:
      groupId: com.example
      artifactId: example
      version: 1.0-SNAPSHOT
      package: com.example
      Y:
      [INFO] ----------------------------------------------------------------------------
      [INFO] Using following parameters for creating project from Old (1.x) Archetype: maven-archetype-j2ee-simple:1.0
      [INFO] ----------------------------------------------------------------------------
      [INFO] Parameter: groupId, Value: com.example
      [INFO] Parameter: packageName, Value: com.example
      [INFO] Parameter: package, Value: com.example
      [INFO] Parameter: artifactId, Value: example
      [INFO] Parameter: basedir, Value: /local/home/jfolson/develop
      [INFO] Parameter: version, Value: 1.0-SNAPSHOT
      [INFO] project created from Old (1.x) Archetype in dir: /local/home/jfolson/develop/example
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 6 seconds
      [INFO] Finished at: Wed Feb 22 09:10:19 EST 2012
      [INFO] Final Memory: 27M/171M
      [INFO] ------------------------------------------------------------------------

      $ cd example/
      ear/ ejbs/ primary-source/ projects/ servlets/ src/

      $ cd example/projects/
      $ mvn3 install

      [INFO] Scanning for projects...
      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Build Order:
      [INFO]
      [INFO] sub projects
      [INFO] logging
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Building sub projects 1.0
      [INFO] ------------------------------------------------------------------------
      [INFO]
      [INFO] — maven-install-plugin:2.3.1:install (default-install) @ projects —
      [INFO] Installing /local/home/jfolson/develop/example/projects/pom.xml to /home/jfolson/.m2/repository/root/project/projects/1.0/projects-1.0.pom
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Building logging 1.0
      [INFO] ------------------------------------------------------------------------
      [INFO]
      [INFO] — maven-resources-plugin:2.4.3:resources (default-resources) @ logging —
      [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
      [INFO] skip non existing resourceDirectory /local/home/jfolson/develop/example/projects/logging/src/main/resources
      [INFO]
      [INFO] — maven-compiler-plugin:2.3.2:compile (default-compile) @ logging —
      [INFO] No sources to compile
      [INFO]
      [INFO] — maven-resources-plugin:2.4.3:testResources (default-testResources) @ logging —
      [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
      [INFO] skip non existing resourceDirectory /local/home/jfolson/develop/example/projects/logging/src/test/resources
      [INFO]
      [INFO] — maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ logging —
      [INFO] No sources to compile
      [INFO]
      [INFO] — maven-surefire-plugin:2.7.2:test (default-test) @ logging —
      [INFO] No tests to run.
      [INFO] Surefire report directory: /local/home/jfolson/develop/example/projects/logging/target/surefire-reports

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      There are no tests to run.

      Results :

      Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

      [INFO]
      [INFO] — maven-jar-plugin:2.3.1:jar (default-jar) @ logging —
      [WARNING] JAR will be empty - no content was marked for inclusion!
      [INFO] Building jar: /local/home/jfolson/develop/example/projects/logging/target/logging-1.0.jar
      [INFO]
      [INFO] — maven-install-plugin:2.3.1:install (default-install) @ logging —
      [INFO] Installing /local/home/jfolson/develop/example/projects/logging/target/logging-1.0.jar to /home/jfolson/.m2/repository/root/project/projects/logging/1.0/logging-1.0.jar
      [INFO] Installing /local/home/jfolson/develop/example/projects/logging/pom.xml to /home/jfolson/.m2/repository/root/project/projects/logging/1.0/logging-1.0.pom
      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Summary:
      [INFO]
      [INFO] sub projects ...................................... SUCCESS [0.853s]
      [INFO] logging ........................................... SUCCESS [2.478s]
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 3.595s
      [INFO] Finished at: Wed Feb 22 09:10:45 EST 2012
      [INFO] Final Memory: 8M/105M
      [INFO] ------------------------------------------------------------------------

      $ cd ../primary-source/
      $ mvn3 install

      [INFO] Scanning for projects...
      [WARNING]
      [WARNING] Some problems were encountered while building the effective model for root.project:primary-source:jar:1.0
      [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ line 26, column 18
      [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 20, column 18
      [WARNING]
      [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
      [WARNING]
      [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
      [WARNING]
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Building core project classes 1.0
      [INFO] ------------------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 1.075s
      [INFO] Finished at: Wed Feb 22 09:11:02 EST 2012
      [INFO] Final Memory: 8M/105M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal on project primary-source: Could not resolve dependencies for project root.project:primary-source:jar:1.0: Failed to collect dependencies for [root.project.projects:logging:jar:1.0 (compile)]: Failed to read artifact descriptor for root.project.projects:logging:jar:1.0: Failure to find root:project:pom:1.0 in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
      [ERROR]
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR]
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

      On the other hand, this works fine (once you remove the missing site module):

      cd example
      mvn3 install

      Attachments

        Activity

          People

            Unassigned Unassigned
            inspired2apathy Jamie Olson
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: