Drools unable to import projects from (Git Lab) to Workbench - drools

I am using Red Hat BRMS 6 to clone my remote repository project into workbench (Business central). It says cloning is successful but unable to open the project in editor.
Logs: 2018-04-02 18:47:05,793 INFO [org.kie.workbench.common.services.backend.service.KieService] (default task-14) File: pom.xml, full path [default://master#drools-bc-sync-sample/pom.xml] was not within a Project. Project Name cannot be set.
Remote Repository: https://github.com/sureshpec04/drools-bc-sync-sample
Any idea on how to resolve this error?
Update:
I am able to clone the repository now and create a project in Business central. However post-commit hook is not working. Meaning, my repository does not get updated with new files created in Business central.
post commit file:
/tools/appsw/jboss/brms/data/.niogit/drools-bc-sample.git/hooks
Contents:
!/bin/sh
git push origin master
permission is set to 777.

Related

Intellij - cannot connect existing project to an existing Github repo

I have an existing Intellij (Ultimate 20,1 beta) project that I want to add to an existing Github repo
Within Intellij I have authenticated my account using the 'Settings/Github' option. I have setup IntelliJ as an authorized app on Github.
When I try to setup the the Github remote I am getting a 'remote: repository not found' error
Any suggestions?
As a postscript, I deleted my rep from Github and then tried using the Intellij Git/Github/Share feature to create the repo from Github.
This process created the new repo but failed with the following message
0:18 Can't finish GitHub sharing process
Successfully created project 'gd-smart' on GitHub, but initial push failed:
remote: Repository not found.
repository 'https://github.com/davoutuk/gd-smart.git/' not found
Got this working eventually via
Within Intellij I unchecked "use credential helper"
Closed Intellij
Deleted the ".git" sub directory
Deleted the 'vcs.xml' file
Made sure that I had a working Github connection under 'Settings/Github'
Then re-opened Intellij and selected the VCS for Git

Attempts to push Spring Boot to Git repository fails

I have a working Spring Boot application that I created in Eclipse that I wold like to put into a new Git repository.
Unfortunately, I cannot seem to do this using Eclipse (or any other Git tool).
I am using Eclipse v2019-06 (4.12.0) and the Spring Tool Suite (STS) v4.3.1
To illustrate the problem, I take the following steps:
I create the Spring Boot project using STS:
Click on "Create a Project"->"Spring Boot"->"Spring Starter Project"
Project name is GitProject
Nothing fancy in this project. Createed a HelloController class that returned some HTML. Ran a browser to test it and displayed a "greeting" web page.
Compile project
mvnw clean package
Successful compile. Ran and successfully displayed web page:
java -jar GitProject-0.0.1-SNAPSHOT.jar
The project is successful and the service works. Place project into Git
There are procedures described to create and push to new repositories. Based on procedures provided in Stack Overflow answers, perform the following:
Create the repository
git init
Make it bare
git init --bare
Create a basic README file for adding to the repository
echo Testing > README
Add and commit the README file
git add README
git commit -m "Initial Code"
Now put the project into the repository. Or at least, attempt to...
Create a project in a different folder, importing from the new repository
Click on "Import projects..."->"Projects from Git"
Clone the URI from the new repository, Only the master branch is available. Place the destination in the project folder. Because there is no existing project in the new repo, and since the IDE does not offer a way to successfully create a new Spring Boot project from a repo (I made several attempts to use the New Project Wizard to create an STS project when creating the repo. Every attempt led to different Exceptions being thrown while creating the project), select "Import as General Project" in the "Select a Wizard" dialog.
Go to the folder with the original GitProject project. Copy everything from that folder and paste it onto the new project
Edit the .gitignore file that gets included in the Spring Boot project. It is important to remove all references to the STS files except for the .sts4-cache file. These need to be saved at least once in order to ensure that the Spring Boot information is saved in the repository.
Right- click on the project and select Team->Commit
Stage everything, enter a commit message, then click on "Commit and Push"
See the following failure:
master-master [remote rejected]
Repository
branch is currently checked out
error: refusing to update checked out branch: refs/heads/master
error: By default, updating the current branch in a non-bare repository
is denied, because it will make the index and work tree inconsistent
with what you pushed, and will require 'git reset --hard' to match
the work tree to HEAD.
You can set the 'receive.denyCurrentBranch' configuration variable
to 'ignore' or 'warn' in the remote repository to allow pushing into
its current branch; however, this is not recommended unless you
arranged to update its work tree to match what you pushed in some
other way.
To squelch this message and still keep the default behaviour, set
'receive.denyCurrentBranch' configuration variable to 'refuse'.
What is strange is that somehow this branch remains "checked out" after being cloned but the IDE does not appear to provide a way to "check it back in". Worse: I actually tried just cloning the new repo, changing the README file, then committing and pushing it (without including the Spring Boot code) and that attempt yielded the same failure.
So how do I get this code committed and pushed into my repository? What step is missing from the documentation of how to do this???

Eclipse git error when pushing to remote: Transport Error: Cannot get remote repository refs

I started a Static Web Project in Eclipse to share the project in a remote Git repository as a backup and to possibly share with others.
Created a git repository in the project's folder C:\workspace\projectname.
Committed (added/staged) everything in the C:\workspace\projectname including the .project file and everything in the C:\workspace\projectname\.settings directory as initial commit (because I thought I want to be able to clone the project again from the repository in the future).
Created a remote repository at rocketgit due to its simpler features and ToS.
After everything had been commited, I right clicked the project's repository in the Git Repository view in Eclipse, clicked Remote -> Push.
I entered https as protocol, rocketgit.com as host, users/username/repositoryname as repository path. Entered my username and password, clicked Next.
But a Problem Occurred dialog shows up, with detail `Transport Error:
Cannot get remote repository refs.
https://rocketgit.com/users/username/repositoryname: https://rocketgit.com/users/username/repositoryname/info/refs?service=git-upload-pack not found`.
How do I resolve this? What does this error mean? Can someone explain a solution. Thanks
users\username\repositoryname as repository path.
"users\username\repositoryname" looks like a path on your disk, not to a remote repo URL.
A proper URL would be https://yourServer/<user>/<reponame>, or ssh://git#yourServer/<user>/<reponame>.
I don't know which one RockertGit does support, but using GitHub, GitLab or BitBucket would work.

How can I copy an old branch into the current project, so that the file system is synchronized?

After several attempts of merging the project is unusable and broken. I want to return wholly to an old remote branch. But after checkout branchin Git Extensions when I try the Maven Update I am getting message:
Unable to update Maven configuration
Could not set the project description for 'cm' because the project description file (.project) is out of sync with the file system.
Clean Project, Refresh won't help. (no changes)
Try doing a checkout with hard reset to the remote branch, this will restore the working directory to the remote branch's state removing any new files.
If your remote branch was in working condition then you should be able to run "maven update".

How to use Egit with ssh

I have always used gitHub as my repository but now I decided to store my source code into my local server (Ubuntu 14.04).
I use Eclipse as IDE and to make it working with git I installed Egit plugin.
My objective is to have a centralised repository in my local server at 10.3.16.1 and use my desktop pc and my macbook to push and fetch data from it.
My existing maven spring web based application sits at the moment on my laptop (eclipse)
I created a local git repo and then I added and committed all files. (so far so good)
Afterwards, I created a new remote as follow
I then pushed the master branch to the server but despite it says that the process has been successful I cannot clone the entire source code from my pc but only metadata like commits etc but not source files
Any thoughts on this?
Thanks
I managed to solve this problem on my own.
Apparently Git does not store source files in the centralised repository but only objects.
In order to import all source files I did the following on my PC
In eclipse File-> Import-> Git-> Project from Git
Then I selected Clone URI
I filled the location of the repository as follow
Eclipse retrieved successfully the master branch
Set the local destination of the new repository on my pc
And then I imported all sources accordingly as follow
Then I added the project to my working set
Hope this can be of help