如何为定义的以下gradle插件编写等效的maven插件?
/*
* Plugin to copy system properties from gradle JVM to testing JVM
* Code was copied from gradle discussion froum:
* http://forums.gradle.org/gradle/topics/passing_system_properties_to_test_task
*/
class SystemPropertiesMappingPlugin implements Plugin{
public void apply(Project project){
project.tasks.withType(Test){ testTask ->
testTask.ext.mappedSystemProperties = []
doFirst{
mappedSystemProperties.each{mappedPropertyKey ->
def systemPropertyValue = System.getProperty(mappedPropertyKey)
if(systemPropertyValue){
testTask.systemProperty(mappedPropertyKey, systemPropertyValue)
}
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud) 我需要使用 maven 解压任意 tar.gz 文件(不是工件)。我使用了以下插件,但它在其他一些 .tar 文件中解压了 tar.gz 文件的所有内容。我需要将所有内容放到特定文件夹而不是其他一些 tar 文件中。请建议我还能做什么。
这是我的 pom.xml 模块:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>prepare</id>
<phase>validate</phase>
<configuration>
<tasks>
<echo message="prepare phase" />
<gunzip src="../gui/src/CelGui/target/cel-gui.tar.gz"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)