2017-01-13 3 views
0

私は、eclipseで開発されたosgiサーバーをWindows、macosx、linux上で実行しています。 Tychoとmavenは、これらのプラットフォームのターゲット構築設定を完全に行っています。特定のターゲットファイルにファイルを挿入する方法

ここでは、最終的なos + wsとarch plateformに従ってstartup.shまたはstartup.batを最後の.zipファイルに挿入する必要があります。 は「configuration.environments.environment.os」のようなものがありますので、私はこのような製品のターゲットフォルダの隣に私のスクリプトフォルダにコピーするために使用することができますMavenの変数に:

delivery_folder/ 
->x86_64/ 
->scripts/ 

をここです製品pomファイルの抽出:

<plugin> 
     <artifactId>maven-resources-plugin</artifactId> 
     <version>3.0.2</version> 
     <executions> 
      <execution> 
      <id>copy-resources</id> 
      <phase>install</phase> 
      <goals> 
       <goal>copy-resources</goal> 
      </goals> 
      <configuration> 
       <outputDirectory>${project.build.directory}/products/${project.artifactId}/${configuration.environments.environment.os}</outputDirectory> 
       <resources>   
       <resource> 
        <directory>scripts</directory> 
        <filtering>true</filtering> 
       </resource> 
       </resources>    
      </configuration>    
      </execution> 
     </executions> 
     </plugin> 

私はTychoターゲット環境機構を使用したいと思います。

私はセットアップティコをしました:

<plugin> 
<groupId>org.eclipse.tycho</groupId> 
<artifactId>target-platform-configuration</artifactId> 
<version>${tycho.version}</version> 
<configuration> 
<environments> 
    <environment> 
    <os>linux</os> 
    <ws>gtk</ws> 
    <arch>x86_64</arch> 
</environment> 
<environment> 
    <os>win32</os> 
    <ws>win32</ws> 
    <arch>x86</arch> 
</environment> 
<environment> 
    <os>win32</os> 
    <ws>win32</ws> 
    <arch>x86_64</arch> 
</environment> 
<environment> 
    <os>macosx</os> 
    <ws>cocoa</ws> 
    <arch>x86_64</arch> 
    </environment> 
</environments> 
</configuration> 
</plugin> 

私はこれを達成するために、ビルド・プロファイルを使用するあなたの助け

答えて

0

のではなく、むしろ低レベルmaven-resoures-pluginを使用して、あなたはまた、プラットフォーム固有のファイルが(そのI eclipse-repositoryに含まれることを可能にするPDEスタイルのrootfilesを、使用することができますあなたのZIPを生成するパッケージングタイプです):

root.win32.win32.x86=rootfiles 

詳細については、Tycho FAQを参照してください。 (今後のTycho version 1.0.0は、root.folder.<subfolder>の構文をサポートすることにより、Tychoのルートファイルサポートをさらに改善する予定です)

0

、ありがとうございました。あなたがサポートする任意のプラットフォーム用のプロファイルを指定し、必要に応じて追加することができactivation

  • ${target.os}
  • ${target.ws}
  • <profiles> 
        <profile> 
         <id>win32-win32-x86</id> 
         <activation> 
          <os> 
           <arch>x86</arch> 
           <family>windows</family> 
          </os> 
         </activation> 
         <properties> 
          <target.os>win32</target.os> 
          <target.ws>win32</target.ws> 
          <target.arch>x86</target.arch> 
         </properties> 
        </profile> 
        <profile> 
         <id>win32-win32-x86_64</id> 
         <activation> 
          <os> 
           <arch>x86_64</arch> 
           <family>windows</family> 
          </os> 
         </activation> 
         <properties> 
          <target.os>win32</target.os> 
          <target.ws>win32</target.ws> 
          <target.arch>x86_64</target.arch> 
         </properties> 
        </profile> 
        <profile> 
         <id>gtk-linux-x86</id> 
         <activation> 
          <os> 
           <arch>i386</arch> 
           <family>unix</family> 
           <name>linux</name> 
          </os> 
         </activation> 
         <properties> 
          <target.os>linux</target.os> 
          <target.ws>gtk</target.ws> 
          <target.arch>x86</target.arch> 
         </properties> 
        </profile> 
        <profile> 
         <id>gtk-linux-amd64</id> 
         <activation> 
          <os> 
           <arch>amd64</arch> 
           <family>unix</family> 
           <name>linux</name> 
          </os> 
         </activation> 
         <properties> 
          <target.os>linux</target.os> 
          <target.ws>gtk</target.ws> 
          <target.arch>x86_64</target.arch> 
         </properties> 
        </profile> 
        <profile> 
         <id>cocoa-macosx-i386</id> 
         <activation> 
          <os> 
           <arch>i386</arch> 
           <family>unix</family> 
           <name>mac os x</name> 
          </os> 
         </activation> 
         <properties> 
          <target.os>macosx</target.os> 
          <target.ws>cocoa</target.ws> 
          <target.arch>x86</target.arch> 
         </properties> 
        </profile> 
        <profile> 
         <id>cocoa-macosx-x86_64</id> 
         <activation> 
          <os> 
           <arch>x86_64</arch> 
           <family>unix</family> 
           <name>mac os x</name> 
          </os> 
         </activation> 
         <properties> 
          <target.os>macosx</target.os> 
          <target.ws>cocoa</target.ws> 
          <target.arch>x86_64</target.arch> 
         </properties> 
        </profile> 
    </profiles> 
    

    これはあなたのディレクトリを設定するために使用することができる3つのプロパティを設定します

  • ${target.arch}

は、その後、あなたのmaven-resources-plugin設定で:

<outputDirectory>${project.build.directory}/products/${project.artifactId}/${target.os}.${target.ws}.${target.arch}</outputDirectory> 
関連する問題