gradle

Exclude parent project dependencies from child project classpath

独自空忆成欢 提交于 2021-01-04 09:10:09
问题 I have parent project that defines dependency on some local libraries for all its child projects: subprojects { dependencies { compile fileTree(dir: '../somelib', include: '*.jar') } } Can I exclude some jars (or even whole library folder) from parent's dependencies in child project without touching parent build.gradle ? 回答1: Maybe this helps you. Add this in your child's project build.gradle configurations { all.collect { configuration -> configuration.exclude group: 'org.springframework.ws'

How to generate, compile, jar, and depend on a gradle module

人走茶凉 提交于 2021-01-03 16:08:03
问题 I have a Java Gradle project that uses an OpenAPI specified API. I've used the org.openapi.generator plugin which generates sources as well as a complete Gradle module. I expect that there's a way to define the generate, compile, jar steps such that I can have other modules depend on the generated module. I.e. # api/build.gradle: plugins { id 'java' id "org.openapi.generator" version "5.0.0" } repositories { mavenCentral() } dependencies { testImplementation group: 'junit', name: 'junit',

How to generate, compile, jar, and depend on a gradle module

做~自己de王妃 提交于 2021-01-03 15:59:50
问题 I have a Java Gradle project that uses an OpenAPI specified API. I've used the org.openapi.generator plugin which generates sources as well as a complete Gradle module. I expect that there's a way to define the generate, compile, jar steps such that I can have other modules depend on the generated module. I.e. # api/build.gradle: plugins { id 'java' id "org.openapi.generator" version "5.0.0" } repositories { mavenCentral() } dependencies { testImplementation group: 'junit', name: 'junit',

How to generate, compile, jar, and depend on a gradle module

瘦欲@ 提交于 2021-01-03 15:58:30
问题 I have a Java Gradle project that uses an OpenAPI specified API. I've used the org.openapi.generator plugin which generates sources as well as a complete Gradle module. I expect that there's a way to define the generate, compile, jar steps such that I can have other modules depend on the generated module. I.e. # api/build.gradle: plugins { id 'java' id "org.openapi.generator" version "5.0.0" } repositories { mavenCentral() } dependencies { testImplementation group: 'junit', name: 'junit',

How to declare common dependencies in multimodule gradle project on parent folder

放肆的年华 提交于 2021-01-03 07:12:10
问题 I've multi-module gradle project. Let's say project parent has modules module1 and module2 . I have included both the modules in settings.gradle in the parent project as well. When I declare the common dependencies in build.gradle of parent project, both the project is not compiling but when I add the dependencies in build.gradle of each module then the modules are compiling successfully. Any Idea how can I do this. 回答1: You can declare dependencies for all modules in your project using the

How to avoid AWS SAM rebuild and reupload a gradle function with unchanged code?

ぐ巨炮叔叔 提交于 2021-01-02 20:30:09
问题 I'm developing an application with micronaut using SAM CLI to deploy it on AWS Lambda. As I was including dependencies and developing new features, the function packages got bigger an bigger (now they are around 250MB). This makes deployment take a while. On top of that every time I edit template.yaml and then run sam build && sam deploy to try a new configuration on S3, RDS, etc... I have to wait for gradle to build the function again (even though it's unchanged since the last deployment)

Java9 modules (Jigsaw)模块化迁移

不打扰是莪最后的温柔 提交于 2021-01-02 13:27:00
要点 通过模块化的方式开发应用程序,实现更好的设计,如关注点分离和封装性。 通过Java平台模块化系统(JPMS),开发者可以定义他们的应用程序模块,决定其他模块如何调用他们的模块,以及他们的模块如何依赖其他模块。 对于已经使用了其他模块系统(如Maven或Gradle)的应用程序来说,还是有可能再加入JPMS。 JDK为开发者提供了一些工具,用于将现有的代码迁移到JPMS。 应用程序代码仍然可以依赖Java 9之前的类库,这些类库的jar包被看成是一种特别的“自动化”模块,从而简化了向Java 9迁移的工作。 这篇文章提供了一个学习案例,演示一个真实的应用程序需要做出哪些变更才能迁移到JPMS。当然,要使用Java 9不一定要做这些事情,不过对于Java开发者来说,了解模块化系统(通过被叫作Jigsaw)无疑是一个非常重要的技能。 我将会演示如何一步步地使用新的Java模块化系统来重构一个基于Java 8的应用程序。 下载Java 9 首先要下载和安装最新版本的JDK 9,目前只有抢先预览版(这里使用的是9-ea+176版本)。在全面了解Java 9之前,你可能不希望把它作为系统的默认Java版本。所以,你可以不改变原先的 $JAVA_HOME 环境变量,而是创建一个新的变量 $JAVA9_HOME ,并把它指向新安装的JDK目录。我将在这篇文章里使用这个新变量。

Configure gradle build to suppress javadoc console warnings

笑着哭i 提交于 2021-01-02 12:49:20
问题 I'm configuring a gradle build using gradle's javadoc plugin. I was able to stop the build from failing on account of javadoc lint errors, but there are still hundreds of lines of console output for those lint errors that I don't care about. Any ideas how to suppress these console messages related to linting? Example output that I'm talking about (but screens and screens full): /home/user/projects/my-project/src/main/java/my/package/MyObject.java:89: warning: no description for @param *

No virtual method verifyPhoneNumber, FATAL EXCEPTION: main

孤街醉人 提交于 2021-01-02 06:08:11
问题 After updating the libraries into the Gradle file, I run into this error after trying to authenticate through the phone number. --------- beginning of crash 2020-11-04 00:33:11.574 23042-23042/com.roko.hearth E/AndroidRuntime: FATAL EXCEPTION: main Process: com.roko.hearth, PID: 23042 java.lang.NoSuchMethodError: No virtual method verifyPhoneNumber(Ljava/lang/String;JLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/Executor;Lcom/google/firebase/auth/PhoneAuthProvider

“Unresolved reference: implementation” by using subprojects in kotlin-gradle

你离开我真会死。 提交于 2021-01-02 05:56:06
问题 I want to split my project into subprojects. The default gradle setting from the Intellij IDE is: import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { kotlin("jvm") version "1.3.50" } group = "project" version = "0.0.1-SNAPSHOT" repositories { mavenCentral() } dependencies { implementation(kotlin("stdlib-jdk8")) } tasks.withType<KotlinCompile> { kotlinOptions.jvmTarget = "1.8" } That setting compiles. ButI don't want repeat that code in every subproject. So I changed the build