Install custom jars azure devops maven artifact - azure

I have custom dependency jars files in our local maven repo folder like com.org.* to build a Mule application.
I have installed these jars files using mvn install command so that it will get published to maven local repo and again pulled by pom.xml.
Now, I have to replicate the same thing inside azure DevOps under the maven tab.
I have been struggling a lot to find a solutions. Azure DevOps experts could you please guide me here. Any help would be highly appreciated.
Thanks

Install custom jars azure devops maven artifact
You could create your custom maven feed on the Azure DevOps, then publish those custom dependency jars files into this custom maven feed, and use mvn install command with Maven task.
For the details info, please check following documents:
Set up Azure Pipelines and Maven
Get started with Maven packages in Azure DevOps Services and TFS
Configure Azure DevOps Services for Maven package management
Hope this helps.

Related

How to get URL to download latest built artifact package in Azure DevOps

I used to have a simple URL like this (below) that automatically point to the latest build artifact.
https://{organization}.visualstudio.com/{project}/_packaging?_a=packagefeed={feedid}&package={packageid}&preferRelease=true?api-version=6.0-preview.1
But it doesn't work anymore due to some update by Azure.
Does anyone know a way to get around this?
If you want to download the artifact published by the Publish Build Artifacts task or Publish Pipeline Artifacts task from the build pipeline, you can use the RESI API "Artifacts - Get Artifact" to get the download URL the specified build artifact.
If you want to get the download URL of a package published to the feed of Azure Artifacts, you can try using the following RESI API to download the package:
"Maven - Download Package" to download a Maven package from the feed of Azure Artifacts.
"Npm - Download Package" to download a Npm package from the feed of Azure Artifacts.
"NuGet - Download Package" to download a NuGet package from the feed of Azure Artifacts.
"Python - Download Package" to download a Python package from the feed of Azure Artifacts.

Build works locally and fails in Azure

I have a project in C Sharp which build correctly in my local machine ( as well as in the one from my colleagues ). But when we try to configure the pipeline in Azure, in the step of Nuget restore everything stops and we get an error message stating that package "A" is not compatible with netcore 2.2, as well as package B,C,D,etc.
Why is it possible to see this error in Azure but not in my local? The project is setup to use netcore 2.2 and builds fine in my local machine.
Why is it possible to see this error in Azure but not in my local? The project is setup to use netcore 2.2 and builds fine in my local machine.
This error can occur with an outdated version of nuget. The default version of NuGet running in the VSTS pipeline was not the latest one.
So, to resolve this issue, there is a nuget version installer task which you can run as part of your build step to upgrade the version of nuget running in your build pipeline:
Besides, if update nuget version not resolve this issue, please check the SDK version on the build agent is same as your local, you can use the task Use .NET Core to update the SDK version.
Hope this helps.

VSTS Release Management for Nuget Package with Hosted Linux Preview using dotnet

Is it possible to setup a release management task that works for the Hosted Linux Preview Agent that pushes a nuget package using dotnet push?
I've got a Build process that creates the nuget package and publishes it as an artifact. So far I've got this, which works when I use the Hosted VS2017 Agent.
The error i'm getting is:
2017-11-16T09:08:37.3084270Z ##[section]Starting: dotnet push
2017-11-16T09:08:37.3413530Z ==============================================================================
2017-11-16T09:08:37.3426100Z Task : .NET Core
2017-11-16T09:08:37.3439540Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports NuGet.org and authenticated feeds like Package Management and MyGet.
2017-11-16T09:08:37.3451740Z Version : 2.1.8
2017-11-16T09:08:37.3464910Z Author : Microsoft Corporation
2017-11-16T09:08:37.3477740Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2017-11-16T09:08:37.3491430Z ==============================================================================
2017-11-16T09:08:40.3181020Z ##[error]No packages matched the search pattern.
2017-11-16T09:08:40.3305430Z ##[section]Finishing: dotnet push
I'm wondering if there is a difference between the agents on how they pattern match file names.
So it turns out that backslashes and forward slashes are pretty important.
I changed the Path to NuGet package(s) to publish to use forward slashes $(System.DefaultWorkingDirectory)/**/*.nupkg
And what do you know, it works :D

Can not add project to CI in gitlab 8.1.3

I am trying to setup the CI deployment on gitlab for days.
I found that gitlab-ci had been integrated into gitlab after 8.0. But I can't find my projects in CI page, and can't press the button to add them to CI.
My server is ubuntu 14.04.3 LTS trusty. The latest version of gitlab omnibus package and sameersbn's CE docker both failed. Maybe the older version will work for me?
If anyone has the same problem, please give me some hints.
I think I found a solution. As soon as I committed something to the repository, a build automatically triggered and my project automatically showed in the CI projects.
Hope this helps!
Have you enabled Gitlab CI service for your project?
To set up a Gitlab CI for your project go to the project page, then navigate to Settings -> Services, click on "GitLab CI", then check "Activate".
After that project should appear in CI page.
You would need to set up a runner for a project, either use a shared one or assign a specific one.

Deploy Liferay Portlet wars via Jenkins?

We are trying to automate the process of deploying the generated war files via Jenkins to web server. I was able to achieve the same for normal war files using Deploy plugin over tomcat server.
For Liferay portlet war files, I can't use the same plugin as we put war files into deploy folder in liferay and then it gets copied over to tomcat webapps folder.
Another approach I see is to add the deploy path in pom.xml <properties>
<liferay.auto.deploy.dir>${deployPath}</liferay.auto.deploy.dir>
<liferay.version>6.1.0</liferay.version>
</properties> and then run the maven command mvn package liferay:deploy to copy to deploy directory.
Do you have any other option or thoughts, Thanks!
If you want to deploy the wars using Jenkins then alternative would be using Liferay Plugin SDK provided Ant task that provides "ant deploy" command.
For maven projects the mvn liferay:deploy IS the correct and proper way of doing it!
Here's a link to the latest dev. guide on that subject:
https://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/creating-a-portlet-project-liferay-portal-6-2-dev-guide-03-en

Resources