Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Why eclipse-test-plugin sources are main sources in Maven world?

Sorry if I was not clear in my use case.
What I am trying to achieve is simply to make a Sonar analysis. In old Sonar versions test sources of a regular Maven project were excluded from analysis because it was not possible to have different quality expectations for main code and test code. So a workaround for Tycho eclipse-test-plugin modules was simply to exclude test modules from Sonar analysis (using sonar.skippedModules).

But now Sonar is able to analyze test source code with a specific rule set. The problem is that Sonar Maven plugin uses Maven model to know where are main code and test code. We could ask for a hack in Sonar Maven plugin to make a special case for module with packaging=eclipse-test-plugin but IMHO it seems more natural/logical to ask Tycho to put source roots from build.properties in maven model test source roots. I just wanted to know if there was a reason why it is not already the case (maybe technical limitation).

Regards,

Julien

>________________________________
> De : "Sievers, Jan" <jan.sievers@xxxxxxx>
>À : Julien HENRY <henryju@xxxxxxxx>; Tycho user list <tycho-user@xxxxxxxxxxx> 
>Envoyé le : Jeudi 20 décembre 2012 12h33
>Objet : RE: [tycho-user] Why eclipse-test-plugin sources are main sources in Maven world?
> 
>test source dirs only make sense for classical maven projects where code under test and test code reside in the same module.
>For tycho, this is not the case which is why we add source roots from build.properties to the maven model compile source roots, regardless if it's a test project or not.
>
>If there is a problem with that, you should explain what you are trying to achieve and provide a sample project that demonstrates the problem.
>
>Regards
>Jan
>
>From: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-bounces@xxxxxxxxxxx] On Behalf Of Julien HENRY
>Sent: Donnerstag, 20. Dezember 2012 12:17
>To: Tycho user list
>Subject: [tycho-user] Why eclipse-test-plugin sources are main sources in Maven world?
>
>Hi guys,
>
>We are analyzing our Eclipse project with Sonar. Sonar can use different quality rules to analyze main source code and test source code. For this to works it relies on Maven model (sourceDirectory vs testSourceDirectory).
>
>Except if I miss something it seems that sources of a eclipse-test-plugin module are added to the Maven model as (main) sourceDirectory. Is there any reason for that? I found an issue in bugzilla about preventing duplicate entry in both main and test directory [1]. But it seems the implemented solution was to remove entry in test sources. So how can I configure my build to have my source entry as a test directory only? Should it not be the default for eclipse-test-plugin packaging?
>
>Thanks
>
>Julien
>
>[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=368445
>
>
>


Back to the top