New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check and merge goal failures in jacoco-maven-plugin with Maven 2.2.1 due to incompatible configuration #129

Merged
merged 5 commits into from Nov 30, 2013

Conversation

Projects
None yet
5 participants
@mfriedenhagen
Member

mfriedenhagen commented Nov 27, 2013

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

This comment has been minimized.

Show comment
Hide comment
@muminc

muminc Nov 18, 2013

Contributor

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 ?

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

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Nov 18, 2013

Member

@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.

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

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin Nov 18, 2013

Member

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

Member

Godin commented Nov 18, 2013

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

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Nov 18, 2013

Member

@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.

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

This comment has been minimized.

Show comment
Hide comment
@mfriedenhagen

mfriedenhagen Nov 18, 2013

Member

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

Member

mfriedenhagen commented Nov 18, 2013

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

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Nov 18, 2013

Member

@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).

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).

Try to add implementation, so Maven 2.2.1 does not choke because of t…
…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

This comment has been minimized.

Show comment
Hide comment
@mfriedenhagen

mfriedenhagen Nov 27, 2013

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)
Member

mfriedenhagen commented Nov 27, 2013

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

This comment has been minimized.

Show comment
Hide comment
@mfriedenhagen

mfriedenhagen Nov 27, 2013

Member

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

Member

mfriedenhagen commented Nov 27, 2013

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

@buildhive

This comment has been minimized.

Show comment
Hide comment
@buildhive

buildhive commented Nov 27, 2013

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

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Nov 28, 2013

Member

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)?

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

This comment has been minimized.

Show comment
Hide comment
@mfriedenhagen

mfriedenhagen Nov 28, 2013

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.

Member

mfriedenhagen commented Nov 28, 2013

@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.

mfriedenhagen added some commits Nov 29, 2013

Workaround for Maven-2 compatibility.
* 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.
Force source and target in examples to at least JDK5.
* 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

This comment has been minimized.

Show comment
Hide comment
@mfriedenhagen

mfriedenhagen Nov 29, 2013

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.
Member

mfriedenhagen commented Nov 29, 2013

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

This comment has been minimized.

Show comment
Hide comment
@buildhive

buildhive commented Nov 29, 2013

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

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Nov 29, 2013

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Nov 29, 2013

Member

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

Member

marchof commented Nov 29, 2013

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

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Nov 29, 2013

Member

@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.

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

This comment has been minimized.

Show comment
Hide comment
@mfriedenhagen

mfriedenhagen Nov 30, 2013

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.
Member

mfriedenhagen commented Nov 30, 2013

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

Merge pull request #129 from jacoco/issue-129
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

1 check passed

default The Travis CI build passed
Details

@mfriedenhagen mfriedenhagen deleted the issue-129 branch Nov 30, 2013

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.