How to declare gradle version 5.0 in build.gradle?












1















I used task wrapper when Gradle was 4.x but when I change gradleVersion to 5.0 , gradle wrapper states that it can't add a task with the same name. This didn't happen when it was 4.x when I could just change from 4.8 to 4.9 without issues. Does Gradle changed how task wrapper works?










share|improve this question

























  • The only clue that I've found is wrapper { distributionType = Wrapper.DistributionType.ALL }

    – Arkyo
    Nov 28 '18 at 14:27
















1















I used task wrapper when Gradle was 4.x but when I change gradleVersion to 5.0 , gradle wrapper states that it can't add a task with the same name. This didn't happen when it was 4.x when I could just change from 4.8 to 4.9 without issues. Does Gradle changed how task wrapper works?










share|improve this question

























  • The only clue that I've found is wrapper { distributionType = Wrapper.DistributionType.ALL }

    – Arkyo
    Nov 28 '18 at 14:27














1












1








1








I used task wrapper when Gradle was 4.x but when I change gradleVersion to 5.0 , gradle wrapper states that it can't add a task with the same name. This didn't happen when it was 4.x when I could just change from 4.8 to 4.9 without issues. Does Gradle changed how task wrapper works?










share|improve this question
















I used task wrapper when Gradle was 4.x but when I change gradleVersion to 5.0 , gradle wrapper states that it can't add a task with the same name. This didn't happen when it was 4.x when I could just change from 4.8 to 4.9 without issues. Does Gradle changed how task wrapper works?







gradle build.gradle






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 29 '18 at 13:37









M.Ricciuti

3,7102420




3,7102420










asked Nov 28 '18 at 14:14









ArkyoArkyo

247




247













  • The only clue that I've found is wrapper { distributionType = Wrapper.DistributionType.ALL }

    – Arkyo
    Nov 28 '18 at 14:27



















  • The only clue that I've found is wrapper { distributionType = Wrapper.DistributionType.ALL }

    – Arkyo
    Nov 28 '18 at 14:27

















The only clue that I've found is wrapper { distributionType = Wrapper.DistributionType.ALL }

– Arkyo
Nov 28 '18 at 14:27





The only clue that I've found is wrapper { distributionType = Wrapper.DistributionType.ALL }

– Arkyo
Nov 28 '18 at 14:27












1 Answer
1






active

oldest

votes


















5














Defining a custom wrapper task in your build script has been deprecated since Gradle 4.8 version, see Gradle 4.8 depreciations (section Overwriting Gradle's built-in tasks" section)



Since version 4.8 (and before 5.0) you should have a warning message as below if you still define a custom wrapper task:




$ ./gradlew clean --warning-mode all



> Configure project :



Creating a custom task named 'wrapper' has been deprecated and is scheduled to be removed in Gradle 5.0.



You can configure the existing task using the
'wrapper { }' syntax or create your custom task under a different
name.'.




As announced, the support for custom wrapper task has been removed in Gradle 5.0, so you need to use the new way for configuring the Wrapper:



// Configuring the wrapper, the old way (gradle < 4.8 )
// see https://docs.gradle.org/4.4/userguide/gradle_wrapper.html#sec:wrapper_generation
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionType = Wrapper.DistributionType.BIN
}

// Configuring the wrapper, the new way (since Gradle 4.8)
// see https://docs.gradle.org/current/userguide/gradle_wrapper.html#customizing_wrapper
wrapper{
gradleVersion = '5.1'
distributionType = Wrapper.DistributionType.BIN
}





share|improve this answer


























  • gradleVersion = 4.9 should be gradleVersion = '4.9'

    – Galley
    Jan 7 at 9:52













  • You're right, tks. I updated.

    – M.Ricciuti
    Jan 18 at 14:30











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53521437%2fhow-to-declare-gradle-version-5-0-in-build-gradle%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









5














Defining a custom wrapper task in your build script has been deprecated since Gradle 4.8 version, see Gradle 4.8 depreciations (section Overwriting Gradle's built-in tasks" section)



Since version 4.8 (and before 5.0) you should have a warning message as below if you still define a custom wrapper task:




$ ./gradlew clean --warning-mode all



> Configure project :



Creating a custom task named 'wrapper' has been deprecated and is scheduled to be removed in Gradle 5.0.



You can configure the existing task using the
'wrapper { }' syntax or create your custom task under a different
name.'.




As announced, the support for custom wrapper task has been removed in Gradle 5.0, so you need to use the new way for configuring the Wrapper:



// Configuring the wrapper, the old way (gradle < 4.8 )
// see https://docs.gradle.org/4.4/userguide/gradle_wrapper.html#sec:wrapper_generation
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionType = Wrapper.DistributionType.BIN
}

// Configuring the wrapper, the new way (since Gradle 4.8)
// see https://docs.gradle.org/current/userguide/gradle_wrapper.html#customizing_wrapper
wrapper{
gradleVersion = '5.1'
distributionType = Wrapper.DistributionType.BIN
}





share|improve this answer


























  • gradleVersion = 4.9 should be gradleVersion = '4.9'

    – Galley
    Jan 7 at 9:52













  • You're right, tks. I updated.

    – M.Ricciuti
    Jan 18 at 14:30
















5














Defining a custom wrapper task in your build script has been deprecated since Gradle 4.8 version, see Gradle 4.8 depreciations (section Overwriting Gradle's built-in tasks" section)



Since version 4.8 (and before 5.0) you should have a warning message as below if you still define a custom wrapper task:




$ ./gradlew clean --warning-mode all



> Configure project :



Creating a custom task named 'wrapper' has been deprecated and is scheduled to be removed in Gradle 5.0.



You can configure the existing task using the
'wrapper { }' syntax or create your custom task under a different
name.'.




As announced, the support for custom wrapper task has been removed in Gradle 5.0, so you need to use the new way for configuring the Wrapper:



// Configuring the wrapper, the old way (gradle < 4.8 )
// see https://docs.gradle.org/4.4/userguide/gradle_wrapper.html#sec:wrapper_generation
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionType = Wrapper.DistributionType.BIN
}

// Configuring the wrapper, the new way (since Gradle 4.8)
// see https://docs.gradle.org/current/userguide/gradle_wrapper.html#customizing_wrapper
wrapper{
gradleVersion = '5.1'
distributionType = Wrapper.DistributionType.BIN
}





share|improve this answer


























  • gradleVersion = 4.9 should be gradleVersion = '4.9'

    – Galley
    Jan 7 at 9:52













  • You're right, tks. I updated.

    – M.Ricciuti
    Jan 18 at 14:30














5












5








5







Defining a custom wrapper task in your build script has been deprecated since Gradle 4.8 version, see Gradle 4.8 depreciations (section Overwriting Gradle's built-in tasks" section)



Since version 4.8 (and before 5.0) you should have a warning message as below if you still define a custom wrapper task:




$ ./gradlew clean --warning-mode all



> Configure project :



Creating a custom task named 'wrapper' has been deprecated and is scheduled to be removed in Gradle 5.0.



You can configure the existing task using the
'wrapper { }' syntax or create your custom task under a different
name.'.




As announced, the support for custom wrapper task has been removed in Gradle 5.0, so you need to use the new way for configuring the Wrapper:



// Configuring the wrapper, the old way (gradle < 4.8 )
// see https://docs.gradle.org/4.4/userguide/gradle_wrapper.html#sec:wrapper_generation
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionType = Wrapper.DistributionType.BIN
}

// Configuring the wrapper, the new way (since Gradle 4.8)
// see https://docs.gradle.org/current/userguide/gradle_wrapper.html#customizing_wrapper
wrapper{
gradleVersion = '5.1'
distributionType = Wrapper.DistributionType.BIN
}





share|improve this answer















Defining a custom wrapper task in your build script has been deprecated since Gradle 4.8 version, see Gradle 4.8 depreciations (section Overwriting Gradle's built-in tasks" section)



Since version 4.8 (and before 5.0) you should have a warning message as below if you still define a custom wrapper task:




$ ./gradlew clean --warning-mode all



> Configure project :



Creating a custom task named 'wrapper' has been deprecated and is scheduled to be removed in Gradle 5.0.



You can configure the existing task using the
'wrapper { }' syntax or create your custom task under a different
name.'.




As announced, the support for custom wrapper task has been removed in Gradle 5.0, so you need to use the new way for configuring the Wrapper:



// Configuring the wrapper, the old way (gradle < 4.8 )
// see https://docs.gradle.org/4.4/userguide/gradle_wrapper.html#sec:wrapper_generation
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionType = Wrapper.DistributionType.BIN
}

// Configuring the wrapper, the new way (since Gradle 4.8)
// see https://docs.gradle.org/current/userguide/gradle_wrapper.html#customizing_wrapper
wrapper{
gradleVersion = '5.1'
distributionType = Wrapper.DistributionType.BIN
}






share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 18 at 14:30

























answered Nov 29 '18 at 13:34









M.RicciutiM.Ricciuti

3,7102420




3,7102420













  • gradleVersion = 4.9 should be gradleVersion = '4.9'

    – Galley
    Jan 7 at 9:52













  • You're right, tks. I updated.

    – M.Ricciuti
    Jan 18 at 14:30



















  • gradleVersion = 4.9 should be gradleVersion = '4.9'

    – Galley
    Jan 7 at 9:52













  • You're right, tks. I updated.

    – M.Ricciuti
    Jan 18 at 14:30

















gradleVersion = 4.9 should be gradleVersion = '4.9'

– Galley
Jan 7 at 9:52







gradleVersion = 4.9 should be gradleVersion = '4.9'

– Galley
Jan 7 at 9:52















You're right, tks. I updated.

– M.Ricciuti
Jan 18 at 14:30





You're right, tks. I updated.

– M.Ricciuti
Jan 18 at 14:30




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53521437%2fhow-to-declare-gradle-version-5-0-in-build-gradle%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)