Maven 1

maven 1.1 beta 2 confuses class loaders while compiling plugin-genererated code

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.1-beta-2
  • Fix Version/s: 1.1-beta-3
  • Component/s: core
  • Labels:
    None
  • Environment:
    java version "1.4.2_09"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-b05)
    Java HotSpot(TM) Client VM (build 1.4.2_09-b05, mixed mode)

    Fedora Core 3 Linux on x86
  • Number of attachments :
    1

Description

This is a bit complicated to describe, so I've prepared an example to provoke this bug.

  • Unpack the attached maventest.tar.gz
  • install the Torque Plugin into your maven by running
    maven -DartifactId=maven-torque-plugin -DgroupId=torque -Dversion=3.1.1 plugin:download

% cd maventest ; maven -q java:compile
build:start:

java:prepare-filesystem:
[mkdir] Created dir: /home/henning/scratch/test/maventest/target/classes

java:compile:
build-om:
torque:init:

BUILD FAILED
File...... /home/henning/.maven/cache/maven-torque-plugin-3.1.1/plugin.jelly
Element... taskdef
Line...... 87
Column.... -1
taskdef A class needed by class org.apache.torque.task.TorqueJDBCTransformTask cannot be found: org/apache/xerces/dom/CoreDocumentImpl

The missing class is inside the xerces jar, which is put on the classpath by the torque plugin (see http://svn.apache.org/viewcvs.cgi/db/torque/maven-plugin/trunk/plugin.jelly?rev=239621&view=markup, the torque:init task defines the classpath exactly as described on http://maven.apache.org/faq.html#classloader-property)

Funnily enough, the "jar:jar" task, which runs java:compile as a prerequisite works:

% cd maventest ; rm -rf target ; maven -q jar:jar
build:start:

java:prepare-filesystem:
[mkdir] Created dir: /home/henning/scratch/test/maventest/target/classes

java:compile:
build-om:
torque:init:

torque:om-check:

torque:om:
torque:init:
Overriding previous definition of reference to torque-classpath

torque:om-generate:
Using contextProperties file: /home/henning/scratch/test/maventest/project.properties
[torque-data-model] Using classpath
[torque-data-model] Generating to file /home/henning/scratch/test/maventest/target/src/report.test.om.generation

Overriding previous definition of reference to maven.compile.src.set
[echo] Compiling to /home/henning/scratch/test/maventest/target/classes
[echo]
==========================================================

NOTE: Targetting JVM 1.4, classes
will not run on earlier JVMs

==========================================================

[javac] Compiling 5 source files to /home/henning/scratch/test/maventest/target/classes
[javac] Note: /home/henning/scratch/test/maventest/target/src/org/test/BaseJobEntryPeer.java uses or overrides a deprecated API.
[javac] Note: Recompile with -deprecation for details.

java:jar-resources:

test:prepare-filesystem:
[mkdir] Created dir: /home/henning/scratch/test/maventest/target/test-classes
[mkdir] Created dir: /home/henning/scratch/test/maventest/target/test-reports

test:test-resources:

test:compile:
[echo] No test source files to compile.

test:test:
[echo] No tests to run.

jar:jar:
[jar] Building jar: /home/henning/scratch/test/maventest/target/test-1.0.jar

% jar tvf target/test-1.0.jar
0 Tue Sep 13 22:28:48 CEST 2005 META-INF/
280 Tue Sep 13 22:28:46 CEST 2005 META-INF/MANIFEST.MF
0 Tue Sep 13 22:28:48 CEST 2005 org/
0 Tue Sep 13 22:28:48 CEST 2005 org/test/
0 Tue Sep 13 22:28:48 CEST 2005 org/test/map/
7625 Tue Sep 13 22:28:48 CEST 2005 org/test/BaseJobEntry.class
12288 Tue Sep 13 22:28:48 CEST 2005 org/test/BaseJobEntryPeer.class
311 Tue Sep 13 22:28:48 CEST 2005 org/test/JobEntry.class
288 Tue Sep 13 22:28:48 CEST 2005 org/test/JobEntryPeer.class
2043 Tue Sep 13 22:28:48 CEST 2005 org/test/map/JobEntryMapBuilder.class

Both tasks, java:compile and jar:jar work fine and as expected using maven-1.0.2

This is a test case for a real world example, trying to compile and build the site for the turbine 2.3.2-rc1 release. The classpath error
occurs when the site build process tries to run jdepend to build the metrics. So the problem doesn't seem to be part of the plugins or
tasks but of the core.

Issue Links

Activity

Hide
Lukas Theussl added a comment -

I cannot reproduce this with current 1.1-beta-3-SNAPSHOT.

Show
Lukas Theussl added a comment - I cannot reproduce this with current 1.1-beta-3-SNAPSHOT.
Hide
Lukas Theussl added a comment -

Can reproduce with 1.1-beta-2 but not with current trunk, so must have been fixed on the way.

Show
Lukas Theussl added a comment - Can reproduce with 1.1-beta-2 but not with current trunk, so must have been fixed on the way.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: