ari / gradle-release-plugin Goto Github PK
View Code? Open in Web Editor NEWA modern release plugin for gradle
License: Apache License 2.0
A modern release plugin for gradle
License: Apache License 2.0
When I try to release under Windows 7x64 with following configuration:
release {
failOnSnapshotDependencies = true
allowLocalModifications = false
releaseDryRun = false
scm = 'git'
username = gitUser
password = gitPassword
}
I receive allways:
"Uncommited changes found in the source tree"
Of course, there are no changes :)
Is the logic hier:
def boolean hasLocalModifications() {
gitExec(['status', '--porcelain']) != ""
}
correct?
Hi,
Is there a way override the default value configured for the releaseDryRun extension property?
I can't find reference to such an override in the gradle forums, however it can be added to the extension implementation (i.e. reading project properties). eg:
http://gradle.1045684.n5.nabble.com/Extension-property-from-command-line-td5548804.html
I would be happy to implement if there isn't a preferred approach for this yet.
regards,
ben
So, my sample build.gradle looks as below:
apply plugin: 'rpm'
apply plugin: 'eclipse'
apply plugin: 'release'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.trigonic:gradle-rpm-plugin:1.1'
classpath 'au.com.ish.gradle:release:2.0'
}
}
subprojects {
release {
failOnSnapshotDependencies = true
allowLocalModifications = false
releaseDryRun = false
scm = 'git'
username = 'fred'
password = 'secret01'
}
version = release.projectVersion
}
task rpm(type: Rpm) {
//Pack rpm
}
When I do try to do a gradle release, I get the following error though:
"
$ gradle release
:release FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':release'.
Your value of scm = 'null' is invalid. Possible options are 'git' or 'svn'
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
"
The binary for 2.2.2 that was released to Bintray has a dependency on sqljet-1.1.8-SNAPSHOT which is not available through either Bintray or Maven Central. It's a pain to have to exclude the dependency and manually specify the dependency to sqljet-1.1.8. If anyone comes across this being unsure what to do about it, here is the workaround:
buildscript {
dependencies {
classpath 'org.tmatesoft.sqljet:sqljet:1.1.8'
classpath('au.com.ish.gradle:release:2.2.2') {
exclude group: 'org.tmatesoft.sqljet', module: 'sqljet'
}
}
}
I am trying to get a simple working example going with the plugin but i am experiencing an issue:
Could not resolve org.tmatesoft.sqljet:sqljet:1.1.8-SNAPSHOT.
> Unable to load Maven meta-data from http://maven.tmatesoft.com/content/repositories/releases/org/tmatesoft/sqljet/sqljet/1.1.8-SNAPSHOT/maven-metadata.xml.
> Could not GET 'http://maven.tmatesoft.com/content/repositories/releases/org/tmatesoft/sqljet/sqljet/1.1.8-SNAPSHOT/maven-metadata.xml'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
This is the build.gradle that i am using:
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url 'http://maven.tmatesoft.com/content/repositories/releases/'
}
}
dependencies {
classpath 'au.com.ish.gradle:release:2.2.2'
}
}
I have seen a close issue, but i am still facing the error
Homepage documentation should have:
maven {
url 'http://maven.tmatesoft.com/content/repositories/releases/'
}
instead of:
maven {
url 'http://maven.tmatesoft.com/content/repositories/snapshots/'
}
Hi,
Could not resolve all dependencies for configuration ':classpath'.
> Could not find org.tmatesoft.sqljet:sqljet:1.1.8-SNAPSHOT.
Required by:
:GradleFx:unspecified > au.com.ish.gradle:release:2.2.2 > org.tmatesoft
.svnkit:svnkit:1.8.0
This is what I get after invoking gradle tasks
when I have added this to my build.gradle
:
buildscript {
repositories {
mavenCentral()
maven {
url 'http://maven.tmatesoft.com/content/repositories/releases/'
}
}
dependencies {
classpath 'au.com.ish.gradle:release:2.2.2'
}
}
apply plugin: 'release'
Our project structure is simple...
root
--gradle.properties
--settings.gradle
--sub-module-1
----gradle.properties
--sub-module-2
----gradle.properties
--sub-module-3
----gradle.properties
The problem I am experiencing is that the build.gradle of sub-module 2 depends on sub-module-1 like this:
dependencies {
compile project(':sub-module-1')
}
When I run gradle clean release uploadArchives
I get this error:
:release FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':release'.
> Project contains SNAPSHOT dependencies: [my.group.id:sub-module-1:trunk-SNAPSHOT]
I want the build to fail if I have non-sub-module snapshot dependencies, so turning off failOnSnapshotDependencies is not really an option. I hope I am just missing something...
Here is how the release plugin is configured:
release {
failOnSnapshotDependencies = true
scm = 'svn'
}
and here is what my settings.gradle looks like:
rootProject.name = 'my-project'
include ':sub-module-2',
':sub-module-1',
':sub-module-3'
The plugin fails if a tag is checked out from git:
16:44:21.741 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command 'git''. Working directory: (...) Command: git symbolic-ref -q HEAD
16:44:21.768 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
16:44:21.768 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command 'git'' finished with exit value 1 (state: FAILED)
Is this supposed to work?
Hello
Have you considered existing release plugin(s)
For example this one - is quite usable
http://tellurianring.com/wiki/gradle/release
Does this plugin do some other job ?
Closing #20, #25 and #30 is nonsense.
At least you can say you won't fix it.
I am still having the same issue trying to use 2.2.2:
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve org.tmatesoft.sqljet:sqljet:1.1.8-SNAPSHOT.
Required by:
project : > au.com.ish.gradle:release:2.2.2 > org.tmatesoft.svnkit:svnkit:1.8.0
> Could not resolve org.tmatesoft.sqljet:sqljet:1.1.8-SNAPSHOT.
> Unable to load Maven meta-data from http://maven.tmatesoft.com/content/repositories/snapshots/org/tmatesoft/sqljet/sqljet/1.1.8-SNAPSHOT/maven-metadata.xml.
> Could not GET 'http://maven.tmatesoft.com/content/repositories/snapshots/org/tmatesoft/sqljet/sqljet/1.1.8-SNAPSHOT/maven-metadata.xml'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
FYI: @glennmcallister, @greenscar, @mb720, @mpas, @pkovalenko, @prokod, @Xerosigma
According to the documentation page, the following command is supposed to perform a full release:
gradle release uploadArchives -preleaseVersion=1.1.0
If you were to run this command from trunk, I would expect that that command would do the following:
However, it looks like the plugin simply creates the tag, so when you begin the uploadArchives task, you are still on the trunk, and so it is technically releasing the code from the trunk and not the tag. I know functionally there is no difference, but I fear it is a technicality that could cause us trouble with management if they found out.
Would it be possible to add in a switch (in svn-land, I do not know the corresponding git command) immediately following the tag command (inside of the SCMService.doTagging() method) so that after the tag is created, our workspace is actually sitting on the tag?
Hi,
I'm using a SVN client v1.7.10 (r1485443) on MacOS, against a server which is probably 1.6.x.
In my Gradle file, I get:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'au.com.ish.gradle:release:2.2.2'
classpath 'org.tmatesoft.svnkit:svnkit:1.8.3'
}
}
apply plugin: 'release'
release {
scm = 'svn'
}
When I run gradlew release
, I get the following error message:
svn: E155036: Working copy format of '...' is too old '29'
I was wondering what version of SVN did you support? Upgrading to a SVN 1.8 client is not possible yet because of the IDE we are using.
Thanks,
Damien.
I don't see it in central repos, yet the release was cut on github.
http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22au.com.ish.gradle%22%20AND%20a%3A%22release%22
Currently, the only way to override automatic version number guessing is to issue the following :
gradle release -PreleaseVersion=2.0.0-SNAPSHOT
It would be nice though, to pass just an alias of the version to bump (minor
, major
), for example:
gradle release -Pmajor
Would cause the 1.2.1
version to be bumped to 2.0.0
. And the following:
gradle release -Pminor
Would cause the 1.2.1
to be bumped to 1.3.0
.
This would be only applicable of course to version format of:
major.minor.build
Current version of SVNKit used can't work with SVN repos in legacy format (1.6 or 1.7).
It looks like a quick win to upgrade to SVNKit 1.8.12 which supports old-format working copies.
The pattern to determine the next tag version inSCMService is
private final def releaseTagPattern = ~/^(\S+)-REL-(\d+)$/
However the code in ReleasePlugin uses a slightly different pattern:
getSCMService().performTagging(getSCMService().getBranchName() + "-RELEASE-" + project.version, msg)
These two patterns should match. It would also be cool if that prefix could be configurable, with options like:
useSourceBranchInTag (would determine if you would put 'trunk-' at the beginning of the tag)
tagTextPrefix (would give you a place to put text that you would want pre-pended to the version number in the tag name e.g. RELEASE-)
tagTextSuffix (would give you a place to put text that you would want appended to the version number in the tag name e.g. -RELEASE)
These are just ideas, I can try and implement them if they sound ok to you.
release.scmVersion
is always returning abc
while using with GitHub.
expected git's commit# as release.scmVersion
value.
The documentation also not clear how release
command automatically guess the next available version number in case using with github.
Hi,
Is there any configuration/properties which i can change the path of the tags when i do a release on svn?
Thank you in advance
Hi,
I access our SVN repository over HTTPS, but unfortunately it seems that my credentials are not used when attempting to create the new tag.
I intend to use default authentication and therefore have not specified a username or password:
release {
scm = 'svn'
}
I think that http://issues.tmatesoft.com/issue/SVNKIT-457 has been triggered. SVNKit attempts to load credentials for the incorrect realm, and fails.
Unfortunately the SVNKit CLI doesn't seem to support forced authentication, and therefore I manually created an appropriate file in config/auth/svn.simple/ which allowed authentication to succeed.
Has anyone else reported this?
Is it ok to remove the use of setAuthenticationForced
here, as it doesn't seem to actually force the validation of credentials?
Thanks,
Stu.
Hi there,
First I would like to say that this plugin is simple to use! thanks for that and for the plugin at first place.
I am building a gradle wrapper plugin that uses release plugin and I noticed that it tries to fetch sqljet 1.1.8-SNAPSHOT I think this should be using a released version of that lib and not its SNAPSHOT one.
After cloning my repo, running build, test, install cleanly on my Java project, I then execute the release task (configured for dry run to see what it looks like). Gradle fails reporting that the release plugin thinks there are source code modifications. If there are, it is news to git! :-)
Hey!
This plugin works fine when running gradle locally, but when i try to run on our CI machine the build.gradle file can't be evaluated, and no gradle tasks at all works.
For example when running gradle tasks i get:
[Gradle] - Launching build.
[workspace] $ /var/lib/jenkins/jobs/Forecast-production-GRADLEase/workspace/gradlew -DBRANCH_TO_BUILD=gradle2 test
FAILURE: Build failed with an exception.
* Where:
Build file '/var/lib/jenkins/jobs/Forecast-production-GRADLEase/workspace/build.gradle' line: 47
* What went wrong:
A problem occurred evaluating root project 'forecast'.
> Process 'command 'git' finished with non-zero exit value 1
With --info & --debug (cut down to relevant parts)
https://gist.githubusercontent.com/rutchkiwi/ac03d610bf48aea0abfb/raw/af6cfcd24018cd62d11a7bbe44f3da63eae554a0/relase-git-problem
Any ideas on how to fix this?
Hi,
is it possible to override Commit Message or can you add it?
Cheers and thx,
Markus
Hi,
You have a method on the SCMService.getNextVersion() which doesn't appear to get called. I'm just wondering how the version of the tag/branch is incremented each time the release is done.
e.g. if i am do 2 releases/builds using GIT on the MASTER branch how is the tag incremented
build 1 = MASTER-RELEASE-1 build 2 = MASTER-RELEASE-2
its kind of baffling me, can you show me a build script that does this
THanks
Mark
$ gradle release
Release version would be trunk-SNAPSHOT
:release
Tag! you are it! Release plugin will create a new branch trunk for project LIS-dropwizard-gradle
:release FAILED
FAILURE: Build failed with an exception.
org.tmatesoft.svn.core.SVNAuthenticationException: svn: E170001: Authentication required for 'http://codebase.company.de'
I've confirmed that the credentials are cached locally.
However, it neither takes the cached ones nor asks me for credentials - as the documentation says
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.