Maven artefact licensing - maven

I was asking why Google doesn't upload android artefacts into the maven central repository. Apparently the answer is that user has to accept license before download.
I know that it is possible (and required) to include a license to the artefact. But is it possible to force user to accept it before downloading and usage?

It's simply not possible cause Maven has no such mechanism. Apart from that it's interactive during the download of artifacts.

JFI: It's sad because NuGet in the .NET World has such functionality (
Stop License Acceptance popup by Auto Accepting Nuget within visual studio

Related

What's the best mechanism for deploying libraries (dll's) centrally, so a dev team can just add reference to them?

Just curious, per my title above.
I am leaning towards a nuget package-like style, where the dev team can continuously update libraries (dll's) and deploy them to a central location e.g. Nuget. Then, have project reference the dll depending on the version that's been deployed in a central location e.g. Nuget.
Deploying the dll's in a shared folder won't work.
Please advise, thanks.
Actually, nuget is the best way.
Pack
You can work with your teammates to maintain the same nuget project. When you are creating a nuget package or make some changes, you can just set different nuget versions for them to pack them as nuget package(.nupkg). These are different pack functions(non-sdk project uses nuget.exe, new-sdk projects use dotnet cli, msbuild.exe can work with both of them but note in non-sdk projects, it works with non-sdk projects with PackageReference).
Push
When you finish it, you could push the nuget package into a a shared folder, or push into an azure devops feed.
Use
You just send the full path of the shared folder or the feed url link(they should give your teammates sufficient permissions)
And anyone who wants to use it should set the link into nuget package sources, and then they can install it to use it.
Besides, if there is a subsequent update operation, as a nuget maintainer, you modify the lib project, after that, set a new version for it, any descriptions to tell others there is a new release updated version during pack process.
Then, push the new version into the feed to let others could install it.

Nuget version and release management like maven release plugin

I am more experienced with Java than dotnet. But, recently I have started working on a dotnet Project and I have to write CI process for this Project.
I use maven for Java. And Where is a maven release plugin. Basically, You use snapshot version during development time. and when you ready for a release candidate or release. You use maven release plugin and it update all pom files and commit the new version for you.
Is there a similar tool for nugget to automatically update version number and put tags like RC, RELEASE etc. What approach should I use.
Not: We are usign TFS 2015 for CI process. I can take advantages of TFS capabilities.
There is a tool called Release Management in TFS, an essential element of DevOps that helps your team continuously deliver software to your customers at a faster pace and with lower risk.
Since you are also using a continuous integration (CI) system and you
could use TFS release management as a fully-fledged continuous
delivery system. You could set up Release Management to automatically
deploy new builds to multiple environments.
As for version nuget package you could take a look at below blog which shows you how to hold CI packages(part1) and share packages using Release Management(part tool) with the help of NuGet Publisher task.
Versioning NuGet packages in a continuous delivery world: part 1
Versioning NuGet packages in a continuous delivery world: part 2
Not sure maven how to handle the tags and equivalent in TFS, there is a tag in tfs build, you could add the tag manually or through API, which builds actually be tagged for easy searching.
As for snapshot, there is a corresponding thing in TFS called labels, you could directly build labels.

How do I integrate NuGet into my Bamboo Build Plan?

Our build plans for Sitecore (.Net) websites are currently using Bamboo as the build plan master for continuous integration process. Bamboo supports building a .Net project, and that .Net project contains references to several Sitecore binaries.
I have used NuGet as an artifact repository, mostly because that seemed to be the one most people were using.
So, now that I have a nuget repository, am hosting my own feed, and have added the Nuget package to my project (I just installed the package of binaries I created), what more do I need to do?
Should the build call out something special, or am I done? I guess I'm just nervous that bamboo isn't talking directly to my repository....
In the closest analogy I have, namely a Maven/Archiva combo, the maven plan specifically references the artifacts in archiva, pulling the correct version as needed. Does NuGet do this?
Since there have been some new developments in the NuGet package restore approach, I thought I'd post an update on this topic. We're using Visual Studio 2012. I wanted to be able to run MSBuild and make sure that it would first restore NuGet packages without setting "Package restore" to true in the config. Here's what I did (inspired by https://stackoverflow.com/a/23935892/414376):
Upgraded NuGet in my solution to a version later than 2.7 (2.8.3 in my case; this seems like an optional step)
Installed NuGet.exe on the build server
Added NuGet.exe to my remote agent so that it could be run as a command from Bamboo
Added the NuGet command to my build plan with argument restore (so that the command will be nuget restore); I've placed it right before my MSV Build task.
That was all I needed to get this to work properly according to the latest guidelines.
Nuget 1.4+ supports "Package restore" which embeds a call to an MsBuild task in the project file. When the packages are not available it will automatically restore them while building the project.
I'm sure this is old news, but my packages are in \packages. No amount of "dotnet restore" would work, until I explicitly mentioned the packages folder.
dotnet restore --packages .\packages
restored them!
VS2019. just in case it's version specific.

Nuget package backup

It has been common practice to check nuget packages used in a solution into source control. With the new package restore feature of nuget 1.6 it is no longer necessary to check packages into source control. However, this leaves your projects dependent on nuget.org. There may come a time when a needed package is not available on nuget.org and not available locally in your organization, without which you would not be able to build your project.
Are there any enterprise solutions for backing up nuget packages used in projects in a centralized fashion? One scenario is to have an enterprise nuget proxy server, from which projects get their nuget packages. This proxy server can backup the requested packages in some fashion, like storing them on a backed up folder and checking the content into a shared source control repository. Another scenario is to have the backup logic done automatically on each developer's machine.
In summary, what are some good automated options for backing up nuget packages?
You should look at Artifactory from JFrog (http://www.jfrog.com/): they recently added support for NuGet. Artifactory can act as a central cache for multiple NuGet feeds. I spoke to the development team at a conference earlier this year, and they're really switched on.
There is also ProGet, although I have not used this: http://inedo.com/proget/overview
I don't know of any existing backup solutions, but this is definitely something we'd like to solve at some point. A couple of ideas come to mind.
Use DropBox to backup the packages directory into another location.
Run your own instance of NuGet.org locally and have your CI server populate the local one with installed packages.
Use MyGet.org to host a private feed of all the packages your team has installed.

Is it possible to share huge data between projects when the data is installed by Nuget?

I found that nuget seems to always install packages under the folder of the visual studio project.
It is not feasible for me because the package that I'm going to distribute contains huge amount of data. I don't want to make a copy of that whenever I add that package to a new visual studio project.
I want that data to be shared between projects. Since it is shared, if one project removed that package, the data should stay there until I explicitly tell the system to remove it.
Is there any way that can deal with this kind of problem?
I heard that Maven installs packages in a global location and it doesn't have such a problem. How about using Maven to install .NET libraries, is that possible? What would be the potential problems?
To upload and store your .NET artefacts you'll need a Maven repository manager like Nexus, Artifactory or Archiva. Good news is that these are capable of storing files of any type.
If you don't fancy converting your build process over to Maven, I'd recommend the following answer on using Apache ivy with MSBuild. All Maven clients appear to cache their downloads for use across projects (They're basically intelligent downloaders)
The upcoming 2.0 version of Nexus promises integration with NuGet. I'm expecting better .NET support from Maven in the future.

Resources