NPanday currently hosts a a Maven repository for various third-party .NET frameworks and libraries.

The files are redistributed under the terms of their original license. The license of these files may differ from the project itself - please consult the .pom file that resides in the repository of the artifact for the license.

Conventions

The following conventions have been agreed to:
  • the artifact ID of the artifact will match the original filename of the artifact exactly (including upper/lowercase)
  • the group ID shall be in the standard Maven convention of using a reverse domain, eg org.nunit
  • artifacts in their original domain must be the original artifacts as distributed from their site. These artifacts must be signed either with an assembly signature, or an external PGP .asc signature for artifacts that are not assemblies
  • to repackage an assembly, it should be added under a different group ID. eg com.codeplex.npanday.contrib.nunit
  • the preferred artifact ID format is CamelCase, eg NPanday.VisualStudio.AddIn
  • all POMs must contain a license, URL and name element
  • the <packaging> and <type> elements will use the dotnet:* notation previously used on Apache NMaven 0.15
  • POMs should contain no plugin definitions, unless they come from a project originally built with NPanday/NMaven

Contributing

To contribute a bundle, either:
  • prepare a patch against the repository (including metadata files) and submit it via the issue tracker
  • submit a bundle in the format recommended on the Maven web site repository submissions

Howto

Use these 3rd party artefacts

Create 3rd party artefacts

Repackage binaries

If you want to distribute binary artifacts, in other words, artifacts not compiled with NPanday, you just have to create a minimal pom file as advised in the previous Convention section. This section will take a concrete example base on log4net library.
  • the group ID will match the reverse domain name. As the domain name is http://logging.apache.org/log4net we will use org.apache.logging as groupID.
  • the artifact ID will match the binaries name. All DLLs (one for each compile target) are named log4net.dll we will use log4net as artifactID. You can also checkout the content of AssemblyInfo.cs file and read the AssemblyProduct value.
  • the version will match the assembly release informations. You can use the informations delivered on the download page or checkout the content of AssemblyVersionInfo.cs file and read the AssemblyVersion value. Here the value will be 1.2.10.0.
  • do not forget to set the artifact name, url and description.
  • do not forget to set the licensing informations.
  • another mandatory thing is to set the packaging to one of NPanday supported one (@see Supported Packaging Type). Here the value will be dotnet:library.
Here is the resulting pom file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>org.apache.logging</groupId>
    <artifactId>log4net</artifactId>
    <version>1.2.10.0</version>
    <name>Log for .Net</name>
    <description>log4net is a tool to help the programmer output log statements to a variety of output targets.
    </description>
    <url>http://logging.apache.org/log4net/</url>
    <packaging>dotnet:library</packaging>

    <licenses>
        <license>
            <name>The Apache2 License</name>
            <url>
                http://logging.apache.org/log4net/license.html
            </url> 
        </license>
    </licenses>

</project>
Now we are done with the pom file we need to install in your Maven local repository or in NPanday remote repository.

NPanday remote repository

In order to avoid management problems in our repository the preferred way is to checkout the svn sources, make installs in this repository and send us a patch using the issue tracker.
Previously to start you will need to modify your maven settings (~/.m2/settings.xml) and add a dedicated server entry (else you may get some error when installing). It should look as the following:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
  </servers>
   <server>
      <id>npanday.local</id>
      <filePermissions>775</filePermissions>
      <directoryPermissions>775</directoryPermissions>
    </server>
  </servers>
</settings>

We will now use the deploy:deploy-file plugin to install in NPanday repository. It should look as the following:
mvn deploy:deploy-file -Dpackaging=<EXTENSION> -Durl=<REPO_URL> -DrepositoryId=<REPO_ID> -DgeneratePom=false -DpomFile=pom.xml -Dfile=<FILE>


Where:
  • packaging must match the packging type extension (@see Supported Packaging Types). As we must set packaging the same as the extension because we decided to not set NPanday plugin as dependency which makes Maven not aware of NPanday packaging types.
  • url must point to your local NPanday repository (the one you just extracted from subversion). A local repository means that it must point to a local file and then starts with file://
  • repositoryId must be the same as defined in your Maven settings file. If you have defined it the same as earlier in this page it must be npanday.local
  • pomFile must point to your pom file, it will often be pom.xml
  • file must point to the singne file to install in the repository

You will certainly understand better with the log4net example. Here is an a Windows batch example deploy all log4net artifacts:
set LOG4NETVERSION=1.2.10
set REPO_URL=file://C:\projets\npanday-repository
set REPO_ID=npanday.local

call mvn deploy:deploy-file -Dpackaging=dll -Durl=%REPO_URL% -DrepositoryId=%REPO_ID% -DgeneratePom=false -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\net\2.0\release\log4net.dll -Dclassifier=net-2.0
call mvn deploy:deploy-file -Dpackaging=dll -Durl=%REPO_URL% -DrepositoryId=%REPO_ID% -DgeneratePom=false -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\net\1.0\release\log4net.dll -Dclassifier=net-1.0
call mvn deploy:deploy-file -Dpackaging=dll -Durl=%REPO_URL% -DrepositoryId=%REPO_ID% -DgeneratePom=false -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\net\1.1\release\log4net.dll -Dclassifier=net-1.1
call mvn deploy:deploy-file -Dpackaging=dll -Durl=%REPO_URL% -DrepositoryId=%REPO_ID% -DgeneratePom=false -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\mono\2.0\release\log4net.dll -Dclassifier=mono-2.0
call mvn deploy:deploy-file -Dpackaging=dll -Durl=%REPO_URL% -DrepositoryId=%REPO_ID% -DgeneratePom=false -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\mono\1.0\release\log4net.dll -Dclassifier=mono-1.0
call mvn deploy:deploy-file -Dpackaging=dll -Durl=%REPO_URL% -DrepositoryId=%REPO_ID% -DgeneratePom=false -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\netcf\1.0\release\log4net.dll -Dclassifier=netcf-1.0
call mvn deploy:deploy-file -Dpackaging=dll -Durl=%REPO_URL% -DrepositoryId=%REPO_ID% -DgeneratePom=false -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\cli\1.0\release\log4net.dll -Dclassifier=cli-1.0
call mvn deploy:deploy-file -Dpackaging=dll -Durl=%REPO_URL% -DrepositoryId=%REPO_ID% -DgeneratePom=false -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\sscli\1.0\release\log4net.dll -Dclassifier=sscli-1.0


Here is an Unix version of this script:
...


You are now done with installation in your NPanday repository, just send us a patch with your modifications using the |url:http://www.codeplex.com/npanday/WorkItem/Create.aspx issue tracker]. Select the Repository component and set the type as Feature.

Maven local repository

............
set LOG4NETVERSION=1.2.10

call mvn install:install-file  -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\net\2.0\release\log4net.dll -Dclassifier=net-2.0
call mvn install:install-file  -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\net\1.0\release\log4net.dll -Dclassifier=net-1.0
call mvn install:install-file  -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\net\1.1\release\log4net.dll -Dclassifier=net-1.1
call mvn install:install-file  -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\mono\2.0\release\log4net.dll -Dclassifier=mono-2.0
call mvn install:install-file  -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\mono\1.0\release\log4net.dll -Dclassifier=mono-1.0
call mvn install:install-file  -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\netcf\1.0\release\log4net.dll -Dclassifier=netcf-1.0
call mvn install:install-file  -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\cli\1.0\release\log4net.dll -Dclassifier=cli-1.0
call mvn install:install-file  -DpomFile=pom.xml -Dfile=lib\log4net-%LOG4NETVERSION%\bin\sscli\1.0\release\log4net.dll -Dclassifier=sscli-1.0

cd %HOMEPATH%\.m2\repository\org\apache\log4net\log4net\%LOG4NETVERSION%\
echo "Bundling local repository files"
jar.exe -cf log4net-bundle.jar *.dll *.pom



#!/bin/sh

LOG4NETVERSION=1.2.10.0
export LOG4NETVERSION

mvn install:install-file  -DpomFile=pom.xml -Dfile=lib/log4net-$LOG4NETVERSION/bin/net/2.0/release/log4net.dll -Dclassifier=net-2.0
mvn install:install-file  -DpomFile=pom.xml -Dfile=lib/log4net-$LOG4NETVERSION/bin/net/1.0/release/log4net.dll -Dclassifier=net-1.0
mvn install:install-file  -DpomFile=pom.xml -Dfile=lib/log4net-$LOG4NETVERSION/bin/net/1.1/release/log4net.dll -Dclassifier=net-1.1
mvn install:install-file  -DpomFile=pom.xml -Dfile=lib/log4net-$LOG4NETVERSION/bin/mono/2.0/release/log4net.dll -Dclassifier=mono-2.0
mvn install:install-file  -DpomFile=pom.xml -Dfile=lib/log4net-$LOG4NETVERSION/bin/mono/1.0/release/log4net.dll -Dclassifier=mono-1.0
mvn install:install-file  -DpomFile=pom.xml -Dfile=lib/log4net-$LOG4NETVERSION/bin/netcf/1.0/release/log4net.dll -Dclassifier=netcf-1.0
mvn install:install-file  -DpomFile=pom.xml -Dfile=lib/log4net-$LOG4NETVERSION/bin/cli/1.0/release/log4net.dll -Dclassifier=cli-1.0
mvn install:install-file  -DpomFile=pom.xml -Dfile=lib/log4net-$LOG4NETVERSION/bin/sscli/1.0/release/log4net.dll -Dclassifier=sscli-1.0

cd ~/.m2/repository/log4net/log4net/$LOG4NETVERSION/
echo "Bundling local repository files"
jar -cf log4net-bundle.jar *.dll *.pom


Repackage assemblies

Last edited Dec 16, 2008 at 10:15 PM by mimil, version 5

Comments

No comments yet.