我喜欢用Maven打包一些特殊文件。因此,我写了一个特殊的包装,我们称之为“ specialZip”。在打包生命周期阶段的mojo实现中,我喜欢获取源目录,但正如maven缺省所说的那样,它们是“ src / main / java”。我喜欢将其更改为src / main / special。我知道我可以在使用包装的maven项目中完成此工作。但是我认为最好是改变包装。
这是我的components.xml:
<?xml version="1.0"?>
<component-set>
<components>
<component>
<role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
<role-hint>specialZip</role-hint>
<implementation>
org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
</implementation>
<configuration>
<lifecycles>
<lifecycle>
<id>default</id>
<phases>
<process-resources>
org.apache.maven.plugins:maven-resources-plugin:resources
</process-resources>
<process-test-resources>
org.apache.maven.plugins:maven-resources-plugin:testResources
</process-test-resources>
<package>
org.test:specialZip-maven-plugin:generateZip
</package>
<install>
org.apache.maven.plugins:maven-install-plugin:install
</install>
<deploy>
org.apache.maven.plugins:maven-deploy-plugin:deploy
</deploy>
</phases>
</lifecycle>
</lifecycles>
</configuration>
</component>
<component>
<role>org.apache.maven.artifact.handler.ArtifactHandler</role>
<role-hint>specialZip</role-hint>
<implementation>
org.apache.maven.artifact.handler.DefaultArtifactHandler
</implementation>
<configuration>
<type>specialZip</type>
<extension>zip</extension>
<language>myLanguage</language>
<addedToClasspath>false</addedToClasspath>
</configuration>
</component>
</components>
</component-set>
是否也可以在此处配置默认源目录?
感谢帮助!
帕特里克