Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining location of Maven with JFrogMaven@1? #484

Open
JWATSU opened this issue Feb 27, 2024 · 2 comments
Open

Defining location of Maven with JFrogMaven@1? #484

JWATSU opened this issue Feb 27, 2024 · 2 comments
Labels
question Further information is requested

Comments

@JWATSU
Copy link

JWATSU commented Feb 27, 2024

With the Maven@4 task we have these settings available:
mavenDirectory
mavenVersionOption

Can I do the equivalent of that using JFrogMaven@1? There are ones for pointing out the location of Java (javaHomeOption, jdkDirectory) but I can't find any for Maven. A workaround is to set the M2_HOME variable on the self-hosted agent running the pipeline, but I want to do it in the pipeline itself if possible.

Thanks!

@JWATSU JWATSU added the question Further information is requested label Feb 27, 2024
@JWATSU
Copy link
Author

JWATSU commented Feb 28, 2024

A workaround is to set the env for the task itself. Example:

  • task: JFrogMaven@1
    inputs:
    mavenPomFile: '$(Agent.BuildDirectory)/s/modules/pom.xml'
    goals: 'clean install'
    options: -s $(Agent.BuildDirectory)/s/maven.settings/src/main/resources/settings.xml
    artifactoryDeployService: 'Artifactory'
    targetDeployReleaseRepo: 'project-release'
    targetDeploySnapshotRepo: 'project-snapshot'
    javaHomeOption: 'Path'
    jdkDirectory: '/data/azuredevops/tools/java/java-11'
    env:
    M2_HOME: $(maven-3.9.x)

@JWATSU JWATSU closed this as completed Feb 28, 2024
@JWATSU JWATSU reopened this Feb 28, 2024
@cb645j
Copy link

cb645j commented Feb 29, 2024

i use a scrip task to set it in the pipeline itself.

  • script: |
    export M2_HOME=/opt/apache-maven-3.9.6/
    export MAVEN_HOME=/opt/apache-maven-3.9.6/
    export PATH=${M2_HOME}/bin:${PATH}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants