Can we have a jar repository in VSTS? - azure-devops

I'm new to VSTS. We are about to start using VSTS as our repository for code and build process. Can I have a repository in VSTS where I can load all jars (like maven) and then use the same to build my java application? Basically, I'm trying to get Maven feature with VSTS

You can put jar files in the VSTS repository but needs to clone them to the build agent.
To clone extra repository, you can add Command Line step/task to call git clone command.
On the other hand, there is Maven step/task already. Build your Java app with Maven

Related

How to run a Azure build pipeline and download a dependency which is not available in Maven repo

Trying to deploy an MULE API and as CI/CD I am using Azure Build Pipeline, but we are getting following error :
Failed to execute goal on project mule-fts-sap-eapi: Could not resolve dependencies for project 1674d8b0-3a4f-4bfb-8c70-89641e023735:mule-fts-sap-eapi:mule-application:1.0.0: The following artifacts could not be resolved: com.sap.conn.jco:com.sap.conn.jco.sapjco3:jar:3.0.19, com.sap.conn.idoc:com.sap.conn.idoc.sapidoc3:jar:3.0.13, com.sap.conn.jco:libsapjco3:dll:3.0.19: Could not find artifact com.sap.conn.jco:com.sap.conn.jco.sapjco3:jar:3.0.19 in Central (https://repo1.maven.org/maven2) ->
We found this dependency not in Maven repo, so what could be the possible way to download this dependency from azure pipeline?
We tried to put the .zip file of dependency in Azure library and but not sure how to pull it, is it possible to store the .zip file of dependency to store somewhere in azure pipeline and unzip and use it when required.
Have you tried to add the Maven Authenticate task before you resolve the artifacts?
- task: MavenAuthenticate#0
inputs:
   artifactsFeeds: '**'

Gradle dependencies to download a single file from github repository

Need some help with writing the gradle dependices to download a single file from github repository
We have a scenario where we need to download .yaml file from the github repository so that we can use it further to autogenerarte it . How do I download a single file form github report via gradle
The best option, if you have freedom to change the source project, is for the yaml to be built, versioned and published to a repository. Eg packed inside a zip/jar in nexus. You could then get the zip/jar in Gradle similar to any other dependency then unpack the yaml file.
Failing that there's a couple of options with github
Download via http (see download plugin)
Get using git (see gradle-git plugin)

Installing Nuget packages form repository in VSTS

I have certain packages that are not available online. I am maintaining a package folder in my repo that holds all the packages required for the application to successfully build.
I am trying to figure out a way to install packages in VSTS build definition from the packages present in repo.
Thanks in advance.
I recommend that you can store your packages in VSTS package feed. Then restore the packages from your VSTS feed.
Publish your packages to your VSTS package feed. (Refer to Package Management in Team Services and TFS)
Edit your build definition, specify config file for Nuget restore step or put NuGet.config at the solution root, next to the project.json file.
Regarding packages store in the repository scenario, you can clone that repository to the corresponding folder by using Command Line step/task;
Edit your build definition
Select Options
Check Allow Scripts to Access OAuth Token
Add Command Line step (Tool: [git tool path] (you can add nuget.exe to environment (system) variable), Arguments: clone https://:$(System.AccessToken)#[git repo url], Working folder: [folder that packages need to download]
On the other hand, if the project/solution file and package files are in the same repository, you just need to select corresponding repository in Repository tab of build definition.

jenkins with copy artifact plugin without maven from GitHub

I am trying to deploy a war file into WAS8.5 with GitHub. at first I am specifying "EAR Path" with the war file in "Websphere Deployment" option. Then I made some changes in eclipse workspace and pushed into GitHub. Jenkins is checking for latest build but unable to deploy the same in Server. I have used copy artifact plugin, but still nothing happening. I may be wrong in configurations or something. I am getting the following exception:
Copied 0 artifacts from "simplewebapp" build number 20
ERROR: Failed to copy artifacts from simplewebapp with filter: *.war
Archiving artifacts
Finished: FAILURE
and in \jobs\simplewebapp\builds\lastSuccessfulBuild\archive\SimpleWebApp, am unable to see any archive file. How can i achieve it without Maven?
Kindly show me with some examples.
jenkinone
jenkintwo
As a final answer, I recommend to host your project code in GitHub, to use Jenkins/Maven to build your project and to publish the EAR/WAR file to WebSphere using this deployer plugin.

Tool for managing/hosting own p2 repositories?

Our company uses Maven. We use the Nexus repository manager in order to store our snapshots and releases.
Currently, we are developing a product based on Eclipse. We use Tycho to do that.
The problem is the following: In our Eclipse-based product we have many features. Our idea is build each feature (or group of features) separately and put them in internal p2 repositories. When one features requires another feature, we point the target platform to necessary internal p2 repository.
Currently, we build application with Tycho. We make our features "deployable", so Tycho produces a P2 site in target. We push that P2 site to our server and then run Eclipse FeaturesAndBundlesPublisher, which merges that recently-built feature with a P2 repository. As a result, we have a internal P2 repository having all the versions of required feature.
We find that this process is too cumbersome. Is there a tool like Nexus, which would be more convenient?
UPD.:There is a discussion on Tycho Users list
With the Unzip Repository Nexus Plugin, you can use Nexus for exchanging binary artifacts between Tycho builds.
Tycho project A publishes its artifacts like a normal Maven project: The project is built with mvn clean deploy, which uploads the project's artifacts into your deploy Maven repository on the Nexus. The only special requirement is that the project builds a p2 repository. The recommended way to do this is an eclipse-repository module, but a "deployable feature" should also work in most cases.
On your Nexus, you only need the following one-time configuration: For the deploy Maven repository (or a "Repository Group" which includes that repository), you need to add a virtual repository of type "Unzip Repository". This virtual repository shows zip artifacts from the deploy repository in unpacked form.
Example: If the p2 repository zip of project A is in the deploy Maven repository at http://nexus.corp/nexus/repositories/build.milestones/corp/example/project-a/project-a-repo/1.0.0/project-a-repo-1.0.0.zip, it will be available in standard p2 repository format in the Unzip Repository at http://nexus.corp/nexus/repositories/build.milestones.unzip/corp/example/project-a/project-a-repo/1.0.0/project-a-repo-1.0.0.zip-unzip/.
Tycho project B can reference the artifacts from project A by adding the latter URL to its target platform, e.g. in a target definition file.
In the above example, project B references a release version of project A. The same approach also works for snapshots because the Unzip Repository has support for "symbolic" versions, like 1.1.0-SNAPSHOT for the last deployed 1.1.0-SNAPSHOT or even just SNAPSHOT for the overall highest version. Using these symbolic versions, Project B can then, for example in its own CI build, reference the CI build results project A by adding the resulting (stable!) p2 repository URLs in its target platform.
Disclaimer: The Unzip Repository Nexus Plugin is part of the Tycho project, of which I'm a committer.
Maybe this is a bit late, but I am currently working on an open source (EPL) repository manager which supports the workflow of deploying to a repository with maven and tycho, and consuming it as P2 repository.
It is also possible to deploy bundles created by maven (not maven tycho) and the P2 metadata will be generated automatically.
The project is called "Package Drone" and hosted on github. There is also a short introduction video.