The default is to generate scripts for all platforms which means to generate Windows and shell scripts.
<project> ... <build> <plugins> <plugin> ... <configuration> <platforms> <platform>all</platform> </platforms> <programs> <program> <mainClass>com.mycompany.app.App</mainClass> <id>app</id> </program> </programs> </configuration> </plugin> </plugins> </build> </project>
The generation supports Windows as well as Unix as platform. If you like to generate a script for one platform you can simply define the platform in the program block of the script part.
<project> ... <build> <plugins> <plugin> ... <configuration> <programs> <program> <platforms> <platform>unix</platform> </platforms> <mainClass>com.mycompany.app.App</mainClass> <id>app</id> </program> </programs> </configuration> </plugin> </plugins> </build> </project>
If you like to generate for a single platform but multiple classes which contain a main method this can done by using the following:
<project> ... <build> <plugins> <plugin> ... <configuration> <platforms> <platform>unix</platform> </platforms> <programs> <program> <mainClass>com.mycompany.app.App1</mainClass> <id>app1</id> </program> <program> <mainClass>com.mycompany.app.App2</mainClass> <id>app2</id> </program> </programs> </configuration> </plugin> </plugins> </build> </project>
Suppose you would like to create a part of you Java program for Unix but an other part for Windows? So this can be done using the following configuration:
<project> ... <build> <plugins> <plugin> ... <configuration> <programs> <program> <platforms> <platform>unix</platform> </platforms> <mainClass>com.mycompany.app.App</mainClass> <id>app</id> </program> <program> <platforms> <platform>windows</platform> </platforms> <mainClass>com.mycompany.app.AppWindows</mainClass> <id>app-windows</id> </program> </programs> </configuration> </plugin> </plugins> </build> </project>