当前位置: 首页 > news >正文

wordpress网站首页链接乱码/郑州seo服务公司

wordpress网站首页链接乱码,郑州seo服务公司,简单个人网站开发,网站建设的通知我执行 mvn install 报如下错误 可是我在 web 模块中能正确引用到 common 的类,于是我把 web 引用到的 common 中的类先移动到 web 模块中,然后把 common 模块的类都删掉,然后再次执行 mvn install,结果报错如下: [ERROR] Faile…

我执行 mvn install 报如下错误
在这里插入图片描述
可是我在 web 模块中能正确引用到 common 的类,于是我把 web 引用到的 common 中的类先移动到 web 模块中,然后把 common 模块的类都删掉,然后再次执行 mvn install,结果报错如下:

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.1.12:repackage (repackage) on project common: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:3.1.12:repackage failed: Unable to find main class -> [Help 1]
[ERROR]

这个问题的原因:
Spring Boot 的 spring-boot-maven-plugin 插件的 repackage 目标需要在构建时指定一个主类(main class),用于创建可执行的 JAR 或 WAR 文件。如果你的 common 模块不是一个 Web 或 Spring Boot 应用,它应该不需要这个插件的 repackage 目标,因为它并没有主类(main class)可供启动。

我的项目结构

父模块 - tylerpro

tylerpro 的 pom.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 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>3.1.12</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>com.tylerpro</groupId><artifactId>tylerpro</artifactId><version>0.0.1</version><name>tylerpro</name><description>tylerpro</description><packaging>pom</packaging><modules><module>web</module><module>common</module></modules><properties></properties><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><excludes><exclude><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></exclude></excludes></configuration></plugin></plugins></build>
</project>

子模块 - common

<?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><parent><groupId>com.tylerpro</groupId><artifactId>tylerpro</artifactId><version>0.0.1</version></parent><groupId>com.tylerpro</groupId><artifactId>common</artifactId><version>0.0.1</version><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties>
</project>

子模块 - web

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>com.tylerpro</groupId><artifactId>tylerpro</artifactId><version>0.0.1</version></parent><groupId>com.tylerpro</groupId><artifactId>web</artifactId><name>web</name><description>web</description><properties></properties><dependencies><dependency><groupId>com.yxai</groupId><artifactId>common</artifactId><version>0.0.1</version></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><excludes><exclude><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></exclude></excludes></configuration></plugin></plugins></build>
</project>

原因是 因为 common 模块中继承了父模块的打包插件,而 common 模块只是作为一个普通的库使用,它不是一个 springboot 项目。在父模块中使用了 spring-boot-maven-plugin 打包,所以 common 打包出错了。

解决方案

因为 web 中已经使用了 spring-boot-maven-plugin 打包插件,所以直接删除父模块中的打包插件就行。

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>3.1.12</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>com.tylerpro</groupId><artifactId>tylerpro</artifactId><version>0.0.1</version><name>tylerpro</name><description>tylerpro</description><packaging>pom</packaging><modules><module>web</module><module>common</module></modules><properties></properties>

扩展:

maven 打包的几种方式:

SpringBoot 使用 maven 创建一个可执行的 jar 包 - SpringBoot官方文档-Creating an Executable Jar

apache maven plugin 打包插件
apache maven plugin 打包插件的属性配置

maven 高级视频教程

http://www.jmfq.cn/news/5330953.html

相关文章:

  • 宜宾网站建设88sou/河南网站seo靠谱
  • 分类网站建设与开发/友情链接的四个技巧
  • 越南网站建设/网站怎么进入
  • 横峰县城乡建设网站/运营推广公司
  • 西安航空城建设发展集团网站/企业seo网络推广
  • 合肥建设局网站首页/百度灰色关键词排名
  • 麻章网站建设公司/seo网络推广优化
  • 网站建设综合实践 教材/枸橼酸西地那非片多长时间见效
  • 网站和微信同步建设/南昌seo公司
  • 长春网站建设索q479185700/福州seo排名优化
  • 郴州本地网站建设/会计培训班一般收费多少
  • 高埗镇网站建设/焊工培训班
  • 商城手机网站建设/软文推广哪个平台好
  • 四平市住房和畅想建设局网站/无锡营销型网站制作
  • 宿州商务网站建设/优化网站排名方法教程
  • 化隆县公司网站建设/海外短视频跨境电商平台是真的吗
  • 网站建设分工的通知/外链代发
  • 金藏源电商网站建设公司/个人网站设计欣赏
  • 网站建设答辩/百度网站提交
  • 白沙网站建设/郑州seo代理外包
  • 深圳建设网站的公司/怎么做品牌推广和宣传
  • 新疆建设兵团12333网站/直通车推广技巧
  • 小白如何建设网站/seo海外推广
  • 西安营销型网站建设动力无限/seo的培训网站哪里好
  • 移动网站建设cnfg/网络推广项目外包公司
  • 陕西城乡建设委网站/免费网站代理访问
  • 网站建设所需要软件/体验营销
  • 网站建设图文教程/百度一下首页
  • 网站建设包含什么/网络运营师
  • 中国禹路由网站建设中/用今日头条导入自己网站外链