点击查看详情
| |
| |
| GRADLE_HOME = C:\Program Files\gradle-7.6 |
| GRADLE_USER_HOME = C:\Users\ychen\.gradle |
| PATH = %GRADLE_HOME%\bin |
| |
| |
| # 在init.d 文件夹创建init.gradle 文件 |
| allprojects { |
| repositories { |
| mavenLocal() |
| maven { name "Alibaba" ; url "https://maven.aliyun.com/repository/public" } |
| maven { name "Bstek" ; url "https://nexus.bsdn.org/content/groups/public/" } |
| mavenCentral() |
| } |
| |
| buildscript { |
| repositories { |
| maven { name "Alibaba" ; url 'https: |
| maven { name "Bstek" ; url 'https: |
| maven { name "M2" ; url 'https: |
| } |
| } |
| } |
| |
| # 需要配置M2_HOME |

点击查看详情
| .gradle |
| .gitattributes |
| gradlew |
| gradlew.bat |


点击查看详情
| |
| plugins { |
| id 'org.springframework.boot' version '2.3.7.RELEASE' |
| id 'io.spring.dependency-management' version '1.0.10.RELEASE' |
| id 'java' |
| } |
| |
| |
| buildscript { |
| repositories { |
| maven { url 'https://maven.aliyun.com/repository/public' } |
| } |
| dependencies { |
| classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.4.1' // 只需在这里指定1个版本号即可 |
| } |
| } |
| |
| apply plugin: 'org.springframework.boot' |
| apply plugin: 'io.spring.dependency-management' |
点击查看详情
| |
| dependencies { |
| // spring-boot-starter-web |
| implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.6.1' |
| // spring-boot-devtools |
| implementation group: 'org.springframework.boot', name: 'spring-boot-devtools', version: '2.6.1' |
| // spring-boot-starter-test |
| testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.6.1' |
| // spring-boot-configuration-processor |
| implementation group: 'org.springframework.boot', name: 'spring-boot-configuration-processor', version: '2.6.1' |
| // lombok |
| implementation 'org.projectlombok:lombok:1.18.8' |
| annotationProcessor 'org.projectlombok:lombok:1.18.8' |
| // 使用junit5 |
| testImplementation("org.junit.jupiter:junit-jupiter-api:5.1.0") |
| testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.1.0") |
| } |
| |
| test { |
| useJUnitPlatform() |
| } |
| |
| |
| server: |
| port: 8080 |
| error: |
| whitelabel: |
| enabled: true |
| spring: |
| application: |
| name: app |
| messages: |
| basename: messages |
| encoding: UTF-8 |
| devtools: |
| restart: |
| enabled: true |
| logging: |
| level: |
| com: |
| example: DEBUG |
| org: |
| springframework: |
| security: DEBUG |
| pattern: |
| console: '%clr(%d{E HH:mm:ss.SSS}){blue} %clr(%-5p) %clr(${PID}){faint} %clr(---){faint} |
| %clr([%8.15t]){cyan} %clr(%-40.40logger{0}){blue} %clr(:){red} %clr(%m){faint}%n' |
点击查看详情

- 使用java -jar启动报错
jar中没有主清单属性
时
- 使用如下方式打包


点击查看详情
| plugins { |
| id 'java' |
| id 'maven-publish' |
| } |
| |
| publishing { |
| publications { |
| maven(MavenPublication) { |
| groupId = 'com.ychen.demo' |
| artifactId = 'demo' |
| version = '1.1-SNAPSHOT' |
| from components.java |
| } |
| } |
| repositories { |
| maven { |
| allowInsecureProtocol = true |
| url "http://xxx.xxx.xxx.xxx:8081/repository/maven-snapshots/" |
| credentials { |
| username 'admin' |
| password 'admin' |
| } |
| } |
| } |
| } |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?