dotnet-maven-plugin

A Maven plugin for building dotnet projects based on .csproj or project.json files.

This plugin lets you use the power of Maven to drive .NET core builds.

Build Status: Linux

Features

Installing

The plugin leverages the dotnet (required) and nuget (optional) command line tools, which have to be installed prior to usage of the plugin.

The simples use-case it to simply define your project with the packaging type, dotnet and enabled it with a plugin in pom.xml like this:

<project>
  [...]
  <packaging>dotnet</packaging>

  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.eobjects.build</groupId>
        <artifactId>dotnet-maven-plugin</artifactId>
        <version>0.24</version>
        <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>
  [...]
</project>

Configuration

Should you want to, you can configure many aspects of the dotnet and nuget invocations. The following should provide a handy overview by example:

<plugin>
  <groupId>org.eobjects.build</groupId>
  <artifactId>dotnet-maven-plugin</artifactId>
  <version>0.23</version>
  <extensions>true</extensions>
  <configuration>
    <buildConfiguration>Release</buildConfiguration>
    <buildEnabled>true</buildEnabled>
    <cleanEnabled>true</cleanEnabled>
    <environment>
      <MY_ENVVAR_1>hello</MY_ENVVAR_1>
      <MY_ENVVAR_2>world</MY_ENVVAR_2>
    </environment>
    <integrationTestRunEnabled>true</integrationTestRunEnabled>
    <integrationTestVerifyEnabled>true</integrationTestVerifyEnabled>
    <nugetAddEnabled>true</nugetAddEnabled>
    <nugetAddSource>~/.nuget/Packages</nugetAddSource>
    <nugetPushEnabled>true</nugetPushEnabled>
    <packEnabled>true</packEnabled>
    <packOutput>bin</packOutput>
    <publishEnabled>true</publishEnabled>
    <publishOutput>bin/my-publish-output</publishOutput>
    <repository>https://path/to/repository</repository>
    <restoreEnabled>true</restoreEnabled>
    <testEnabled>true</testEnabled>
  </configuration>
</plugin>

Take a look at the Example projects for more inspiration.