allure-gradle icon indicating copy to clipboard operation
allure-gradle copied to clipboard

Download Allure distribution as gradle dependency cache

Open lukasito opened this issue 6 years ago • 3 comments
trafficstars

I'm submitting a ...

  • [ ] bug report
  • [x] feature request
  • [ ] support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Currently, allure-gradle plugin downloads allure distribution to .allure in project root of each project.

What is the expected behavior?

allure-gradle plugin should create a gradle configuration which will contain allure binaries as dependency, so it will be handled by gradle dependency cache instead.
Then configuration can be used to build a classpath for executing allureReport task as JavaExec process.

This requires allure distribution to be a published artifact as runnable jar.

What is the motivation / use case for changing the behavior?

to avoid duplicate downloads (~17mb) in each project. Instead allure distribution should be in gradle dependency cache (local gradle repo)

Please tell us about your environment:

Allure version 2.8.1
allure-gradle 2.8.1
Gradle 5.5.1

lukasito avatar Jul 15 '19 10:07 lukasito

We have a privately hosted repository which mirrors maven-central. And we would like to use it for downloading allure's package. Currently this is impossible as you cannot supply basic authentication for the download (as previously reported in a comment: https://github.com/allure-framework/allure2/issues/832#issuecomment-425851545).

If allure would leverage gradle's functionality for downloading packages, our use case would be supported as well.

NielsDoucet avatar Mar 04 '20 13:03 NielsDoucet

This PR leverages Gradle dependency resolution for allure-commandline download: https://github.com/allure-framework/allure-gradle/pull/61 So both dependency cahcing and dependency verification would work.

Please feel free to try it and provide feedback

vlsi avatar Apr 27 '21 15:04 vlsi

Hi,

I stumbled over this thread facing the same problem that I want to use a maven proxy and try to avoid using a http proxy. Somehow I found myself unable to configure the download extension because it seems not to be available during configuration phase. In the end nothing works for me so I configured my build the following way and it works like a charm.

plugins {
  id 'java'
  id 'io.qameta.allure' version '2.8.1'
}

repositories {
  maven {
    url 'https://maven.example.com/proxy'
  }
}

configurations {
  allureCommandline
}

dependencies {
    allureCommandline group: "io.qameta.allure", name: "allure-commandline", version: "2.14.0", ext: "zip"
}

task getAllure(type: Copy)  {
  from zipTree(configurations.allureCommandline.singleFile)
  into "${rootDir}/.allure"
  doLast {
    downloadAllure.enabled = false
  }
}

test.finalizedBy('getAllure')
getAllure.finalizedBy('allureReport')

Just want to share this in case someone else run into the same trouble...

Would be nice if this is the standard behaviour. Anyways, @vlsi thanks for this great plugin.

BR

marcel-richter avatar Sep 02 '21 09:09 marcel-richter

Implemented in #61

vlsi avatar Sep 14 '22 20:09 vlsi