gradle

Gradle custom plugin jar with dependencies

末鹿安然 提交于 2020-05-29 10:59:07
问题 I'm trying to build a jar for a custom gradle plugin to be used by other gradle projects. I'm using java to write the plugin. I'm having a problem including dependencies in my jar. If I build the jar using the below build.gradle plugins { id 'groovy' } repositories{ mavenCentral() } dependencies { compile gradleApi() compile localGroovy() compile 'com.google.guava:guava:27.0-jre' testCompile 'junit:junit:4.12' //compile 'org.apache.commons:commons-lang3:3.8.1' } group = 'com.mine' version =

How to embed Java code into Gradle build using JavaExec task

时光总嘲笑我的痴心妄想 提交于 2020-05-29 07:29:49
问题 I have a Gradle-driven project to which I want to add a simple Java task. This task is very specific to the project and if it can be helped I don't want to develop it as a separate plugin. So the question is can I define such custom task within the same build.gradle I'm using for my project? Or is it inevitable that I need to package it as a separate project (plugin) and install to the local repo? Also it's probably important to note that the original project is not Java related (no other

How to make an equivalent of 'compileOnly' for AAR artifacts?

拥有回忆 提交于 2020-05-29 07:22:34
问题 In real world, if you're writing ui tests for android project, after press 'Run' from Android Studio, it will assemble two apps: 'your.cool.app' and 'your.cool.app.test'. Test app will have in android manifest something like: <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" android:targetPackage="your.cool.app"/> Which actually will be mean, that if you install them both, your test app will be merged with a real one - all dependencies (third-party libs etc..) will be in

Flutter App stuck at “Running Gradle task 'assembleDebug'… ”

試著忘記壹切 提交于 2020-05-28 12:00:50
问题 When I run the app it get stuck Launching lib\main.dart on Lenovo A319 in debug mode... Running Gradle task 'assembleDebug'... (This is taking an unexpectedly long time.) It never initialize Gradle nor the dependencies 回答1: In my case, Windows Firewall was causing this problem. After I disabled it temporarily the problem was gone. Worth giving it a try. Good luck! 回答2: Here is solution in my case. Delete gradle folder in home directory ~/.gradle (optional) Open your flutter Project directory.

Issues trying to mod minecraft 1.12.2 with forge. Cannot wrap and test build

那年仲夏 提交于 2020-05-28 06:06:21
问题 I cannot get a test build to run at all from eclipse. I am running on windows 10 with java openjdk version "1.8.0_242" I've followed various tutorials step-by-step, but keep getting this error. I've also tried running a fresh build that I haven't edited at all and it seems to crash with the same issue. Latest crash log. [13:36:53] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/nebbu/.gradle/caches/minecraft/assets, --assetIndex, 1.12, -

Include jar file with Java sources in Android aar

别等时光非礼了梦想. 提交于 2020-05-27 06:46:27
问题 I have a gradle task to create a jar file containing Java source files to be included in an Android aar library package. These files will serve as Javadoc for JNI to a C++ library also bundled in the aar package. I cannot possibly figure out how to include the jar file and not compile the files within. it seems that the Java files in the jar file are compiled , which does not help me - I just want to include them so that they are available to developers using that aar package. The created jar

Android studio 3.6.1 build issue

拥有回忆 提交于 2020-05-27 04:25:48
问题 I have just updated android studio 3.6.1 . after this update, I updated all plugins. Now Gradle syncing is failed. Please check the below errors. Caused by: org.gradle.tooling.BuildException: Failed to process C:\user\app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar\debug\R.jar Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing. Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\app\build

Use local jar as a dependency in my Gradle Java project

故事扮演 提交于 2020-05-26 10:52:11
问题 I have a local jar file named mylib.jar . I want to used it as a dependency in my Gradle Java project. This is what I tried: I created a libs/ folder under project root. I put the jar file under libs/ folder. MyProject ->libs/mylib.jar ->build.gradle ->src/... In my build.gradle: apply plugin: 'java-library' group 'com.my.app' version '1.0-SNAPSHOT' sourceCompatibility = 1.8 repositories { mavenCentral() flatDir { dirs 'libs' } } dependencies { testCompile group: 'junit', name: 'junit',

Cannot access spring boot application after deployment in tomcat

最后都变了- 提交于 2020-05-26 04:59:50
问题 I have created a REST API using Spring boot. I am using gradle as my build tool. I have tested the application using the embedded container and it is working fine. I am able to access my application at localhost:8080/foo/bar . Now I have deployed it to tomcat without any error. Mar 17, 2016 1:58:47 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive /usr/local/apache-tomcat-7.0.65/webapps/foo.war Mar 17, 2016 1:58:48 PM org.apache.catalina.startup

Cannot access spring boot application after deployment in tomcat

我与影子孤独终老i 提交于 2020-05-26 04:59:07
问题 I have created a REST API using Spring boot. I am using gradle as my build tool. I have tested the application using the embedded container and it is working fine. I am able to access my application at localhost:8080/foo/bar . Now I have deployed it to tomcat without any error. Mar 17, 2016 1:58:47 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive /usr/local/apache-tomcat-7.0.65/webapps/foo.war Mar 17, 2016 1:58:48 PM org.apache.catalina.startup