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

'repository not found' error #49

Closed
robmoore opened this issue Jan 26, 2018 · 5 comments
Closed

'repository not found' error #49

robmoore opened this issue Jan 26, 2018 · 5 comments

Comments

@robmoore
Copy link

I have a project in a git repo that I've checked out locally and when I try to run gradle build I experience the following error:

...
:generateGitProperties FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generateGitProperties'.
> org.eclipse.jgit.errors.RepositoryNotFoundException: repository not found: /home/rob/Work/IdeaProjects/my-project/.git/logs/refs/heads
...

The directory referred to above exists and the current branch is represented beneath it. I'd appreciate any tips to resolve this. I've tried removing the directory and cloning the repo again from scratch but it doesn't appear to make any difference.

@stefan-huettemann
Copy link

stefan-huettemann commented Jan 30, 2018

Having same problem on some (!) of our repos:

[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':server:generateGitProperties'.
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > org.eclipse.jgit.errors.RepositoryNotFoundException: repository not found: /opt/atlassian/pipelines/agent/build/.git/refs/remotes/origin

Note: it still works with 1.4.17

@ghost
Copy link

ghost commented Feb 19, 2018

Hey guys - any update on this issue?

@ka1eka
Copy link
Contributor

ka1eka commented Feb 27, 2018

Hi everybody,
I have created a PR, which fixes the issue: #50
As a workaround (until this PR is merged) you may use the following procedure:

  1. build the plugin locally from my fork:
./gradlew build
  1. take gradle-git-properties-1.4.20.jar from build/libs folder and put it into you project repo into some folder. E.g. I put it into gradle/plugins/ folder.
  2. Adjust your build.gradle:
buildscript {
	//...
	dependencies {
		//...
		classpath 'org.ajoberstar:gradle-git:1.4.2'
		classpath files('gradle/plugins/gradle-git-properties-1.4.20.jar')
	}
}

org.ajoberstar:gradle-git:1.4.2 - is the only dependency which is used by the plugin.

@n0mer
Copy link
Owner

n0mer commented Feb 27, 2018

@ka1eka i can build fresh release, gimme a sec

upd: done Activating plugin com.gorylenko.gradle-git-properties version 1.4.21

@n0mer
Copy link
Owner

n0mer commented Feb 27, 2018

after quick investigation - problem appeared when current working directory does not match, let's say, jar.baseName (e.g. in jenkins - where directory named after jenkins job, not after jar.baseName).

This PR fixes the issue - thanks for the valuable contribution!

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

4 participants