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

Question: Configuring the plugin from init script #429

Open
jgracindexcom opened this issue Oct 27, 2021 · 0 comments
Open

Question: Configuring the plugin from init script #429

jgracindexcom opened this issue Oct 27, 2021 · 0 comments
Labels

Comments

@jgracindexcom
Copy link

Hi!

Sorry if this is not the right place to ask questions but I couldn't find a better one.

I wanted to centralize the Axion configuration and have my Jenkins add Axion configuration so that I don't have to maintain the configuration of the plugin in every one of my projects. I used the following content as the initscript which I pass with gradle -I<initscript> release && gradle -I<initscript> publish (I use maven-publish):

initscript {
    repositories {
        jcenter()
        maven { url "https://plugins.gradle.org/m2/" }
    }

    dependencies {
        classpath group: 'pl.allegro.tech.build', name: 'axion-release-plugin', version: '1.13.5'
    }
}
allprojects {
    apply plugin: pl.allegro.tech.build.axion.release.ReleasePlugin
    scmVersion {
        tag {
            prefix = 'v'
        }
    }
    project.version = scmVersion.version
}

However, this does not work with maven-publish plugin if the build.gradle file contains explicit version (e.g. version '1.0.0-SNAPSHOT'). I suppose this is because the initscript gets executed before the version line in build.gradle which overrides it.

Is there any way to do this, i.e. have a separate axion.gradle file that I can use in addition to the standard build.gradle from Jenkins?

Thanks!

@bgalek bgalek added the question label May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants