Skip to content

Instantly share code, notes, and snippets.

@amuino
Created September 3, 2009 10:01
Show Gist options
  • Save amuino/180218 to your computer and use it in GitHub Desktop.
Save amuino/180218 to your computer and use it in GitHub Desktop.
Launching msbuild from maven and installing the exe on the repo
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!--
Example pom for delegating maven goals to msbuild so it builds the "solution"
A solution can be a group of projects, but here we only have one.
It should also be possible to have one maven project per solution project,
and have a parent pom to deletegate the build.
-->
<parent>
<artifactId>your-artifact-id</artifactId>
<groupId>your.group.id</groupId>
<version>1.2-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>a-dotNet-artifact-in-your-product</artifactId>
<packaging>pom</packaging>
<name>.NET project for testing interoperability of published webservices</name>
<properties>
<msbuild.exe>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild.exe</msbuild.exe>
<msbuild.configuration>Release</msbuild.configuration>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<executable>${msbuild.exe}</executable>
<workingDirectory>${basedir}/TestBuscarUsuarioConAmbitos</workingDirectory>
</configuration>
<executions>
<execution>
<id>clean-with-msbuild</id>
<phase>clean</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<arguments>
<argument>/t:Clean</argument>
<argument>/p:Configuration=${msbuild.configuration}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>package-with-msbuild</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<arguments>
<argument>/t:Rebuild</argument>
<argument>/p:Configuration=${msbuild.configuration}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>attach-testBuscarUsuarioConAmbitos</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${basedir}/ProejctName/bin/${msbuild.configuration}/ProjectName.exe</file>
<type>exe</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment