Details
-
New Feature
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.5.0-incubating
Description
Nuget Packages are much broader than Maven Artifacts. Our first thought was to implement a repository layout that would enable for resolving nuget packages directly (see NPANDAY-372).
But those packages come in various shapes and are not as easily converted to dotnet-library artifacts as first thought.
Library Importer
Instead we will create a plugin, that helps importing nuget packages (and soon also plain DLL-libs) into maven artifacts. As a general rule, each DLL contained in a single nupkg will result in a separate maven artifact.
Some of the challenges we see:
Versions
Nuget packages (and dlls) have four version numbers while maven only has three. In most cases those are not used in nuget, but if, there has to be some manual mapping.
Multi-targeted packages
Nuget packages may contain libraries for different target frameworks (net20, 35, wp, sl, ...); something that we'd like to support in NPanday too (NPANDAY-405)
As a first approach, you'll have to specify which of the versions to import.
We could also support a mapping from framework versions to maven version qualifiers, as for example 1.2-net20
Dependencies
Since there is no easy mapping from package to artifact, it is not that easy to convert the dependencies either. For each import it will be necessary to specify how the reps are mapped.
Prerelease versions
Nuget >= 1.6 does also support prerelease versions. These should be mapped to SNAPSHOT, if possible.
What more?
Please comment or edit, if you see more challenges that I haven't seen yet.
Technical approach
A plugin with it's own lifecycle will 'compile' import declarations and then perform the import on 'compile'; then install and deploy the imported packages on the corresponding maven life cycles 'install' and 'deploy'.
<libs xmlns="http://npanday.apache.org/library-import/1.0.0"> <nuget> <package>NUnit</package> <version source="2.6.0.12054" mapTo="2.6.0"/> <version source="2.5.10.11092" mapTo="2.5.10"/> <libDirs> <default>net40</default> </libDirs> </nuget> </libs>