Skip to content

Conversation

@mfriedenhagen
Copy link
Member

it-check-passes, it-check-fails-no-halt, it-check-fails-halt:

[INFO] Failed to configure plugin parameters for: org.jacoco:jacoco-maven-plugin:0.6.4-SNAPSHOT
Cause: Error loading class 'org.jacoco.maven.Rule'

it-merge-passes-merge:

[INFO] Failed to configure plugin parameters for: org.jacoco:jacoco-maven-plugin:0.6.4-SNAPSHOT
Cause: Class 'java.util.List' cannot be instantiated

@ghost ghost assigned Godin Sep 15, 2013
@muminc
Copy link
Contributor

muminc commented Nov 18, 2013

Googling plugin configuration, I came across this..

http://maven.apache.org/guides/mini/guide-configuring-plugins.html#Mapping_Complex_Objects

could this explain the issue with maven 2.2.1 ?

This post explains maven plugin configuration was enhanced in maven 3

http://blog.sonatype.com/people/2011/03/configuring-plugin-goals-in-maven-3/#.UomBaRvLO2k

hence why test work with maven 3 ?

@marchof
Copy link
Member

marchof commented Nov 18, 2013

@muminc Thanks for the links! You're right, probably one has at least to specify the implementation classes. We need to try this as a workaround.

@Godin
Copy link
Member Author

Godin commented Nov 18, 2013

@muminc You are right and this means that at some moment we lost compatibility with Maven 2.

@marchof
Copy link
Member

marchof commented Nov 18, 2013

@Godin some moment == when I introduced the new check configuration :-(

I wasn't aware of the fact that Maven 2 has different configuration capabilities. Maybe this can be fixed with the implementation attribute as described in @muminc 's link.

@mfriedenhagen
Copy link
Member

@marchof: maybe we should include a build with Maven 2.2.1 on travis?

@marchof
Copy link
Member

marchof commented Nov 18, 2013

@mfriedenhagen I don't think this will help as Travis does not execute tests. We probably need to setup another build at Cloudbees. But before we should probably fix the integration tests for the check goals (if this is possible).

…he complex type.

Does not really help because the version of plexus-container-default used by Maven 2.2.1
does not contain an EnumConverter.
@mfriedenhagen
Copy link
Member

Adding implementation for rule is no problem however there is no EnumConverter, so we now get:

[INFO] Failed to configure plugin parameters for: org.jacoco:jacoco-maven-plugin:0.6.4-SNAPSHOT

    (found static expression: 'CLASS' which may act as a default value).


Cause: Cannot assign configuration entry 'element' to 'class org.jacoco.core.analysis.ICoverageNode$ElementType' from 'CLASS', which is of type class java.lang.String
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error configuring: org.jacoco:jacoco-maven-plugin. Reason: Unable to parse the created DOM for plugin configuration
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:723)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.PluginConfigurationException: Error configuring: org.jacoco:jacoco-maven-plugin. Reason: Unable to parse the created DOM for plugin configuratio
n
        at org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1363)
        at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:724)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:468)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 17 more
Caused by: org.codehaus.plexus.component.configurator.ComponentConfigurationException: Cannot assign configuration entry 'element' to 'class org.jacoco.core.analysis.ICoverageNode
$ElementType' from 'CLASS', which is of type class java.lang.String
        at org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.fromExpression(AbstractConfigurationConverter.java:149)
        at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:80)
        at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:207)
        at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)
        at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:90)
        at org.codehaus.plexus.component.configurator.converters.composite.CollectionConverter.fromConfiguration(CollectionConverter.java:177)
        at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:247)

@mfriedenhagen
Copy link
Member

I tried to add setElement methods which expect a String parameter and invoked ElementType.valueOf(element) manually, but the error still remains.

@buildhive
Copy link

Java Code Coverage Tools » jacoco #189 SUCCESS
This pull request looks good
(what's this?)

@marchof
Copy link
Member

marchof commented Nov 28, 2013

If I remember correctly Maven can not handle overloaded methods. Have you tried to replace the setElement() method with the string version (instead of adding another one)?

@mfriedenhagen
Copy link
Member

@marchof: I temporarily switched
element to be a string but this is a bigger effort as you have to adapt and
fix unit tests as well, so I decided to ask on the Maven Developer list
before spending more time in this direction.

* Use String parameters and Enum.valueOf methods because old versions of
  plexus-container-default used in Maven-2 do not include a EnumConverter.
* Add implementation hints in POMs because Maven-2 is unable to guess
  implementing classes correctly.
  See http://blog.sonatype.com/people/2011/03/configuring-plugin-goals-in-maven-3/#.UpkF45FIhsp)
* Use concrete type ArrayList instead of List in MergeMojo because Maven-2 is not
  able to deduce a corresponding class for an interface.
* This is needed when you want to compile Jacoco with Maven 2.2.1
  because the default maven-compiler-plugin version here assumes
  JDK1.3 as default.
* With Maven 3 the default JDK is 1.5 so buildhive did not detect
  this.
@mfriedenhagen
Copy link
Member

Hello there,

with the latest commits all ITs are running fine, I guess you could use the SNAPSHOT for coverage with Maven 2.2.1 again. Only thing outstanding (which is not traced by Travis or BuildHive) is the documentation module which fails with Maven 2.2.1:


[INFO] [xml:validate {execution: default-validate}]
[INFO] [antrun:run {execution: prepare-reports}]
[INFO] Executing tasks

main:
  [typedef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.
     [echo] Coverage report
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An Ant BuildException has occured: Problem: failed to create task or type report
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

@buildhive
Copy link

Java Code Coverage Tools » jacoco #191 SUCCESS
This pull request looks good
(what's this?)

@marchof
Copy link
Member

marchof commented Nov 29, 2013

@Godin The report generation with Ant seems to be broken with Maven 2. This is something that used to work before, right?

@marchof
Copy link
Member

marchof commented Nov 29, 2013

@mfriedenhagen Regarding check goal and merge goal this looks good to me.

@marchof
Copy link
Member

marchof commented Nov 29, 2013

@Godin Is it possible to setup another build on cloudbees which runs on Maven 2? Just to make sure we don't get such regressions again.

@mfriedenhagen
Copy link
Member

Strange thing here:

  • org.jacoco.doc only fails during the multi-module build (mvn clean
    install)
  • Running "mvn -pl org.jacoco.doc clean install" standalone succeeds.
    Anyway, this would be a different issue. Users should be able to take the
    SNAPSHOT, we only are not able to build all of jacoco with Maven 2. I merge
    this PR and open a new issue which has much less priority IMO.

mfriedenhagen added a commit that referenced this pull request Nov 30, 2013
Test failures on jacoco-maven-plugin with Maven 2.2.1. The SNAPSHOT produced by the Maven-3 build might be used with Maven 2.2.1 as well. However the complete build of the jacoco project now has another problem with Maven 2, see #164
@mfriedenhagen mfriedenhagen merged commit f4e3ea3 into master Nov 30, 2013
@mfriedenhagen mfriedenhagen deleted the issue-129 branch November 30, 2013 06:56
mfriedenhagen added a commit that referenced this pull request Nov 30, 2013
@ghost ghost assigned mfriedenhagen Dec 10, 2013
@jacoco jacoco locked and limited conversation to collaborators Jan 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

component: build component: maven jacoco-maven-plugin type: bug 🐛 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants