rpm-maven-plugin 在最终 rpm 中排除目录

rpm-maven-plugin exclude directories in final rpm

有没有办法通过执行 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

src/main 中的文件放入您要在 rpm 中传送的相同结构中。