Shr*_*ani 73 java pom.xml maven spring-boot
pom.xml在Eclipse IDE的第1行出现未知错误。到昨天为止,它工作正常,但是在从master更新我的项目并修复合并冲突之后突然在pom.xml中获得了“未知错误”。除了我,我的队友都没有面对这个问题。我还更改了工作区,删除了缓存,但仍然没有运气。
我正在为此项目使用h2数据库,尽管在data.sql中插入了值,但它没有选择任何值并将其插入到h2 DB表中。在此问题之前,它工作正常。我感觉是由于pom.xml中的问题引起的,但是我不确定。请帮忙
我删除了现有项目,并从master那里获取了最新代码。之后,删除包括存储库文件夹在内的用户下的.m2文件夹。我确实更新了项目,并启用了强制更新快照/发行版,maven clean和maven build。但是没有任何帮助。
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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.abc.roster</groupId>
<artifactId>spring-boot-roster-app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>spring-boot-roster-app</name>
<description>Demo project for Spring Boot Roster</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<!-- <start-class>com.infosys.roster.SpringBootRosterAppApplication</start-class> -->
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!--encryption lib -->
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt-springsecurity3</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<!-- <dependency> -->
<!-- <groupId>org.hibernate</groupId> -->
<!-- <artifactId>hibernate-core</artifactId> -->
<!-- <version>5.2.10.Final</version> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>io.springfox</groupId> -->
<!-- <artifactId>springfox-swagger2</artifactId> -->
<!-- <version>2.7.0</version> -->
<!-- <scope>compile</scope> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>io.springfox</groupId> -->
<!-- <artifactId>springfox-swagger-ui</artifactId> -->
<!-- <version>2.7.0</version> -->
<!-- <scope>compile</scope> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>io.springfox</groupId> -->
<!-- <artifactId>springfox-data-rest</artifactId> -->
<!-- <version>2.7.0</version> -->
<!-- </dependency> -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
</project>
Run Code Online (Sandbox Code Playgroud)
application.properties
server.port=
spring.h2.console.path=/h2
spring.h2.console.enabled=true
spring.datasource.url=
spring.datasource.username=
spring.datasource.password=
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.platform=h2
spring.datasource.initialization-mode=always
spring.jpa.hibernate.ddl-auto=update
spring.datasource.continue-on-error=true
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=false
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect
Run Code Online (Sandbox Code Playgroud)
应该删除pom.xml中的未知错误,并且我还必须能够填充H2 db中的值。
Mat*_*ias 103
根据当前状态回答
此问题已解决:
请从https://download.eclipse.org/m2e-wtp/releases/1.4/安装用于mavenarchiver插件0.17.3的m2e连接器
过时的答案
比春季启动降级一个不太深刻的变化2.1.5.RELEASE,以2.1.4.RELEASE将被降级只是受影响的Maven Jar插件从3.1.2到3.1.1只要这个错误存在:
<properties>
<!-- ... -->
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>
Run Code Online (Sandbox Code Playgroud)
Sad*_*tun 38
将 3.1.1 添加到如下所示的属性中,然后修复问题
<properties>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>
Run Code Online (Sandbox Code Playgroud)
只需更新项目 => 右键单击 => Maven => 更新项目
小智 33
对我来说,我更改了pom.xml的父标签,它解决了将其从2.1.5更改为2.1.4,然后是Maven-> Update Project
Ste*_*hen 19
根据@Shravani的建议,在我的pom.xml文件中,我从以下位置更改了该区域中的版本号:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
Run Code Online (Sandbox Code Playgroud)
对此:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
Run Code Online (Sandbox Code Playgroud)
然后,我右键单击该项目,然后执行了“ Maven->更新项目...”。这使问题对我而言消失了。
Ant*_*nio 13
您必须升级 m2e 连接器。这是一个已知的错误,但有一个解决方案:
进入 Eclipse 单击“帮助”>“安装新软件...”
出现一个窗口。在“安装”窗口中:
2a. 进入“Work with”输入框,输入下一个站点位置,然后按 Enter https://download.eclipse.org/m2e-wtp/releases/1.4/
2b. 出现大量信息进入“姓名”输入框。选择所有项目
2c。单击“下一步”按钮。
完成安装并重新启动 Eclipse。
小智 9
有关Eclipse和spring-boot-starter-parent 2.1.5的错误
“如果maven包装属性是war,那么没问题。问题出在罐子类型上。” 因此,您还可以通过更改包装类型来解决此问题。
<packaging>war</packaging>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
39770 次 |
| 最近记录: |