【问题标题】:Maven plugin for generating ISO file用于生成 ISO 文件的 Maven 插件
【发布时间】:2011-02-06 22:28:29
【问题描述】:

是否有能够生成 ISO 映像的 maven 插件?

我需要获取一些模块的输出(主要是包含 jar 的 zip 文件)并将它们组合成一个 ISO 映像。

谢谢

【问题讨论】:

    标签: java maven-2 plugins iso


    【解决方案1】:

    现在有一个 ISO9660 maven 插件可以完成这项工作:

    https://github.com/stephenc/java-iso-tools/commits/master/iso9660-maven-plugin

    文档很少,但可以使用以下内容:

    <plugin>
        <groupId>com.github.stephenc.java-iso-tools</groupId>
        <artifactId>iso9660-maven-plugin</artifactId>
        <version>1.2.2</version>
        <executions>
            <execution>
                <id>generate-iso</id>
                <goals>
                    <goal>iso</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                    <finalName>${project.build.finalName}.iso</finalName>
                    <inputDirectory>${project.build.directory}/iso</inputDirectory>
                </configuration>
            </execution>
        </executions>
    </plugin>
    

    【讨论】:

    • 如何指定哪些工件进入 ISO?
    【解决方案2】:

    我不知道有任何原生集成(当然是在 Assembly 插件中),但看起来可以使用以下库:http://jiic.berlios.de/

    这可以包装在 Maven 插件中,或者用于与 Maven AntRun 插件和预先捆绑的 ant 任务一起使用的更简单的集成。

    【讨论】:

      【解决方案3】:
      <plugin>
              <groupId>com.github.stephenc.java-iso-tools</groupId>
              <artifactId>iso9660-maven-plugin</artifactId>
              <version>2.0.1</version>
              <executions>
                      <execution>
                              <id>generate-iso-windows</id>
                              <goals>
                                      <goal>iso</goal>
                              </goals>
                              <phase>prepare-package</phase>
                              <configuration>
                                      <enableRockRidge>true</enableRockRidge>
                                      <enableJoliet>true</enableJoliet>
                                      <hideMovedDirectoriesStore>true</hideMovedDirectoriesStore>
                                      <finalName>IsoFileName.iso</finalName>
                                      <inputDirectory>target/input</inputDirectory>
                              </configuration>
                      </execution>
              </executions>
      </plugin>
      

      【讨论】:

      • 如果生成的 ISO 是只读的,则将“enableRockRidge”设置为 false。
      【解决方案4】:

      this mail archive exchange 看来,maven assembly plugin 似乎可以解决问题。但这只是三手资料。

      【讨论】:

        【解决方案5】:
             <plugin>
                 <!-- ISO generation. -->
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>exec-maven-plugin</artifactId>
                 <version>1.2.1</version>
                 <executions>
                     <execution>
                         <goals>
                             <goal>exec</goal>
                         </goals>
                         <phase>verify</phase>
                     </execution>
                 </executions>
                 <configuration>
                     <executable>genisoimage</executable>
                     <arguments>
                         <argument>-V</argument>
                         <argument>${iso.name}</argument>
                         <argument>-m</argument>
                         <argument>*.iso</argument>
                         <argument>-dir-mode</argument>
                         <argument>0555</argument>
                         <argument>-file-mode</argument>
                         <argument>0555</argument>
                         <argument>-gid</argument>
                         <argument>0</argument>
                         <argument>-uid</argument>
                         <argument>0</argument>
                         <argument>-iso-level</argument>
                         <argument>2</argument>
                         <argument>-J</argument>
                         <argument>-joliet-long</argument>
                         <argument>-r</argument>
                         <argument>-o</argument>
                         <argument>${project.build.directory}/${ iso.name }</argument>
                         <argument>${iso.preparation.dir}</argument>
                     </arguments>
                 </configuration>
             </plugin>                                             
        

        【讨论】:

        • 只能在linux机器上执行
        猜你喜欢
        • 2017-10-04
        • 1970-01-01
        • 2014-07-27
        • 1970-01-01
        • 2016-08-31
        • 2019-06-19
        • 2012-11-21
        • 2013-05-05
        • 2013-04-10
        相关资源
        最近更新 更多