Od verze 1.1 lze nastavit extension pro jednotlive platformy, viz
dokumentace<http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/assemble-mojo.html#binFileExtensions>
.
Pokud jde o ten BASEDIR, tak asi opravdu bude nutne pustit assemble goal 2x
(pro unix a pro windows platformu). Asi nejak takto:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>assemble-unix</id>
<goals>
<goal>assemble</goal>
</goals>
<configuration>
<extraJvmArguments>-DPRADA_SERVER_CONF=$BASEDIR/conf/pradaServer.properties</extraJvmArguments>
<platforms>
<platform>unix</platform>
</platforms>
</configuration>
</execution>
<execution>
<id>assemble-windows</id>
<goals>
<goal>assemble</goal>
</goals>
<configuration>
<extraJvmArguments>-DPRADA_SERVER_CONF=%BASEDIR%/conf/pradaServer.properties</extraJvmArguments>
<platforms>
<platform>windows</platform>
</platforms>
</configuration>
</execution>
</executions>
<configuration>
<programs>
<program>
<mainClass>cz.cngroup.prada.server.PradaServerImpl</mainClass>
<!-- the name of the bat/sh files to be generated -->
<name>start</name>
</program>
</programs>
<repositoryLayout>flat</repositoryLayout>
<repositoryName>lib</repositoryName>
<binFileExtensions>
<unix>.sh</unix>
</binFileExtensions>
</configuration>
</plugin>
Maly hint:
Pro kopirovani resources pro assembly je lepsi pouzit <fileSet/> nebo
<files>
<files>
<file>
<source>src/main/config/pradaServer.properties</source>
<outputDirectory>conf</outputDirectory>
</file>
</files>
Petr P.
2010/11/11 <[email protected]>
>
> Hojte lidi, mam tento problem.
>
> Potrebuju vygenerovat batak a sh script , ale netusim jak unixove verzi
> podstrcit pouzivani $BASEDIR a windows verzi pouziti %BASEDIR%. Navic batak
> se mi vygeneruje jako start.bat a shell script jenom jako start. Zde je kod:
>
> <plugins>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
>
> <artifactId>appassembler-maven-plugin</artifactId>
> <version>1.0</version>
> <executions>
> <execution>
> <id>assemble-standalone</id>
> <phase>package</phase>
> <goals>
>
> <goal>assemble</goal>
> </goals>
> <configuration>
>
>
> <extraJvmArguments>-DPRADA_SERVER_CONF=%BASEDIR%/conf/pradaServer.properties</extraJvmArguments>
> <programs>
> <program>
>
> <mainClass>cz.cngroup.prada.server.PradaServerImpl</mainClass>
> <!--
> the name of the bat/sh files to be generated -->
>
> <name>start</name>
> </program>
> </programs>
> <platforms>
>
> <platform>windows</platform>
>
> <platform>unix</platform>
> </platforms>
>
> <repositoryLayout>flat</repositoryLayout>
>
> <repositoryName>lib</repositoryName>
> </configuration>
> </execution>
> </executions>
> </plugin>
> <plugin>
> <artifactId>maven-antrun-plugin</artifactId>
> <executions>
> <execution>
> <phase>package</phase>
> <goals>
> <goal>run</goal>
> </goals>
> <configuration>
> <tasks>
> <copy
> file="src/main/config/pradaServer.properties"
>
> tofile="${project.build.directory}/appassembler/conf/pradaServer.properties"
> />
> </tasks>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> <plugin>
>
> <artifactId>maven-assembly-plugin</artifactId>
> <version>2.2-beta-5</version>
> <executions>
> <execution>
> <phase>package</phase>
> <goals>
> <goal>single</goal>
> </goals>
> <configuration>
> <descriptors>
>
> <descriptor>src/main/assembly/archive.xml</descriptor>
> </descriptors>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> </plug
>
>
>
> Nasel jsem neco, jako ze se maji pouzit dve konfigurace, ale nevim syntaxi.
> Muzete mi s tim nekdo prosim poradit?
>