Questions tagged [gradle-2]

A very flexible general purpose build tool written in Groovy.

  • A very flexible general purpose build tool like Ant.
  • Switchable, build-by-convention frameworks a la Maven. But we never lock you in!
  • Very powerful support for multi-project builds.
  • Very powerful dependency management (based on Apache Ivy).
  • Full support for your existing Maven or Ivy repository infrastructure.
  • Support for transitive dependency management without the need for remote repositories or pom.xml and ivy.xml files.
  • Ant tasks and builds as first class citizens.
  • Groovy build scripts.
  • A rich domain model for describing your build.
15 questions
4
votes
1 answer

How to maven-publish a Gradle project JAR with provided scope

Given a Gradle web project that is to be published as a JAR (so that it can be a dependency of another Gradle web project, which has a different release cycle). The maven-publish plugin is used: apply plugin: 'war' apply plugin: 'maven' apply…
Markus Pscheidt
  • 6,853
  • 5
  • 55
  • 76
3
votes
1 answer

android studio transformNative_libsWithStripDebugSymbolForDebug after gradle 2.2

i have strange problem and i know it is was written before but all solutions not worked :( Error:Execution failed for task ':app:transformNative_libsWithStripDebugSymbolForDebug'. java.lang.NullPointerException (no error message) it was debug…
Issac Nabil
  • 41
  • 1
  • 4
2
votes
1 answer

Gradle test task testReport task - Deprecated properties with Gradle 2.3 / Java7 or Java8

I am trying my project to change from java7 to java8. So i made changes to existing gradle extra.commons-myp.gradle script that i used for gradle 1.6. I made change of complie to JavaCompile as it is deprecated after 2.0. I get error at test…
Srivignesh
  • 21
  • 1
  • 4
2
votes
1 answer

How do you add a source set to a Java project in gradle 2.1?

How do you add a source set to a Java project in gradle 2.1? I've read the docs on the Java Plugin and SourceSetOutput and a few other SO threads and I'm still struggling to figure out how it works. I created a simple build script to test my…
Jeffrey Guenther
  • 871
  • 10
  • 27
1
vote
1 answer

How to speed up slow fatJAR task?

The following part is a part of my build.gradle file: project(":App") { dependencies { compile(project(':Shared')) compile(project(':Subproject1')) compile(project(':Subproject2')) …
MartyIX
  • 27,828
  • 29
  • 136
  • 207
1
vote
2 answers

Gradle test task - Gradle 1.6 and with Gradle 2.3 or later

I have a Java project. PS: In my project, I don't have any java program/source code in src/test/java. - This folder just contains a blank.txt file. I have two different Gradle versions: Gradle 1.6 with Java 7 (as Java 8 is NOT compatible with…
AKS
  • 16,482
  • 43
  • 166
  • 258
1
vote
1 answer

Pass command line arguments to gradle

To start Java program, I can pass arguments like: java Main arg1 arg2 arg3 What are the good ways to do that in gradle command line: gradle startProgram arg1 arg2 arg3 And this is in build.gradle: task startProgram(dependsOn: 'classes', type:…
evanwong
  • 5,054
  • 3
  • 31
  • 44
0
votes
1 answer

Cannot upgrade gradle wrapper from version 2.1 to 6.5.1

I have an old project with Gradle 2.1. Today I want to "upgrade" the gradle wrapper version to 6.5.1, so I used this: ./gradlew wrapper --gradle-version 6.5.1 But the output is: FAILURE: Build failed with an exception. * What went wrong: Problem…
Andiana
  • 1,912
  • 5
  • 37
  • 73
0
votes
1 answer

How to fix this (presumably) encoding-related error (Java, Gradle)?

I have the following method, which truncates a string to a certain size in bytes: public class Utils { public static String trimStringToBytesSize(String s, int length) { if (s == null || length < 0) return null; int trimLength =…
Glory to Russia
  • 17,289
  • 56
  • 182
  • 325
0
votes
0 answers

Best way to configure a allprojects Gradle task from the project it run on?

In the root build.gradle we are creating a task under allprojects that should run before the build of the project that is running the task. // root build apply plugin: 'cpp' all projects { task.whenTaskAdded {theTask -> if (theTask.name ==…
Michael Hobbs
  • 1,663
  • 1
  • 15
  • 26
0
votes
1 answer

Gradle myCustomTask - How to avoid calling dependents tasks by passing command line arguments

I have a custom task in Gradle (2.3) task myCustomTask (dependsOn: [ jacocoTestReport ]) << { //Adding this didn't work, gives an error that options is not a property. //options.compilerArgs = ["-x compileJava -x classes -x test -x…
AKS
  • 16,482
  • 43
  • 166
  • 258
0
votes
1 answer

Sonar Unit tests report parameter - sonar.junit.reportPath vs sonar.java.junit.reportPath

I found that my Sonar instance 5.1 or 5.1.1 (with latest sonar-runner 2.x) stopped showing part of the Unit test info (Unit test widget) on the project's dashboard. The properties I had were (in Gradle's sonarRunner > sonarProperties section): …
AKS
  • 16,482
  • 43
  • 166
  • 258
0
votes
2 answers

Gradle - Download all version jars of a single groupID:artifactID from Artifactory

I use Gradle to build a project (Java). Gradle 2.3, Java7/8. Works great. To build a project, we define what all libraries we need during compile, test (testRuntime) and runtime stages and we define all those libraries in dependencies section…
AKS
  • 16,482
  • 43
  • 166
  • 258
0
votes
2 answers

Connect SonarQube (4.5.4 ) with Gradle (2.1) throws HTTP 400

I want to connect Gradle (Version 2.1) with SonarQube (4.5.4 LTS), but there is this Exception FAILURE: Build failed with an exception. * What went wrong: Execution failed for task '::sonarAnalyze'. > java.io.IOException: Server returned…
0
votes
1 answer

Checking inputs before running dependent tasks

I've got a Ant build script which I need to compile part of my project (it links into a third-party build system for the JavaScript libraries we use). I want to wrap Gradle around this, so I've imported the Ant build, and I can successfully invoke…
Robert Watkins
  • 2,196
  • 15
  • 17