网站项目的声纳分析 - ASP.NET

发布于 2024-12-06 02:39:25 字数 2795 浏览 0 评论 0原文

我试图使用

我使用的 Maven 命令构建和分析 ASP.NET 网站项目: mvn sonar:sonar -e

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

目录结构:

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

|

执行命令的结果是:构建错误 - 嵌入错误:无法执行 Maven 插件

我做了同样的事情,我可以成功构建一个 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>

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

無處可尋 2024-12-13 02:39:25

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

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

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

查看下页上的第二个 pom 示例: Maven .NET 插件

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

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

查看官方 wiki 并随时向用户邮件列表。
您可以在这里轻松订阅:支持

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文