如何使用maven打包存储库没有包含java源文件

iugsix8n  于 2021-08-25  发布在  Java
关注(0)|答案(0)|浏览(226)

我是Maven的新手。我有一个包含ansible playbooks及其配置和清单文件的存储库。我所要做的就是,使用jenkinsfile、scm checkout 并使用版本增量将ansible工件上传到nexus。我可以打包一个war文件并上传到nexus。但是,当我解压war文件时,它只包含以下文件。

98  07-07-2021 16:53   META-INF/MANIFEST.MF
    0  07-07-2021 16:53   META-INF/
  802  07-07-2021 16:53   META-INF/maven/devansible/AB-ANSIBLE/pom.xml
   86  07-07-2021 16:53   META-INF/maven/devansible/AB-ANSIBLE/pom.properties

现在我知道它不起作用了,我如何使用maven将存储库/文件夹打包成rar、war或tar。xml如下所示。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>devansible</groupId>
  <artifactId>AB-ANSIBLE</artifactId>
  <version>1.2.0</version>
  <packaging>war</packaging>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <!-- Use this to include a selection of jars that will be included in the WAR -->
          <packagingIncludes>${basedir}/*</packagingIncludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题