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

Issue in gradle-release #43

Closed
Vlucrecia opened this issue Jun 28, 2013 · 18 comments
Closed

Issue in gradle-release #43

Vlucrecia opened this issue Jun 28, 2013 · 18 comments

Comments

@Vlucrecia
Copy link

Hi

I am working on the gradle release plugin https://github.com/townsfolk/gradle-release on the multi module project. I am able to do a svn ls url from command prompt. But this does not work.
I have mentioned the below in the main build.gradle

buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/groups/public"}
}
dependencies {
classpath 'com.github.townsfolk:gradle-release:1.2'
}
}
apply plugin: 'release'

Have i missed giving the username and password for svn ?? Can you please let me know.
I tried to do a gradle release , but i am getting the following error:

:release
:svnPlatform:initScmPlugin
:svnPlatform:checkCommitNeeded FAILED
:release FAILED
Release process failed, reverting back any changes made by Release Plugin.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':checkCommitNeeded'.

    You have 7 un-commited changes.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debu o
    ption to get more log output.

BUILD FAILED

Thanks
Smurf

@Vlucrecia
Copy link
Author

Hi
Am getting the below error, is this similar to the issue#34 ??

][]
:ss2:checkCommitNeeded
Task ':checkCommitNeeded' has not declared any outputs, assuming that it is out-
of-date.
Running "svn status"
Running "svn status": [? .gradle
][]
!!WARNING!! You have 1 un-versioned files.
:ss2:checkUpdateNeeded
Task ':checkUpdateNeeded' has not declared any outputs, assuming that it is out-
of-date.
Running "svn status -q -u"
Running "svn status -q -u": [][]
Running "svn info https://xxxx/svn/yyy/branches"
Running "svn info https://xxxx/svn/yyy/branches": [][svn: E73100
1: Unable to connect to a repository at URL 'https://xxxx/svn/XM
S/branches'
svn: E731001: No such host is known.
]
:ss2:checkUpdateNeeded FAILED
:release FAILED
Release process failed, reverting back any changes made by Release Plugin.

Running [svn, revert, gradle.properties]
Running [svn, revert, gradle.properties]: [][]

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':checkUpdateNeeded'.

    Running "svn info https://xxxx/svn/yyy/branches" produced an e
    rror: [svn: E731001: Unable to connect to a repository at URL 'https://xxx/svn/yyy/branches'
    svn: E731001: No such host is known.]

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --debug option to
    get more log output.

BUILD FAILED

Total time: 15.23 secs

@townsfolk
Copy link
Contributor

To address the original problem, it says that you have 7 uncommitted files. Meaning your working copy has modifications that aren't on the server, so the plugin by default won't let you do a release.

You can avoid this by setting the failOnCommitNeeded flag as described in the README.md.

I'll address the second issue in the other ticket.

@Vlucrecia
Copy link
Author

So the second issue is a bug, as mentioned in #34? If so, can you please let me know, when it will be released?

@townsfolk
Copy link
Contributor

#34 is a different issue, the problem you're describing is more like #39. This plugin should definitely work for SVN and Git. I have a test project in SVN and it works fine in that project, but I'm on a mac.

Unfortunately, I do not have access to a windows machine so I can't test this issue, or even hazard a guess as to why it's not working on that environment, and so cannot give an estimate on when it'll be fixed.

Do you use a gradle wrapper (ie. gradlew.bat release) when running the build process? Are you using cygwin or any other terminal emulator?

@Vlucrecia
Copy link
Author

No. i do not use graddle wrapper. I am using "org.grails:grails-gradle-plugin:2.0.0-SNAPSHOT". I tried this in windows 7. not cygwin. Can you please let me know, how to fix that.

Thanks
Smurf

@townsfolk
Copy link
Contributor

The grails plugin shouldn't be affecting this plugin. The only thing I can think of is subversion itself. What version of subversion are you using? I'm currently running 1.6.7, the other user who complained of the same issue you're having said they were running 1.7? Perhaps you could try downgrading your SVN to 1.6?

@townsfolk
Copy link
Contributor

I just upgraded my own SVN:

[01:51 PM] svn --version
svn, version 1.7.10 (r1485443)
   compiled Jun  3 2013, 06:49:21

And ran the release task against my test svn project:
https://sourceforge.net/p/gradlerelease/svn/21/tree/

As you can see I'm not able to reproduce this issue. There must be something with SVN 1.7 on Windows. Unfortunately, I am unable to help any further here. I don't have a windows environment to test this on.

@townsfolk
Copy link
Contributor

Do you have the hostname as an entry in your hosts file? It's definitely saying that SVN is having troubles accessing your svn domain. I did some googles and it doesn't seem to be a problem with Java accessing svn over the command-line.

I wonder if it's something similar to this problem:
http://subversion.open.collab.net/ds/viewMessage.do?dsForumId=3&dsMessageId=325

@townsfolk
Copy link
Contributor

@Vlucrecia
Copy link
Author

But, in the command prompt, when i tried the below. it worked fine. also, i have tried with the ip address.

svn info https://xxxx/svn/yyy/branches"

@Vlucrecia
Copy link
Author

But,i will try by adding an entry in the host file and let you know

@Vlucrecia
Copy link
Author

Hi

I tried by changing the hosts file, but it does not work. I am using svn version 1.8.0 (r1490375). can you please help me on this.

@townsfolk
Copy link
Contributor

I'm sorry, I wish I could help more, but this is working for me on my 2 mac environments. I don't have a windows environment so I can't test this out. I don't know what the differences between the setups of Mac SVN vs. Windows SVN.

@Vlucrecia
Copy link
Author

Hi
I was going though the example that you have given : http://sourceforge.net/p/gradlerelease/svn/21/tree/trunk/build.gradle

should i add the below lines in build.gradle?

uploadArchives {
repositories {
add(new org.apache.ivy.plugins.resolver.SFTPResolver()) {
host = releaseRepoHost
addIvyPattern "${releaseRepoBase}/[module]/[revision]/[artifact]-[revision].[ext]"
addArtifactPattern "${releaseRepoBase}/[module]/[revision]/[artifact]-[revision].[ext]"
}
}
}

createReleaseTag.dependsOn uploadArchives

I have just added below lines in build.gradle

buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/groups/public"}
}
dependencies {
classpath 'com.github.townsfolk:gradle-release:1.2'
}
}
apply plugin: 'release'
release {
failOnUnversionedFiles = false
failOnUpdateNeeded = false
}

Also, can you please let me know, where i have to give the username and password for svn?
Thanks

@townsfolk
Copy link
Contributor

You don't need the first part, that was used in my test project to test FTP uploading of jar files. You don't need that, unless you want to upload your jar files via FTP to some server. :)

The second part is the same thing that's found in the install (or apply) script:
http://tellurianring.com/projects/gradle-plugins/gradle-release/1.2/apply.groovy

Which is what you apply in your build.gradle.

As for your last question, I don't know. When I run it myself I'm prompted for the svn username/password during the release task. I think there's a way to store username/password with SVN, but you'll have to consult their documentation for that.

Did you get the issue with the unknown host resolved?

@Vlucrecia
Copy link
Author

Hi
It works in my personal computer. But not in the office network. :( .
In command prompt it works fine asking for current and the next release version.But how it will work in jenkins? Instead of setting the -Pgradle.release.useAutomaticVersion property, whether there is a way to set the current and the next release version in the gradle.properties ?

Thanks

@townsfolk
Copy link
Contributor

You should be able to do something like that by overriding the updateVersion task. I'd recommend using the useAutomaticVersion property and then overriding that task though. That way the plugin will use the current version in your gradle.properties file.

But you'll have to do the next version determination and update yourself. If you look at the updateVersion method in the ReleasePlugin class you can get some ideas on how to do that.

You should be able to override the task like so:

updateVersion {
   // Read next version from gradle.properties (might be able to use project.nextVersion)
   // Set current version to next version and update
   new release.PluginHelper(project: this).updateVersionProperty(project.nextVersion)
   // Determine new-next-version and write it to gradle.properties
}

That's obviously not complete, and I haven't actually tried it, but it should get you started.

@dkant
Copy link

dkant commented Aug 8, 2013

I have faced the same issue.
"svn info" works fine as a command line. But, gradle-release fails when it tries to run the same. I believe these issues will be resolved when command line is moved to use SVNKit ( which is working for other release plugins out there)

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

No branches or pull requests

3 participants