Jedit git plugin usage - plugins

I have installed the Git Plugin for JEdit but dont see how to make it work.
I currently use the SVN Plugin and have no issues with this but work is asking for a change to gitlab.
Where do I setup the access to the gitlab repository and what is it expecting as a URL or SSH URI

As long as you can clone that GitLab repo in command line, you are able to use the same url in the JEdit Git plugin.
So check first you can clone the repo manually:
git clone https://url/to/your/gitlab/server/user/repo
If that works, report that url in JEdit.
Looking at the sources of the JEdit Git plugin 0.7.1, I do see the:
"modified" icon is yellow:
"added" icon is blue:
any other tracked file should be "unmodified", that is green:
Note/update April 2017: I cannot make that plugin work on Windows with the latest jdk 8 and Git for Windows 2.12.2.
I see:
16:02:37 [AWT-EventQueue-0] [debug] EditBus: PluginUpdate[what=ACTIVATED,exit=false,version=0.7.1,source=C:\Users\vonc\AppData\Roaming\jEdit\jars\GitPlugin.jar,class=git.GitPlugin]
16:03:32 [jEdit Worker #1] [debug] GitSubmoduleImporter: Running git ls-files in C:\Users\vonc\data\git\seec
16:03:43 [AWT-EventQueue-0] [debug] ActionSet: Loading actions from jeditresource:/GitPlugin.jar!/actions.xml
But when activating the Commit dialog box, the list is empty, and clicking on it triggers:
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0: java.lang.ArrayIndexOutOfBoundsException: -1
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at java.util.Vector.elementData(Vector.java:734)
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at java.util.Vector.elementAt(Vector.java:477)
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at javax.swing.DefaultListModel.elementAt(DefaultListModel.java:266)
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at git.action.CommitAction$CommitDialog.toggle(CommitAction.java:374)
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at git.action.CommitAction$CommitDialog.mouseClicked(CommitAction.java:363)
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at git.action.CommitAction$CommitDialog.access$200(CommitAction.java:167)
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at git.action.CommitAction$CommitDialog$3.mouseClicked(CommitAction.java:285)
What concerns me is GitPlugin\git\command\OpenFileList.java which includes
if (line.startsWith("# Changed but not updated:") ||
line.startsWith("# Changes not staged for commit:")) {
skip = 2;
target = modified;
}
Well... my prompt on Windows does not start with '#', so changes of detecting staged files become slim.

Related

Bamboo plugin for fetching NuGet packages from Artifactory is throwing a "String index out of bounds" error and causing build to fail

I have a visual studio project which uses several libraries I fetched from NuGet.
I recently created a remote repository in Artifactory that fetches and caches the NuGet packages.
The goal is to remove the "packages" directory from my project's source control and restore the libraries through the artifactory repository every time the project is built.
I am successfully able to do this and build the project in bamboo using a script task and the following command: nuget restore solutionName.sln -Source http://artifactoryRepoAddress
Despite the script working, I would like to use the plugin for bamboo from Artifactory (docs here) since this will collect build information and push it to Artifactory automatically. I am unable to get this to work. The build fails every time with the following error:
java.lang.RuntimeException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at org.jfrog.build.extractor.nuget.extractor.NugetRun.execute(NugetRun.java:185)
at org.jfrog.bamboo.task.ArtifactoryDotNetTaskBase.executeRestore(ArtifactoryDotNetTaskBase.java:113)
at org.jfrog.bamboo.task.ArtifactoryDotNetTaskBase.runTask(ArtifactoryDotNetTaskBase.java:74)
at org.jfrog.bamboo.task.ArtifactoryTaskType.execute(ArtifactoryTaskType.java:46)
at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$2(TaskExecutorImpl.java:321)
at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:258)
at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:321)
at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:118)
at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:73)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.executeBuildPhase(DefaultBuildAgent.java:205)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:177)
at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.lambda$waitAndPerformBuild$0(BuildAgentControllerImpl.java:169)
at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:118)
at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:162)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.lambda$start$0(DefaultBuildAgent.java:122)
at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.base/java.lang.String.substring(Unknown Source)
at org.jfrog.build.extractor.nuget.extractor.NugetRun.addSourceToConfigFile(NugetRun.java:222)
at org.jfrog.build.extractor.nuget.extractor.NugetRun.prepareConfig(NugetRun.java:211)
at org.jfrog.build.extractor.nuget.extractor.NugetRun.prepareAndRunCmd(NugetRun.java:193)
at org.jfrog.build.extractor.nuget.extractor.NugetRun.execute(NugetRun.java:175)
... 19 more
I am wondering if anyone has seen this before or knows how I might fix it. I am thinking that the most likely issue has something to do with the "arguments" section. Here is an image of the input fields. For this example, I am just using placeholder text for the project name and source address: image
There is so little documentation on this plugin that is has been difficult to even get this far.

Running sbt tasks from commandline without plugin.sbt

How to run an sbt build with task from a plugin that is not defined in plugins.sbt?
In maven it's as easy as:
mvn groupId:artifactId:1.2.3:goal
e.g. mvn org.owasp:dependency-check-maven:7.1.1:check
In sbt I get:
$ sbt net.vonbuchholtz:sbt-dependency-check:4.1.0:check
...
[error] Expected ID character
[error] Not a valid command: net (similar: set, new, inspect)
[error] Expected project ID
[error] Expected configuration
[error] Expected ':'
[error] Expected key
[error] Not a valid key: net (similar: test, name, run)
[error] net.vonbuchholtz:sbt-dependency-check:4.1.0:check
[error] ^
You have to have plugin added to sbt to be able to call it.
If you don't want to add it to the project you can add it globally:
// Put things into
// ~/.sbt/1.0/plugins/plugins.sbt
// Actually, you can name the file differently as long as it's in
// ~/.sbt/1.0/plugins/
// and ends with .sbt, sbt will load all files ending with .sbt
// from there.
addSbtPlugin("net.vonbuchholtz" % "sbt-dependency-check" % "4.1.0")
Alternatively, you can define some globally ignored file in .gitignore (assuming you are using git and don't want to accidentally commit things).
// ~/.gitconfig
[core]
excludesfile = ~/.gitignore_global
// ~/.gitignore_global
local.sbt
Then you can add all you want there e.g. local.sbt - you will be able to add some ad hoc changes to you repo and don't worry that they will be commited upstream.
As yet another option, you can put these plugin configs into some file e.g. ~/.extra_plugins.sbt and add them with a command line:
// ~/extra_plugins.sbt
addSbtPlugin("net.vonbuchholtz" % "sbt-dependency-check" % "4.1.0")
sbt --addPluginSbtFile="~/extra_plugins.sbt" dependencyCheck
As far as I can tell you cannot skip the step when you are creating the .sbt file. At best you could auto-generate it and populate it with a script:
// something like this
local tmp_sbt=`mktemp`
echo 'addSbtPlugin("net.vonbuchholtz" % "sbt-dependency-check" % "4.1.0")' >> "$tmp_sbt"
sbt --addPluginSbtFile="$tmp_sbt" dependencyCheck
rm "$tmp_sbt"

How to checkout from SVN with Oomph?

I try to write a Setup Project Model which installs Eclipse and also checks out the source code from SVN with Oomph 1.6.0.
I read Automating Project-specific Eclipse Setups with Oomph:
One big issue in the process of software development (especially, but not only for bigger teams) is the setup of a common IDE. There are many settings and Plugins that must be common to all project members:
File encodings
Target Platforms
SCM-Linking to Git/SVN/CVS/…
so it seems possible. But I couldn't find any documentation for it.
I found under Additional Tasks and Git Clone... an extension for Git, but there is no extension for SVN.
I found Importing project set from SVN fails:
I'd like to implement a setup task which creates a set of projects defined with a team project set:
<setupTask xsi:type="projectset:ProjectSetImportTask" uRL="https://subversion.assembla.com/svn/MYPROJECT/user.psf">
<description>User projects</description>
</setupTask>
I set the property url, but the task is not executed. With the help of the referenced link:
With Help -> Perform Setup Tasks... you can manually trigger the setup tasks again
I could excute the task manually, but I got an exception:
Performing Project Set Import svn://svn.mycompany.com/repo/test
org.eclipse.oomph.util.IOExceptionWithCause: unknown protocol: svn: svn://svn.mycompany.com/repo/test
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl.createIOException(ECFURIHandlerImpl.java:527)
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl.access$14(ECFURIHandlerImpl.java:514)
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl$ConnectionHandler.process(ECFURIHandlerImpl.java:1536)
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl.createInputStream(ECFURIHandlerImpl.java:302)
at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
at org.eclipse.oomph.setup.projectset.impl.ProjectSetImportTaskImpl$Helper.getXMLContent(ProjectSetImportTaskImpl.java:296)
at org.eclipse.oomph.setup.projectset.impl.ProjectSetImportTaskImpl$Helper.isNeeded(ProjectSetImportTaskImpl.java:247)
at org.eclipse.oomph.setup.projectset.impl.ProjectSetImportTaskImpl.isNeeded(ProjectSetImportTaskImpl.java:219)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.initNeededSetupTasks(SetupTaskPerformer.java:1809)
at org.eclipse.oomph.setup.ui.SetupUIPlugin.performStartup(SetupUIPlugin.java:675)
at org.eclipse.oomph.setup.ui.SetupUIPlugin.access$5(SetupUIPlugin.java:414)
at org.eclipse.oomph.setup.ui.SetupUIPlugin$1$1.run(SetupUIPlugin.java:253)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.net.MalformedURLException: unknown protocol: svn
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URI.toURL(Unknown Source)
at org.eclipse.ecf.provider.filetransfer.identity.FileTransferID.getURL(FileTransferID.java:78)
at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:877)
at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:576)
at org.eclipse.ecf.provider.filetransfer.retrieve.MultiProtocolRetrieveAdapter.sendRetrieveRequest(MultiProtocolRetrieveAdapter.java:106)
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl$InputStreamConnectionHandler.sendConnectionRequest(ECFURIHandlerImpl.java:1640)
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl$ConnectionHandler.process(ECFURIHandlerImpl.java:1391)
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl.createInputStream(ECFURIHandlerImpl.java:302)
at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
at org.eclipse.oomph.setup.projectset.impl.ProjectSetImportTaskImpl$Helper.getXMLContent(ProjectSetImportTaskImpl.java:296)
at org.eclipse.oomph.setup.projectset.impl.ProjectSetImportTaskImpl$Helper.isNeeded(ProjectSetImportTaskImpl.java:247)
at org.eclipse.oomph.setup.projectset.impl.ProjectSetImportTaskImpl.isNeeded(ProjectSetImportTaskImpl.java:219)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.initNeededSetupTasks(SetupTaskPerformer.java:1809)
at org.eclipse.oomph.setup.ui.SetupUIPlugin.performStartup(SetupUIPlugin.java:675)
at org.eclipse.oomph.setup.ui.SetupUIPlugin.access$5(SetupUIPlugin.java:414)
at org.eclipse.oomph.setup.ui.SetupUIPlugin$1$1.run(SetupUIPlugin.java:253)
... 1 more
How can I check out my source code automatically with Oomph 1.6.0?

How can I deploy updates to an OpenShift Mono application with Jenkins?

I created a mono application on OpenShift using the community cartridge here.
Now, I'm reading about how to set up continuous builds via jenkins here.
The default mono application doesn't seem to come with any of the necessary scripts for building, restoring NuGet packages, etc. Instead, the git repo seems to have the DLL binaries in it, which doesn't seem sustainable.
What's the best approach for deploying mono on open shift?
I will refine this answer when/if I get it working...
Did you start by clicking the "Continuous Integration - Enable Jenkins" link below your cartridge on your OpenShift Applications page?
Once I did this, my git push output changed from:
remote: CLIENT_MESSAGE: Stopping Apache+mod_mono HTTPD server
remote: Waiting for stop to finish
remote: Waiting for stop to finish
remote: Stopping Postgres cartridge
remote: Building git ref 'master', commit 8da79f2
remote: Preparing build for deployment
remote: Deployment id is 05e8d1d8
remote: Activating deployment
remote: Starting Postgres cartridge
remote: Postgres started
remote: CLIENT_MESSAGE: Starting Apache+mod_mono HTTPD server
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To:
remote: Executing Jenkins build.
remote:
remote: You can track your build at https://jenkins-[you].rhcloud.com/job/mono-build
remote:
remote: Waiting for build to schedule...........Done
remote: Waiting for job to complete...............Done
remote: SUCCESS
remote: New build has been deployed.
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Deployment completed with status: success
But if I remove the bin directory from my source code, then the web site no longer works, even though the build "succeeds." So clearly it is only just blindly copying the files out of git.
So next I did a Update-Package -reinstall -ProjectName OpenShift in the Package Manager console, then right-clicked on the solution and chose "Enable NuGet package restore," and committed/pushed those changes.
In the Jeninks manager I went to Configure the build and added xbuild OpenShift.sln after the gear build line in the "Execute shell" area.
Now it actually tries to do a real build, which fails with the error:
+ xbuild OpenShift.sln
XBuild Engine Version 3.0.7.0
Mono, Version 3.0.7.0
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.
Build started 01/13/2015 20:56:29.
__________________________________________________
/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.sln: warning : /var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: /var/lib/openshift/[my ID]/mono/mono/lib/mono/xbuild/Microsoft/VisualStudio/v10.0/WebApplications/Microsoft.WebApplication.targets: Project file could not be imported, it was being imported by /var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: Access to the path "/var" is denied.
Project "/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.sln" (default target(s)):
Target ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Target Build:
/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: error : /var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: /var/lib/openshift/[my ID]/mono/mono/lib/mono/xbuild/Microsoft/VisualStudio/v10.0/WebApplications/Microsoft.WebApplication.targets: Project file could not be imported, it was being imported by /var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: Access to the path "/var" is denied.
Task "MSBuild" execution -- FAILED
Done building target "Build" in project "/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.sln".-- FAILED
Done building project "/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.sln".-- FAILED
Build FAILED.
Looks like it might be this problem so I made the following manual diff to OpenShift.csproj:
- <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
+ <Import Project="$(SolutionDir)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets" />
and copied from Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications into the above path in my local project.
After committing/pushing that, now I get this new build error:
Project "/var/lib/openshift/[my id]/app-root/runtime/repo/OpenShift.sln" (default target(s)):
Target ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Target Build:
Project "/var/lib/openshift/54b5dc8efcf933bb7300001f/app-root/runtime/repo/OpenShift.csproj" (default target(s)):
Target RestorePackages:
Executing: mono --runtime=v4.0.30319 "/var/lib/openshift/[my id]/app-root/runtime/repo/.nuget/NuGet.exe" install "/var/lib/openshift/[my id]/app-root/runtime/repo/packages.config" -source "" -RequireConsent -solutionDir "/var/lib/openshift/[my id]/app-root/runtime/repo/"
Cannot open assembly '/var/lib/openshift/[my id]/app-root/runtime/repo/.nuget/NuGet.exe': File does not contain a valid CIL image.
Looks like there's a problem running NuGet.exe - Might be this

svn error while creating a tag

org.tigris.subversion.javahl.ClientException:
svn: File not found: revision 2276, path '/mobilehollerweb/trunk/admin/mobilehollerweb/trunk/admin'
svn: '/svn/venturedive/!svn/bc/2276/mobilehollerweb/trunk/admin' path not found: 404 Not Found (https://subversion.assembla.com)
org.tigris.subversion.javahl.ClientException:
svn: File not found: revision 2276, path '/mobilehollerweb/trunk/admin/mobilehollerweb/trunk/admin'
svn: '/svn/venturedive/!svn/bc/2276/mobilehollerweb/trunk/admin' path not found: 404 Not Found (https://subversion.assembla.com)
I get this error when creating a tag for my code. We use assembla as our host and I use eclipse with subclipse plugin installed.
Based on the error message, it looks likes you're trying to run a command like:
svn copy https://subversion.assembla.com/svn/mobilehollerweb/trunk/admin /mobilehollerweb/trunk/admin -m "create a tag"
I think what you want is to do something like:
svn copy https://subversion.assembla.com/svn/mobilehollerweb/trunk/admin /mobilehollerweb/tags/admin/1.0 -m "create a tag"
SVN will not recursively create directories that aren't there-- the directory /tags/admin must already exist before the "1.0" tag can be created.