« Return to Thread: erro with Maven plugin MOJO

Re: erro with Maven plugin MOJO

by Franck Bassy :: Rate this Message:

Reply to Author | View in Thread

Hi,

it work when i use mvn sonar:sonar -Dtest=RetrieveFile.java

i need to specify my Junit test...

thanks


Freddy Mallet wrote:
Hi Franck,
Once your junit test will be executed when "mvn test" is launched, Sonar
will work :-)

Freddy

On Tue, Jun 30, 2009 at 9:24 AM, Franck Bassy
<franck.bassy@atosorigin.com>wrote:

>
> Hi!
>
> but i'v one Junit Test in a folder /src/test/java/ ...
>
> when i try mvn test i'v this :
>
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building checkstyle_retriever Maven Mojo
> [INFO]    task-segment: [test]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [plugin:descriptor]
> [INFO] Using 2 extractors.
> [INFO] Applying extractor for language: java
> [INFO] Extractor for language: java found 1 mojo descriptors.
> [INFO] Applying extractor for language: bsh
> [INFO] Extractor for language: bsh found 0 mojo descriptors.
> [INFO] [resources:resources]
> [WARNING] Using platform encoding (Cp1252 actually) to copy filtered
> resources, i.e. build is platform dependent!
> [INFO] skip non existing resourceDirectory
> D:\projets\checkstyle_retriever\src\main\resources
> [INFO] [compiler:compile]
> [INFO] Nothing to compile - all classes are up to date
> [INFO] [resources:testResources]
> [WARNING] Using platform encoding (Cp1252 actually) to copy filtered
> resources, i.e. build is platform dependent!
> [INFO] skip non existing resourceDirectory
> D:\projets\checkstyle_retriever\src\test\resources
> [INFO] [compiler:testCompile]
> [INFO] Nothing to compile - all classes are up to date
> [INFO] [surefire:test]
> [INFO] Surefire report directory:
> D:\projets\checkstyle_retriever\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] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 11 seconds
> [INFO] Finished at: Tue Jun 30 09:21:20 CEST 2009
> [INFO] Final Memory: 10M/19M
> [INFO]
> ------------------------------------------------------------------------
>
> Maybe it found "Extractor for language: java found 1 mojo descriptors." ??
>
>
> Freddy Mallet wrote:
> >
> > Hello Franck,
> >
> > According to the log, unit tests are not executed by the corbertura
> plugin
> > :
> >
> > [INFO] [surefire:test]
> > [INFO] Surefire report directory:
> > D:\projets\checkstyle_retriever\target\surefire-reports
> >
> > -------------------------------------------------------
> >  T E S T S
> > -------------------------------------------------------
> > There are no tests to run.
> >
> > Results :
> >
> > Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> >
> > What do you get when you launch "mvn test" ?
> > Thanks
> > Freddy
> >
> > On Mon, Jun 29, 2009 at 9:36 AM, Franck Bassy
> > <franck.bassy@atosorigin.com>wrote:
> >
> >>
> >> i'v no specific configuration :
> >>
> >> mvn cobertura:cobertura give me :
> >>
> >> [INFO] Scanning for projects...
> >> [INFO] Searching repository for plugin with prefix: 'cobertura'.
> >> [INFO]
> >> ------------------------------------------------------------------------
> >> [INFO] Building checkstyle_retriever Maven Mojo
> >> [INFO]    task-segment: [cobertura:cobertura]
> >> [INFO]
> >> ------------------------------------------------------------------------
> >> [INFO] Preparing cobertura:cobertura
> >> [INFO] [plugin:descriptor]
> >> [INFO] Using 2 extractors.
> >> [INFO] Applying extractor for language: java
> >> [INFO] Extractor for language: java found 1 mojo descriptors.
> >> [INFO] Applying extractor for language: bsh
> >> [INFO] Extractor for language: bsh found 0 mojo descriptors.
> >> [INFO] [resources:resources]
> >> [WARNING] Using platform encoding (Cp1252 actually) to copy filtered
> >> resources, i.e. build is platform dependent!
> >> [INFO] skip non existing resourceDirectory
> >> D:\projets\checkstyle_retriever\src\main\resources
> >> [INFO] [compiler:compile]
> >> [INFO] Nothing to compile - all classes are up to date
> >> [INFO] [cobertura:instrument]
> >> [INFO] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See COPYRIGHT
> file
> >> Cobertura: Loaded information on 4 classes.
> >> Instrumenting 4 files to
> >> D:\projets\checkstyle_retriever\target\generated-classes\cobertura
> >> Cobertura: Saved information on 4 classes.
> >> Instrument time: 328ms
> >>
> >> [INFO] Instrumentation was successful.
> >> [INFO] [resources:testResources]
> >> [WARNING] Using platform encoding (Cp1252 actually) to copy filtered
> >> resources, i.e. build is platform dependent!
> >> [INFO] skip non existing resourceDirectory
> >> D:\projets\checkstyle_retriever\src\test\resources
> >> [INFO] [compiler:testCompile]
> >> [INFO] Nothing to compile - all classes are up to date
> >> [INFO] [surefire:test]
> >> [INFO] Surefire report directory:
> >> D:\projets\checkstyle_retriever\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] [cobertura:cobertura]
> >> [INFO] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See COPYRIGHT
> file
> >> Cobertura: Loaded information on 4 classes.
> >> [cobertura] INFO  [main]
> >> net.sourceforge.cobertura.reporting.ComplexityCalculator - Cannot find
> >> source file during CCN computation, source=[com/trem/ch
> >> eckstyle_retriever/GreetingMojo.java]
> >> [cobertura] INFO  [main]
> >> net.sourceforge.cobertura.reporting.ComplexityCalculator - Cannot find
> >> source file during CCN computation, source=[com/trem/ch
> >> eckstyle_retriever/RetrieveFile.java]
> >> Report time: 406ms
> >>
> >> [INFO] Cobertura Report generation was successful.
> >> [INFO]
> >> ------------------------------------------------------------------------
> >> [INFO] BUILD SUCCESSFUL
> >> [INFO]
> >> ------------------------------------------------------------------------
> >> [INFO] Total time: 13 seconds
> >> [INFO] Finished at: Mon Jun 29 09:34:03 CEST 2009
> >> [INFO] Final Memory: 12M/21M
> >> [INFO]
> >> ------------------------------------------------------------------------
> >>
> >>
> >>
> >> Freddy Mallet wrote:
> >> >
> >> > Hi Franck,
> >> > Could you try to directly launch the command "mvn cobertura:cobertura"
> >> ?
> >> I
> >> > guess you'll encounter the same issue as the cobertura plugin doesn't
> >> seem
> >> > to be able to retrieve the unit tests. Do you have any special
> >> > configuration
> >> > in your pom.xml file which can impact unit tests execution ?
> >> >
> >> > Cheers
> >> > Freddy
> >> >
> >> > On Fri, Jun 26, 2009 at 4:46 PM, Franck Bassy
> >> > <franck.bassy@atosorigin.com>wrote:
> >> >
> >> >>
> >> >> Hi,
> >> >>
> >> >> i try to execute mvn sonar:sonar on a new maven plugin MOJO and i
> >> don't
> >> >> understand i'v no code coverage and he didn't find my units tests :x
> >> >>
> >> >> I need to specify some information in my pom ?
> >> >>
> >> >> thank for your answer
> >> >>
> >> >> there the stacktrace :
> >> >>
> >> >> [INFO] Scanning for projects...
> >> >> [INFO] Searching repository for plugin with prefix: 'sonar'.
> >> >> [INFO]
> >> >>
> >> ------------------------------------------------------------------------
> >> >> [INFO] Building checkstyle_retriever Maven Mojo
> >> >> [INFO]    task-segment: [sonar:sonar] (aggregator-style)
> >> >> [INFO]
> >> >>
> >> ------------------------------------------------------------------------
> >> >> [INFO] [sonar:sonar]
> >> >> [INFO] Sonar host: http://w30414:9000
> >> >> [INFO] Sonar version: 1.9.2
> >> >> [INFO] [sonar-core:internal]
> >> >> [INFO] Sonar JDBC URL:
> >> >> jdbc:mysql://w30414:3306/sonar?useUnicode=true&characterEncoding=utf8
> >> >> [INFO] Sonar JDBC login: root
> >> >> [INFO] Sonar JDBC driver: com.mysql.jdbc.Driver
> >> >> [INFO] Sonar branch:
> >> >> [INFO] checkstyle_retriever Maven Mojo Getting Plugin Extensions...
> >> >> [INFO] checkstyle_retriever Maven Mojo Selected quality profile :
> >> Sonar
> >> >> Test, language=java
> >> >> [INFO] checkstyle_retriever Maven Mojo Executing
> >> >> org.apache.maven.plugins:maven-pmd-plugin:[pmd]
> >> >> [INFO]
> >> >>
> >> ------------------------------------------------------------------------
> >> >> [INFO] Building checkstyle_retriever Maven Mojo
> >> >> [INFO]    task-segment:
> >> [org.apache.maven.plugins:maven-pmd-plugin::pmd]
> >> >> [INFO]
> >> >>
> >> ------------------------------------------------------------------------
> >> >> [INFO] [pmd:pmd]
> >> >> [WARNING] File encoding has not been set, using platform encoding
> >> Cp1252,
> >> >> i.e. build is platform dependent!
> >> >> [WARNING] Error while parsing
> >> >>
> >> >>
> >>
> D:\projets\checkstyle_retriever\src\main\java\com\trem\checkstyle_retriever\RetrieveCheckstyleMojo.java:
> >> >> Can't use annota
> >> >> tions when running in JDK 1.4 mode!
> >> >> [INFO] checkstyle_retriever Maven Mojo Executing
> >> >> org.apache.maven.plugins:maven-checkstyle-plugin:[checkstyle]
> >> >> [INFO]
> >> >>
> >> ------------------------------------------------------------------------
> >> >> [INFO] Building checkstyle_retriever Maven Mojo
> >> >> [INFO]    task-segment:
> >> >> [org.apache.maven.plugins:maven-checkstyle-plugin::checkstyle]
> >> >> [INFO]
> >> >>
> >> ------------------------------------------------------------------------
> >> >> [INFO] Setting property: classpath.resource.loader.class =>
> >> >> 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
> >> >> [INFO] Setting property: velocimacro.messages.on => 'false'.
> >> >> [INFO] Setting property: resource.loader => 'classpath'.
> >> >> [INFO] Setting property: resource.manager.logwhenfound => 'false'.
> >> >> [INFO] **************************************************************
> >> >> [INFO] Starting Jakarta Velocity v1.4
> >> >> [INFO] RuntimeInstance initializing.
> >> >> [INFO] Default Properties File:
> >> >> org\apache\velocity\runtime\defaults\velocity.properties
> >> >> [INFO] Default ResourceManager initializing. (class
> >> >> org.apache.velocity.runtime.resource.ResourceManagerImpl)
> >> >> [INFO] Resource Loader Instantiated:
> >> >> org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
> >> >> [INFO] ClasspathResourceLoader : initialization starting.
> >> >> [INFO] ClasspathResourceLoader : initialization complete.
> >> >> [INFO] ResourceCache : initialized. (class
> >> >> org.apache.velocity.runtime.resource.ResourceCacheImpl)
> >> >> [INFO] Default ResourceManager initialization complete.
> >> >> [INFO] Loaded System Directive:
> >> >> org.apache.velocity.runtime.directive.Literal
> >> >> [INFO] Loaded System Directive:
> >> >> org.apache.velocity.runtime.directive.Macro
> >> >> [INFO] Loaded System Directive:
> >> >> org.apache.velocity.runtime.directive.Parse
> >> >> [INFO] Loaded System Directive:
> >> >> org.apache.velocity.runtime.directive.Include
> >> >> [INFO] Loaded System Directive:
> >> >> org.apache.velocity.runtime.directive.Foreach
> >> >> [INFO] Created: 20 parsers.
> >> >> [INFO] Velocimacro : initialization starting.
> >> >> [INFO] Velocimacro : adding VMs from VM library template :
> >> >> VM_global_library.vm
> >> >> [ERROR] ResourceManager : unable to find resource
> >> 'VM_global_library.vm'
> >> >> in
> >> >> any resource loader.
> >> >> [INFO] Velocimacro : error using  VM library template
> >> >> VM_global_library.vm
> >> >> :
> >> >> org.apache.velocity.exception.ResourceNotFoundException: Unable to
> >> find
> >> r
> >> >> esource 'VM_global_library.vm'
> >> >> [INFO] Velocimacro :  VM library template macro registration
> complete.
> >> >> [INFO] Velocimacro : allowInline = true : VMs can be defined inline
> in
> >> >> templates
> >> >> [INFO] Velocimacro : allowInlineToOverride = false : VMs defined
> >> inline
> >> >> may
> >> >> NOT replace previous VM definitions
> >> >> [INFO] Velocimacro : allowInlineLocal = false : VMs defined inline
> >> will
> >> >> be
> >> >> global in scope if allowed.
> >> >> [INFO] Velocimacro : initialization complete.
> >> >> [INFO] Velocity successfully started.
> >> >> [INFO] [checkstyle:checkstyle]
> >> >> [WARNING] File encoding has not been set, using platform encoding
> >> Cp1252,
> >> >> i.e. build is platform dependent!
> >> >> [INFO] checkstyle_retriever Maven Mojo Executing
> >> >> org.codehaus.mojo:taglist-maven-plugin:[taglist]
> >> >> [INFO]
> >> >>
> >> ------------------------------------------------------------------------
> >> >> [INFO] Building checkstyle_retriever Maven Mojo
> >> >> [INFO]    task-segment:
> >> [org.codehaus.mojo:taglist-maven-plugin::taglist]
> >> >> [INFO]
> >> >>
> >> ------------------------------------------------------------------------
> >> >> [INFO] [taglist:taglist]
> >> >> [INFO] checkstyle_retriever Maven Mojo Executing
> >> >> org.codehaus.mojo:cobertura-maven-plugin:[cobertura]
> >> >> [INFO]
> >> >>
> >> ------------------------------------------------------------------------
> >> >> [INFO] Building checkstyle_retriever Maven Mojo
> >> >> [INFO]    task-segment:
> >> >> [org.codehaus.mojo:cobertura-maven-plugin::cobertura]
> >> >> [INFO]
> >> >>
> >> ------------------------------------------------------------------------
> >> >> [INFO] Preparing cobertura:cobertura
> >> >> [INFO] [plugin:descriptor]
> >> >> [INFO] Using 2 extractors.
> >> >> [INFO] Applying extractor for language: java
> >> >> [INFO] Extractor for language: java found 1 mojo descriptors.
> >> >> [INFO] Applying extractor for language: bsh
> >> >> [INFO] Extractor for language: bsh found 0 mojo descriptors.
> >> >> [INFO] [resources:resources]
> >> >> [WARNING] Using platform encoding (Cp1252 actually) to copy filtered
> >> >> resources, i.e. build is platform dependent!
> >> >> [INFO] skip non existing resourceDirectory
> >> >> D:\projets\checkstyle_retriever\src\main\resources
> >> >> [INFO] [compiler:compile]
> >> >> [INFO] Nothing to compile - all classes are up to date
> >> >> [INFO] [cobertura:instrument]
> >> >> [INFO] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See COPYRIGHT
> >> file
> >> >> Cobertura: Loaded information on 4 classes.
> >> >> Instrumenting 4 files to
> >> >> D:\projets\checkstyle_retriever\target\generated-classes\cobertura
> >> >> Cobertura: Saved information on 4 classes.
> >> >> Instrument time: 281ms
> >> >>
> >> >> [INFO] Instrumentation was successful.
> >> >> [INFO] [resources:testResources]
> >> >> [WARNING] Using platform encoding (Cp1252 actually) to copy filtered
> >> >> resources, i.e. build is platform dependent!
> >> >> [INFO] skip non existing resourceDirectory
> >> >> D:\projets\checkstyle_retriever\src\test\resources
> >> >> [INFO] [compiler:testCompile]
> >> >> [INFO] Nothing to compile - all classes are up to date
> >> >> [INFO] [surefire:test]
> >> >> [INFO] Surefire report directory:
> >> >> D:\projets\checkstyle_retriever\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] [cobertura:cobertura]
> >> >> [INFO] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See COPYRIGHT
> >> file
> >> >> Cobertura: Loaded information on 4 classes.
> >> >> [cobertura] INFO  [main]
> >> >> net.sourceforge.cobertura.reporting.ComplexityCalculator - Cannot
> find
> >> >> source file during CCN computation, source=[com/trem/ch
> >> >> eckstyle_retriever/GreetingMojo.java]
> >> >> [cobertura] INFO  [main]
> >> >> net.sourceforge.cobertura.reporting.ComplexityCalculator - Cannot
> find
> >> >> source file during CCN computation, source=[com/trem/ch
> >> >> eckstyle_retriever/RetrieveFile.java]
> >> >> Report time: 313ms
> >> >>
> >> >> [INFO] Cobertura Report generation was successful.
> >> >> [INFO] checkstyle_retriever Maven Mojo Executing
> >> >> org.apache.maven.plugins:maven-surefire-plugin:[]
> >> >> [INFO] checkstyle_retriever Maven Mojo [class
> >> >> org.sonar.plugins.pmd.PmdMavenCollector] executing
> >> >> [INFO] checkstyle_retriever Maven Mojo [class
> >> >> org.sonar.plugins.isoqa.JDependMavenCollector] executing
> >> >> [INFO] checkstyle_retriever Maven Mojo [class
> >> >> org.sonar.plugins.isoqa.CkjmMavenCollector] executing
> >> >> java.lang.ClassNotFoundException: Exception while looking for class
> >> >> org.apache.maven.plugin.AbstractMojo: java.io.IOException: Couldn't
> >> find:
> >> >> org.apac
> >> >> he.maven.plugin.AbstractMojo.class
> >> >> java.lang.ClassNotFoundException: Exception while looking for class
> >> >> junit.framework.TestCase: java.io.IOException: Couldn't find:
> >> >> junit.framework.Test
> >> >> Case.class
> >> >> [INFO] checkstyle_retriever Maven Mojo [class
> >> >> org.sonar.plugins.squid.SquidMavenCollector] executing
> >> >> [INFO] checkstyle_retriever Maven Mojo Starting audit...
> >> >> [INFO] checkstyle_retriever Maven Mojo Audit done.
> >> >> [INFO] checkstyle_retriever Maven Mojo [class
> >> >> org.sonar.plugins.core.SaveProfileMavenCollector] executing
> >> >> [INFO] checkstyle_retriever Maven Mojo [class
> >> >> org.sonar.plugins.core.sources.ImportJavaSourcesMavenCollector]
> >> executing
> >> >> [INFO] checkstyle_retriever Maven Mojo [class
> >> >> org.sonar.plugins.core.SaveProjectLinksFromPom] executing
> >> >> [INFO] checkstyle_retriever Maven Mojo [class
> >> >> org.sonar.plugins.checkstyle.CheckstyleMavenCollector] executing
> >> >> [INFO] checkstyle_retriever Maven Mojo [class
> >> >> org.sonar.plugins.cpd.CpdMavenCollector] executing
> >> >> [INFO] checkstyle_retriever Maven Mojo Collecting duplications...
> >> >> [INFO] checkstyle_retriever Maven Mojo File suffixes : java
> >> >> [INFO] checkstyle_retriever Maven Mojo Exclusions : {}
> >> >> [INFO] checkstyle_retriever Maven Mojo [class
> >> >> org.sonar.plugins.taglist.TaglistMavenCollector] executing
> >> >> [INFO] checkstyle_retriever Maven Mojo Parsing
> >> >> D:\projets\checkstyle_retriever\target\taglist\taglist.xml
> >> >> [INFO] checkstyle_retriever Maven Mojo [class
> >> >> org.sonar.plugins.cobertura.CoberturaMavenCollector] executing
> >> >> [INFO] checkstyle_retriever Maven Mojo parsing
> >> >> D:\projets\checkstyle_retriever\target\site\cobertura\coverage.xml
> >> >> [INFO] checkstyle_retriever Maven Mojo [class
> >> >> org.sonar.plugins.surefire.SurefireMavenCollector] executing
> >> >> [INFO] checkstyle_retriever Maven Mojo parsing
> >> >> D:\projets\checkstyle_retriever\target\surefire-reports
> >> >> [INFO]  Trigger server
> >> >> [INFO]
> >> >>
> >> ------------------------------------------------------------------------
> >> >> [INFO] BUILD SUCCESSFUL
> >> >> [INFO]
> >> >>
> >> ------------------------------------------------------------------------
> >> >> [INFO] Total time: 39 seconds
> >> >> [INFO] Finished at: Fri Jun 26 16:40:59 CEST 2009
> >> >> [INFO] Final Memory: 25M/45M
> >> >> [INFO]
> >> >>
> >> ------------------------------------------------------------------------
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://www.nabble.com/erro-with-Maven-plugin-MOJO-tp24221614p24221614.html
> >> >> Sent from the Sonar user mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe from this list, please visit:
> >> >>
> >> >>    http://xircles.codehaus.org/manage_email
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/erro-with-Maven-plugin-MOJO-tp24221614p24249654.html
> >> Sent from the Sonar user mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >>    http://xircles.codehaus.org/manage_email
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/erro-with-Maven-plugin-MOJO-tp24221614p24267332.html
> Sent from the Sonar user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

 « Return to Thread: erro with Maven plugin MOJO