开发者

Sonar Analysis for website project - ASP.NET

开发者 https://www.devze.com 2023-04-05 23:24 出处:网络
I was trying to build and analyze a asp.net website project using maven Command I used : mvn sonar:sonar -e

I was trying to build and analyze a asp.net website project using maven

Command I used : mvn sonar:sonar -e

I have single pom file in my root directory(same directory where website.sln is stored).

Directory structure:

     |---Website (website project file)
     |
     |---website.sln
     |---pom.xml

|

Result of executing command was : Build Error -开发者_运维问答Embedded error: Unable to execute maven plugin

I did same things and I could successfully build a web application project and console application project(which have visual studio project file). I thing reason for not working for website project is it does not have .csproj file inside website folder.

So how could successfully build and analyze a website project using maven.

Could someone please help me to fix this issue.

this is my pom file:

http://maven.apache.org/maven-v4_0_0.xsd">

<groupId>MindTree</groupId>
<artifactId>webbssite</artifactId>
<version>1.0</version>
<modelVersion>4.0.0</modelVersion>
<name>Maya</name>
<packaging>sln</packaging>

<url>http://maven.apache.org</url>


<properties>
    <!-- 
       NOTE : the versions and parameters may be defined as properties. 
       Prefer this option to the plugin configuration as it may be accessible to several plugins
    -->
    <!-- Name of the solution file, located in the same directory as the pom.xml -->
    <visual.studio.solution>website.sln</visual.studio.solution>

    <!-- Name pattern to recognize the test assemblies, so that unit tests are only launched on those,
    and so that those are excluded from code coverage -->
    <visual.test.project.pattern>*.Tests</visual.test.project.pattern>

    <!-- Version of the .Net tools, which may be 2.0 or 3.5 only -->
    <dotnet.tool.version>4.0</dotnet.tool.version>
    <sonar.language>cs</sonar.language>
    <msbuild.configurations>Debug</msbuild.configurations>
    <maven.site.generateReports>false</maven.site.generateReports>
    <sonar.dynamicAnalysis>false</sonar.dynamicAnalysis>
    <sonar.cpd.skip>true</sonar.cpd.skip>

</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.sonar-plugins.dotnet</groupId>
            <artifactId>maven-dotnet-plugin</artifactId>
            <version>0.6</version>
            <configuration>
                <solutionName>website.sln</solutionName>
                <language>cs</language>
                <toolVersion>3.5</toolVersion>
                <Platform>x86</Platform>
                <buildConfigurations>Release,Debug</buildConfigurations>
                <rebuild>true</rebuild>
            </configuration>
            <extensions>true</extensions>
        </plugin>
    </plugins>
</build>


You should rather send a mail to the user mailing list.

Anyway I have the feeling there is a misunderstanding between the "maven dotnet plugin" and the "sonar maven plugin". The "maven dotnet plugin" provides the ability to build dotnet visual studio solution with maven. It relies mostly on msbuild.

The "sonar maven dotnet plugin" alows to bootstrap a sonar analysis with maven.

Check out the second pom example on the following page : Maven .NET Plugin

Both plugins need to be configured if you want to use maven to build and analyse your solution.

That being said, you should know that neither maven nor those two plugins are mandatory to analyse a C# project with sonar. You could use whatever build tool you want to compile your solution (i.e. msbuild, nant)and you could use the simple sonar java runner to trigger the analysis.

Check out the official wiki and feel free to ask questions to the user mailing list. You can subscribe easily here : Support

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号