Hilco Wijbenga <hilco.wijbenga <at> gmail.com> writes:

> 
> Hi all,
> 
> I found the plexus-compiler-csharp in
> http://maven.apache.org/plugins/maven-compiler-plugin/non-javac-compilers.html.
> I'd like to know how to actually use this compiler.
> 
> I've got some Java code and some C# code (the latter currently in
> src/main/csharp but I've also tried src/main/cs). I can't get the C#
> code to compile. Mvn -X seems to indicate that the compiler plugin is
> still looking in src/main/java for the C# code.
> 
> When I put C# code in src/main/java I get a complaint that "This
> compiler doesn't support in-process compilation.".
> 
> How is this supposed to work? Or should I forget about this plugin and
> use an Ant task?
> 
> Cheers,
> Hilco
> 


This plugin has a "fork" parameter which must be set to true (according to the
source code of the plugin). Try the following:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.0</version>
    <configuration>
        <compilerId>csharp</compilerId>
        <fork>true</fork>
       
<executable>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe</executable>
        <outputFileName>myDLL</outputFileName>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-compiler-csharp</artifactId>
            <version>2.2</version>
        </dependency>
    </dependencies>
</plugin>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to