[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sonar-user
Subject:    Re: [sonar-user] Task attribute key / version not found, why?
From:       Johannes_Müller <johannes.mueller433 () gmail ! com>
Date:       2012-10-29 11:10:51
Message-ID: CAL2npvuvvLCavxruQTKb6fGzrYCWEKx-o75kH4L9nbqUw5aXJQ () mail ! gmail ! com
[Download RAW message or body]

Hi David,

thanks for your answer. I did some research and found out that the
basedir value causes the problem. Maybe i should give some more
info's.

I got multiple buildfiles in multiple instances. For example:

> ---Main Project tests
         |----Testcases other
                |----Test case 1
                          |----Test case 1 build.xml
                |----Test case 2
                          |----Test case 2 build.xml
         |----Test 1
                |----Test 1 build.xml (makes some stuff with an other basedir)
         |----Test 2
                |----Test 1 build.xml (makes some stuff with an other basedir)
         |----Test 3
                |----Test 1 build.xml (makes some stuff with an other basedir)
         |----Test 4
                |----Test 1 build.xml (makes some stuff with an other basedir)

   |----"main" build.xml (makes some stuff like tests and sonar,
basedir is set here)

--> this leads to my jenkins build for example i want to build Test 1
the structure in Jenkins look like:


> ---Jenkins Project
         |----build
         |----plugins (variable depends on testcase also variable
structure of dir. sometimes it is: Jenkins Project/tier1/plugins)
         |----checkout
                |----plugins
                       |----main
                       |----tier1
                       |----V5.2
         |----Tests
                |----Test Jenkins project 1
                       |----build.xml (makes some stuff with an other
basedir sonar for project 1 is set here)

                |----"main" build.xml (makes some stuff like tests and
sonar main project, basedir is set here)

Test Jenkins project 1 build.xml is called first with the parameter to
test Jenkins project 1 but also implements the main build.xml
In some cases the main build.xml is called first

Test Jenkins project 1: <project name="Test Jenkins project 1"
default="build" baseDir="value to plugin dir Jenkins project 1"
xmlns:sonar="antlib:org.sonar.ant" >

Main: <project name="Main" default="test.build" baseDir="value to
plugin dir main project" xmlns:sonar="antlib:org.sonar.ant" >


As i integrated one main project it just worked fine because the
baseDir value points to the right dir. But as i tried the other dir's
it just explode everything. The basedir value is also my multi modul
dir in which all plugins get copied for compiling (this is mandatory)
and from this dir i also generate the plugin list for the multi modul
project.

Ive tested much basedir cases but nothing worked. Every time i can not
set a variable sonar basedir because it is not provided by the
implementation as i saw in the Sonar ProjectDefinition:

public File getBaseDir() {
return baseDir;}


Any suggestions how to solve this problem? My idea is to set a
Sonar.testX.xml (with every basedir set manually) for each project and
call it over a command line property. This is not a good performant
way i guess.

Thanks for your help.

Regards Johannes


2012/10/26 David Racodon <david.racodon@sonarsource.com>:
> Hi Johannes,
> 
> Obviously, there must be a difference between your projects.
> I guess you don't get the following message when you run an analysis on the
> first one, do you?
> 
> > /!\ Sonar Ant Task running in compatibility mode: please
> > refer to the documentation to udpate your scripts to comply with the
> > standards.
> 
> 
> Carefully check the different properties or try to start all over again from
> your first project.
> If you really can't make it working, the only way we can help you is to send
> us both complete projects.
> 
> Thank you
> 
> Regards,
> 
> David RACODON | SonarSource
> Senior Consultant
> http://sonarsource.com
> 
> 
> 
> On 26 October 2012 13:23, Johannes Müller <johannes.mueller433@gmail.com>
> wrote:
> > 
> > Hello list,
> > 
> > 
> > i am facing some new troubles. One project already works fine but now
> > i am trying to set up a second multi modul project. This fails and i
> > don´t know why because the "settings" are the same. Of course key,
> > name, version and absolute dir differ from the previous one. So what i
> > am doing wrong here?
> > 
> > I am using: ANT, sonar-ant-task-2.0, Sonar 3.2, Jenkins
> > 
> > 
> > Thanks and regards
> > 
> > Johannes
> > 
> > <project name="xyz" default="x" basedir="../xxx"
> > xmlns:sonar="antlib:org.sonar.ant">
> > 
> > <!-- some stuff happens before -->
> > 
> > <antcall target="sonar" />
> > 
> > <!-- some stuff happens after-->
> > 
> > <target name="sonar">
> > 
> > <!-- props -->
> > <property name="sonar.jdbc.url" value="mysql.xxx" />
> > <property name="sonar.jdbc.driverClassName"
> > value="xxx.Driver" />
> > <property name="sonar.jdbc.username" value="xxx" />
> > <property name="sonar.jdbc.password" value="xxxx" />
> > 
> > <property name="sonar.projectKey"
> > value="org.xxx.sonar:Client-test-java" />
> > <property name="sonar.projectName" value="Client/Build" />
> > <property name="sonar.projectVersion" value="2.0" />
> > <property name="sonar.host.url" value="http://xxxx" />
> > <property name="sonar.sources" value="src/" />
> > 
> > 
> > 
> > 
> > <taskdef uri="antlib:org.sonar.ant"
> > resource="org/sonar/ant/antlib.xml">
> > <classpath
> > path="${libs}/sonar-ant-task-2.0.jar"/>
> > </taskdef>
> > 
> > <sonar:sonar />
> > 
> > </target>
> > 
> > [sonar:sonar] Apache Ant version 1.8.1 compiled on April 30 2010
> > [sonar:sonar] Sonar Ant Task version: 2.0
> > [sonar:sonar] Loaded from:
> > <http://Jenkins/build/lib/sonar-ant-task-2.0.jar>
> > [sonar:sonar] Sonar work directory:
> > <http://jenkins/buildtemp/plugins/.sonar>
> > [sonar:sonar] Sonar server: http://xxxsonar
> > [sonar:sonar]
> > *****************************************************************************************************************************************
> >  [sonar:sonar] /!\ Sonar Ant Task running in compatibility mode: please
> > refer to the documentation to udpate your scripts to comply with the
> > standards.
> > [sonar:sonar]
> > *****************************************************************************************************************************************
> >  
> > BUILD FAILED
> > <http://Jenkins/build/build.xml>:54: The following error occurred
> > while executing this line:
> > <http://Jenkins/build/build.xml>:312: java.lang.IllegalArgumentException:
> > The following mandatory information is missing:
> > - task attribute 'key'
> > - task attribute 'version'
> > at
> > org.sonar.runner.DeprecatedAntTaskExecutor.checkMandatoryProperties(DeprecatedAntTaskExecutor.java:84)
> >  at
> > org.sonar.runner.DeprecatedAntTaskExecutor.execute(DeprecatedAntTaskExecutor.java:62)
> >  at org.sonar.ant.SonarTask.launchAnalysis(SonarTask.java:86)
> > at org.sonar.ant.SonarTask.execute(SonarTask.java:75)
> > at
> > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
> > at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
> > at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >  at java.lang.reflect.Method.invoke(Method.java:597)
> > at
> > org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
> > at org.apache.tools.ant.Task.perform(Task.java:348)
> > at org.apache.tools.ant.Target.execute(Target.java:390)
> > at org.apache.tools.ant.Target.performTasks(Target.java:411)
> > at
> > org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
> > at
> > org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
> >  at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
> > at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
> > at
> > org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
> > at
> > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
> > at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
> > at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >  at java.lang.reflect.Method.invoke(Method.java:597)
> > at
> > org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
> > at org.apache.tools.ant.Task.perform(Task.java:348)
> > at org.apache.tools.ant.Target.execute(Target.java:390)
> > at org.apache.tools.ant.Target.performTasks(Target.java:411)
> > at
> > org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
> > at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
> > at
> > org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
> >  at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
> > at org.apache.tools.ant.Main.runBuild(Main.java:801)
> > at org.apache.tools.ant.Main.startAnt(Main.java:218)
> > at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
> > at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe from this list, please visit:
> > 
> > http://xircles.codehaus.org/manage_email
> > 
> > 
> 

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic