yegor256 / qulice

Quality Police for Java projects: aggregator of Checkstyle and PMD
https://www.qulice.com
Other
299 stars 111 forks source link

Log4j errors in logs when 'qulice:instrument' goal is invoked #511

Open mkordas opened 8 years ago

mkordas commented 8 years ago

Whenever command mvn clean test-compile qulice:instrument is executed, the execution logs contain log4j:ERROR entries:

[...]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ any ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/mkordas/IdeaProjects/qulice-experiment/target/test-classes
[INFO] 
[INFO] --- qulice-maven-plugin:0.14:instrument (default-cli) @ any ---
[INFO] Calling org.codehaus.mojo:cobertura-maven-plugin:2.5.1:instrument...
log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [ClassRealm[plugin>org.codehaus.mojo:cobertura-maven-plugin:2.5.1, parent: ClassRealm[plugin>com.qulice:qulice-maven-plugin:0.14, parent: sun.misc.Launcher$AppClassLoader@70dea4e]]] whereas object of type 
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [ClassRealm[plugin>com.qulice:qulice-maven-plugin:0.14, parent: sun.misc.Launcher$AppClassLoader@70dea4e]].
log4j:ERROR Could not instantiate appender named "console".
[INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Instrumenting 1 file to /home/mkordas/IdeaProjects/qulice-experiment/target/generated-classes/cobertura
Cobertura: Saved information on 1 classes.
Instrument time: 92ms

[INFO] Instrumentation was successful.
[INFO] NOT adding cobertura ser file to attached artifacts list.
[INFO] Qulice quality check completed in 1s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

Logs should be clear from such errors.

To easily reproduce the problem you can use simple Maven project (mvn archetype:generate) and configure Qulice as described on www.qulice.com

krzyk commented 8 years ago

@mkordas When calling just instrumentation is a valid scenario?

mkordas commented 8 years ago

@krzyk usually instrumentation, test execution and coverage checks/report generation are driven by standard Maven lifecycle, but cobertura:instrument goal can be used whenever test execution is manual or not not directly driven by typical lifecycle.

krzyk commented 8 years ago

@davvd valid bug

davvd commented 8 years ago

@davvd valid bug

@krzyk added "bug" tag to this issue

krzyk commented 8 years ago

@davvd this is postponed

davvd commented 8 years ago

@davvd this is postponed

@krzyk OK, I put "postponed" label here

davvd commented 8 years ago

@davvd this is postponed

@krzyk someone else will help in this task, no problem at all

davvd commented 8 years ago

@mkordas thanks for reporting! I topped your account for 15 mins, transaction 567932426bfea6278f00025b