Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to build spring-boot-vuejs in Gradle

Shulou Source: shulou.com Published: 2022-06-02 02:32:50 11月12日 Update

Gradle how to build spring-boot-vuejs, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Find a suitable project spring-boot-vuejs in Github and download it ready to build. But the original project had only maven configuration, and I wanted to build it in gradle. Go online and find out that gradle comes with the ability to convert POM, although this is still a hatching feature:

Gradle init-type pom

Execute the above command directly in the project root directory, and the relevant files for gradle will be automatically generated.

After that, I directly use the system commands to build, instead of using the generated gradlew, and then run the generated jar package:

Gradle buildjava-jar. / backend/build/libs/backend-0.0.1-SNAPSHOT.jar

Failed to run the project successfully:

Picked up _ JAVA_OPTIONS:-Dawt.useSystemAAFontSettings=gasp

There is no main manifest property in build/libs/backend-0.0.1-SNAPSHOT.jar

Manually modify the build.gradle of the backend project:

Plugins {id 'org.springframework.boot' version' 2.1.6.RELEASE' id 'java'} apply plugin:' io.spring.dependency-management'repositories {mavenCentral ()} jar {baseName = 'spring-boot-vuejs' version =' 0.1.0'} sourceCompatibility = 1.8targetCompatibility = 1.8dependencies {compile 'org.springframework.boot:spring-boot-starter-actuator' compile' org.springframework.boot:spring-boot-starter- Web' compile 'org.springframework.boot:spring-boot-devtools' compile' org.springframework.boot:spring-boot-starter-data-jpa' compile 'com.h3database:h3:1.4.199' compile' org.apache.tomcat:tomcat-jdbc:9.0.21' compile 'org.postgresql:postgresql:42.2.5' compile' org.springframework.boot:spring-boot-starter-security' testCompile 'org.springframework.boot:spring- Boot-starter-test' testCompile 'io.rest-assured:rest-assured:4.0.0' testCompile' org.springframework.security:spring-security-test'}

Build again or fail:

Ydx@ydx-PC:$ gradle build

Picked up _ JAVA_OPTIONS:-Dawt.useSystemAAFontSettings=gasp

> Task: backend:compileTestJava FAILED

/ home/ydx/Documents/Project/spring_boot/spring-boot-vuejs-master/backend/src/test/java/de/jonashackt/springbootvuejs/controller/BackendControllerTest.java:59: error: unable to access TypeRef

.body () .as (Long.class)

^

Cannot find the class file for io.restassured.common.mapper.TypeRef

1 error

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task': backend:compileTestJava'.

> Compilation failed; see the compiler error output for details.

Forget the back end and fiddle with the front-end project. Because the npm command is not called with gradle, it is executed directly:

Npm install

As a result, node-sass was not installed successfully-_-| |

Have to install it manually:

Cnpm install-save-dev node-sass

Execute after success:

Npm run serve

O (∩ _ ∩) O ha, successfully started.

Of course, only the front end is started, and the back end is still paralyzed% > _

Tags: Project success command or build front manual file error help run fit clear full body content again function just only for this Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Huawei NVidia macOS Xiaomi