jfrog / jfrog-azure-devops-extension

Apache License 2.0
46 stars 61 forks source link

Documentation regarding where to download the extractor is incorrect #477

Closed derekscp closed 4 months ago

derekscp commented 4 months ago

Describe the bug

In this section https://github.com/jfrog/jfrog-azure-devops-extension?tab=readme-ov-file#manual-installation of the README it says that to manually download the extractor jar dependency it should be downloaded at this location: $(Agent.ToolsDirectory)/_jf/.jfrog/dependencies/maven/2.x.x or $(Agent.ToolsDirectory)/_jf/.jfrog/dependencies/gradle/4.x.x

But when running the jf mvn or gradle task you will see that it tries to download the extractor dependency again. This is because the jf cli is checking a different location for the dependency.

This documentation should be fixed so that it is looking at ~/.jfrog or ${HOME}/.jfrog instead of $(Agent.ToolsDirectory)/_jf/.jfrog when indicating where to download the dependency.

Current behavior

Manually downloading the jar to the specified location in the README will still cause the JF CLI to download the jar again since it is looking at the ~/.jfrog/dependencies/maven/2.41.12/ location to see if the jar is there.

Reproduction steps

Manually download the jars to the location specified here:

When triggering the [JFrog Maven](https://github.com/jfrog/jfrog-azure-devops-extension?tab=readme-ov-file#jfrog-maven-task) task, JFrog CLI automatically downloads the Maven Extractor jar to the build agent the first time it's required. However, if your build agent does not have access to the internet, the build will fail when attempting to download the file. You'll therefore need to download and install it manually.

To install the Maven Extractor jar on an agent with no internet access:

Create the directory structure on your agent's file-system: $(Agent.ToolsDirectory)/_jf/.jfrog/dependencies/maven/2.x.x
Download the latest [build-info-extractor-maven3-2.x.x-uber.jar](https://search.maven.org/artifact/org.jfrog.buildinfo/build-info-extractor) and place it inside the "maven" directory you created.
Installing the Gradle Extractor
When triggering the [JFrog Gradle](https://github.com/jfrog/jfrog-azure-devops-extension?tab=readme-ov-file#jfrog-gradle-task) task, JFrog CLI automatically downloads the Gradle Extractor jar to the build agent the first time it's required. However, if your build agent does not have access to the internet, the build will fail when attempting to download the file. You'll therefore need to download and install it manually.

To install the Gradle Extractor jar on an agent with no internet access:

Create the directory structure on your agent's file-system: $(Agent.ToolsDirectory)/_jf/.jfrog/dependencies/gradle/4.x.x
Download the latest [build-info-extractor-gradle-4.x.x-uber.jar](https://plugins.gradle.org/plugin/com.jfrog.artifactory) and place it inside the "gradle" directory you created.

Observe that on a follow-up task the jf mvn call will not detect the dependency and try to download it again.

Expected behavior

Once you manually download the jar the jf cli should not try to download it again. The correct location to download the jar should be something like ~/.jfrog/dependencies/maven/2.x.x or ${HOME}/.jfrog/dependencies/maven/2.x.x as the jf cli is looking at it's home directory(JFROG_CLI_HOME_DIR) for the dependency, not the $(Agent.ToolsDirectory)/_jf.

Azure DevOps extension name and version

jfrog-azure-devops-extension/2.9.2

JFrog CLI version

2.52.10

Operating system type and version

n/a

JFrog Artifactory version (if relevant)

No response

JFrog Xray version (if relevant)

No response

JFrog Distribution version (if relevant)

No response

eyalbe4 commented 4 months ago

Fixed by https://github.com/jfrog/jfrog-azure-devops-extension/pull/478