1

有没有办法通过执行 rpm-maven-plugin 来避免在最终的 rpm 包中创建完整的目录路径?

 <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>rpm-maven-plugin</artifactId>
            <version>2.1.1</version>
            <extensions>true</extensions>
            <executions>
                <execution>
                    <id>attach-rpm</id>
                    <goals>
                        <goal>attached-rpm</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <group>client2-scripts</group>
                <mappings>
                    <mapping>
                        <directory>/opt/bbmc/bin</directory>
                        <filemode>750</filemode>
                        <username>elasticsearch</username>
                        <groupname>elasticsearch</groupname>
                        <sources>
                            <source>
                                <location>src/main/</location>
                                <includes>
                                    <include>commons/config/*.ini</include>
                                    <include>commons/config/*.properties</include>
                                    <include>*/*.py</include>
                                </includes>
                            </source>
                        </sources>
                    </mapping>
                </mappings>
            </configuration>
        </plugin>

生成的目录结构如下所示:

opt
   bbmc
       bin
          bbto793
                 *.py
              ...

而不是所需的:

opt
   bbmc
       bin
          *.py
4

1 回答 1

1

将文件放入src/main您希望在 rpm 中提供的相同结构中。

于 2015-01-23T03:02:41.050 回答