更改Maven解压缩的源的权限?

时间:2015-08-21 15:30:29

标签: maven permissions unpack

我有一个Maven项目,它构建了Apache solr-core库的修补版本。第一步是解压原始来源:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.10</version>
            <executions>
                <execution>
                    <id>solr-core-sources</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>unpack</goal>
                    </goals>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>org.apache.solr</groupId>
                                <artifactId>solr-core</artifactId>
                                <version>${solr.version}</version>
                                <type>jar</type>
                                <classifier>sources</classifier>
                                <outputDirectory>${solr.sources.dir}</outputDirectory>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>

问题是在某些平台上,来源不可读,权限为070(--- rwx ---)。例如。它在Linux构建服务器上很好(perms是644),但是开发人员之间的行为不一致&#39; Windows 7计算机,每个都在Cygwin下,使用umask 0022。

我想在解压缩后向chmod添加一个步骤:有没有办法做到这一点?我试验了依赖插件的 ignorePermissions useJvmChmod 的排列,但没有成功。我知道程序集插件支持chmod操作,但显然不像我在这里那样就位,而且我也遇到过使用ant的严厉解决方案。任何想法或建议?谢谢!

1 个答案:

答案 0 :(得分:3)

您可以在解压缩文件后使用antrun插件运行chmod:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="div">
    <div class="hover">Hover</div>
    <div class="height">
    <div class="tip1">MacBook now comes with 1GB of memory standard and larger hard drives for the entire line perfect for running more of your favorite applications and storing growing media collections.</div>
    <div class="tip2">iPhone is a revolutionary new mobile phone that allows you to make a call by simply tapping a name or number in your address book, a favorites list, or a call log. It also automatically syncs all your contacts from a PC, Mac, or Internet service. And it lets you select and listen to voicemail messages in whatever order you want just like email.</div>
    <div class="prev"><</div>
    <div class="next">></div>
    <div class="open">?</div>
        <div class="lists">
            <ol>
                <li>Product 1 / Price : $10</li>
                <li>Product 2 / Price : $20</li>
                <li>Product 3 / Price : $30</li>
                <li>Product 4 / Price : $40</li>
                <li>Product 5 / Price : $50</li>
            </ol>
        </div>
    </div>
</div>

ant chmod Task通常不会在普通窗口上做任何事情(它不会导致构建失败)。