java - 为什么 META-INF 文件夹是空的?
问题描述
没有 META-INF 文件对我来说非常重要,因为我使用的是 Swagger UI,它会将 META-INF 添加到资源处理程序中。
Pom 文件:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.2.RELEASE</version>
<relativePath/>
</parent>
<packaging>war</packaging>
<properties>
<java.version>1.8</java.version>
...
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<mainClass>${maven-war-plugin.mainClass}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>UTF-8</encoding>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</annotationProcessorPath>
<annotationProcessorPath>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>${hibernate.version}</version>
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
这是我的src/main/resources
文件夹:
resources
--application.properties
--logback--spring.xml
当我运行时mvn clean install
,这就是我从目标文件夹中得到的全部内容:
target
--classes
--project-1.0-SNAPSHOT
--generated-sources
--generated-test-sources
--maven-archiver
--maven-status
--surefire-reports
--test-classes
--project-1.0-SNAPSHOT.war
--project-1.0-SNAPSHOT.war.original
我真的很困惑为什么我的清单文件没有被生成。我在里面检查了目标--project-1.0-SNAPSHOT
,我看到了 2 个目录 META-INF 和 WEB-INF(除了其他生成的东西)。WEB-INF 包含所有的类、库和视图。META-INF 绝对是空的。
我检查了我的application.properties
文件,没有看到任何改变资源路径的属性。
解决方案
推荐阅读
- css - 带圆角的 CSS 菜单
- dart - Dart - 入门 - 缺少步骤 - 如何安装 pub
- javascript - 编码新手...我正在寻找一个函数来使用 Javascript 在 html 中按标签名称删除元素?
- java - 我的肥皂服务器模块没有收到客户端表单
- java - 如何下载 Java 并在命令行上运行文件
- python - 如何在python版本Windows之间切换
- codeigniter-3 - Codeigniter 似乎总是将validation->run 设置为FALSE
- php - 遍历字符串以删除配对括号,直到替换所有配对
- c# - 对 0、1 和 2 的数组进行排序(进一步优化)
- python - 如何获取 Neo4j 查询中更新的节点总数?