.gitignore文件未复制到原型JAR - 变通办法?

Cha*_*min 17 gitignore maven maven-resources-plugin maven-archetype

目前在maven-resources-plugin中存在一个错误,即.gitignore文件未复制到原型JAR.请参阅此错误报告

简短而简单的问题:在原型中获取文件有变通方法吗?

编辑:行家资源插件版本设置为2.6并没有解决我的问题(如提到这里)

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
Run Code Online (Sandbox Code Playgroud)

ama*_*aux 13

现在修复了maven-resources-plugin中的错误.

要包含.gitignore文件,应在archetype pom.xml文件中显式设置maven-resources-plugin插件,并将配置值addDefaultExcludes设置为false:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-resources-plugin</artifactId>
  <version>3.0.2</version>
  <configuration>
    <addDefaultExcludes>false</addDefaultExcludes>
  </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

  • 停止使用3.0.2和Maven 3.5.4为我工作...我想知道是否还有其他人受到影响... (5认同)