【问题标题】:Sonar Analysis for website project - ASP.NET网站项目的声纳分析 - ASP.NET
【发布时间】:2011-09-20 14:02:34
【问题描述】:

我正在尝试使用 maven 构建和分析一个 asp.net 网站项目

我使用的命令: mvn 声纳:声纳 -e

我的根目录中有一个 pom 文件(与存储 website.sln 的目录相同)。

目录结构:

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

|

执行命令的结果是:Build Error -Embedded error: Unable to execute maven plugin

我做了同样的事情,我可以成功地构建一个 Web 应用程序项目和控制台应用程序项目(它们有 Visual Studio 项目文件)。我不为网站项目工作的原因是它在网站文件夹中没有 .csproj 文件。

那么如何使用 maven 成功构建和分析网站项目。

谁能帮我解决这个问题。

这是我的 pom 文件:

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>

【问题讨论】:

    标签: asp.net maven-2 web sonarqube


    【解决方案1】:

    您应该向用户邮件列表发送邮件。

    无论如何,我觉得“maven dotnet 插件”和“sonar maven 插件”之间存在误解。 “maven dotnet 插件”提供了使用 maven 构建 dotnet Visual Studio 解决方案的能力。它主要依赖于 msbuild。

    “sonar maven dotnet 插件”允许使用 maven 引导声纳分析。

    查看以下页面上的第二个 pom 示例:Maven .NET Plugin

    如果您想使用 maven 构建和分析您的解决方案,则需要配置这两个插件。

    话虽如此,您应该知道使用声纳分析 C# 项目时,无论是 maven 还是这两个插件都不是必需的。您可以使用任何您想要编译解决方案的构建工具(即 msbuild、nant),并且可以使用简单的 sonar java runner 来触发分析。

    查看official wiki 并随时向用户邮件列表提问。 您可以在这里轻松订阅:Support

    【讨论】:

      猜你喜欢
      • 2016-03-21
      • 1970-01-01
      • 2017-05-09
      • 2013-04-23
      • 2017-12-13
      • 1970-01-01
      • 1970-01-01
      • 2012-12-18
      • 1970-01-01
      相关资源
      最近更新 更多