2012-01-25 16 views

回答

7

做到这一点的唯一方法是与另一个Maven插件像AntrunAssembly文件处理运行AppAssembler后。

此问题(请参阅下面的链接)已在AppAssembler项目问题​​跟踪器中提出,并被拒绝为​​。

问题:MAPPASM-54

2

我认为它可以在你的assembly.xml进行设置,在fileSet标签:

<fileSets> 
<fileSet> 
    <directory>src/resources/bin</directory> 
    <lineEnding>keep</lineEnding> 
    <useDefaultExcludes>true</useDefaultExcludes> 
    <outputDirectory>bin</outputDirectory> 
    <includes> 
    <include>*.bat</include> 
    <include>*.sh</include> 
    </includes> 
    <fileMode>744</fileMode> 
</fileSet> 
... 
+2

谢谢,但你的答案是关于Assembly插件。请按照问题中的链接,你会看到它是关于不同的插件。 –

+0

对不起,莎莎,我一定误会你的问题。 – maksimov

0

由于Maven的3.0.3所有插件都在他们是在你的pom.xml的顺序执行。因此,以独立于平台的方式设置可执行标志与在appassembler插件后面使用maven-enforcer插件一样简单。

 <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-enforcer-plugin</artifactId> 
     <version>1.3.1</version> 
     <executions> 
      <execution> 
      <id>enforce-beanshell</id> 
      <phase>package</phase> 
      <goals> 
       <goal>enforce</goal> 
      </goals> 
      <configuration> 
       <rules> 
       <evaluateBeanshell> 
        <condition> 
         import java.io.File; 

         print("set executable for file ${basedir}/dist/bin/mql"); 
         new File("${basedir}/dist/bin/mql").setExecutable(true,false);     

         true; 
        </condition> 
       </evaluateBeanshell> 
       </rules> 
       <fail>false</fail> 
      </configuration> 
      </execution> 
     </executions> 
     </plugin> 
相关问题