Added: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandayMojo.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandayMojo.java?rev=1330742&view=auto ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandayMojo.java (added) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandayMojo.java Thu Apr 26 10:09:02 2012 @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package npanday.plugin.libraryimporter.skeletons; + +import com.google.common.base.Splitter; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.MavenProjectHelper; + +import static com.google.common.collect.Iterables.toArray; + +/** + * @author <a href="mailto:[email protected]">Lars Corneliussen</a> + */ +public abstract class AbstractNPandayMojo + extends AbstractMojo +{ + public Splitter SPLIT_ON_SEMICOLON = Splitter.on( ';' ).omitEmptyStrings().trimResults(); + + /** + * If the execution of this goal is to be skipped. + * + * @parameter + */ + protected boolean skip; + + /** + * The maven project. + * + * @parameter expression="${project}" + * @required + */ + protected MavenProject project; + + /** + * The maven project helper. + * + * @component + */ + protected MavenProjectHelper projectHelper; + + public final void execute() throws MojoExecutionException, MojoFailureException + { + if ( skip ) + { + getLog().info( + "NPANDAY-126-000: Execution of '" + getClass().getSimpleName() + "' was skipped by configuration." + ); + return; + } + + setupParameters(); + + innerExecute(); + } + + protected void setupParameters() + { + + } + + protected String[] firstNonNull( String commandlineValues, String[] configurationValues ) + { + return firstNonNull( commandlineValues, configurationValues, new String[0] ); + } + + protected String[] firstNonNull( String commandlineValues, String[] configurationValues, String[] defaultValue ) + { + if ( commandlineValues != null ) + { + return toArray( + SPLIT_ON_SEMICOLON.split( commandlineValues ), String.class + ); + } + + if (configurationValues != null){ + return configurationValues; + } + + return defaultValue; + } + + protected abstract void innerExecute() throws MojoExecutionException, MojoFailureException; +}
Added: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandaySettingsAwareMojo.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandaySettingsAwareMojo.java?rev=1330742&view=auto ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandaySettingsAwareMojo.java (added) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandaySettingsAwareMojo.java Thu Apr 26 10:09:02 2012 @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package npanday.plugin.libraryimporter.skeletons; + +import npanday.registry.RepositoryRegistry; +import npanday.vendor.SettingsUtil; +import npanday.vendor.VendorRequirement; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; + +/** + * @author <a href="mailto:[email protected]">Lars Corneliussen</a> + */ +public abstract class AbstractNPandaySettingsAwareMojo + extends AbstractNPandayMojo +{ + + /** + * @parameter expression="${npanday.settings}" default-value="${user.home}/.m2" + */ + protected String settingsPath; + + /** + * The vendor of the framework, the executable is provided by or compatible with. + * + * @parameter expression="${vendor}" + */ + protected String vendor; + + /** + * The version of the framework vendor, the executable is provided by or compatible with. + * + * @parameter expression="${vendorVersion}" + */ + protected String vendorVersion; + + /** + * The framework version, the executable is compatible with. + * + * @parameter expression = "${frameworkVersion}" + */ + protected String frameworkVersion; + + /** + * @component + */ + protected RepositoryRegistry repositoryRegistry; + + /** + * @component + */ + protected npanday.executable.NetExecutableFactory netExecutableFactory; + + @Override + protected void innerExecute() throws MojoExecutionException, MojoFailureException + { + SettingsUtil.applyCustomSettings( getLog(), repositoryRegistry, settingsPath ); + } + + protected VendorRequirement getVendorRequirement(){ + return new VendorRequirement( vendor, vendorVersion, frameworkVersion); + } +} Added: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/resources/META-INF/npanday/executable-plugins.xml URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/resources/META-INF/npanday/executable-plugins.xml?rev=1330742&view=auto ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/resources/META-INF/npanday/executable-plugins.xml (added) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/resources/META-INF/npanday/executable-plugins.xml Thu Apr 26 10:09:02 2012 @@ -0,0 +1,47 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> + +<executablePlugins xmlns="http://npanday.apache.org/executables/1.5.0"> + + <executablePlugin> + <profile>MANIFESTINFO</profile> + <pluginClass>npanday.executable.impl.DefaultNetExecutable</pluginClass> + + <executable>manifestinfo</executable> + <executableVersion>1.0</executableVersion> + + <vendor>MICROSOFT</vendor> + + <frameworkVersions> + <frameworkVersion>4.0</frameworkVersion> + <frameworkVersion>3.5</frameworkVersion> + <frameworkVersion>2.0</frameworkVersion> + </frameworkVersions> + + <probingPaths> + </probingPaths> + + <platforms> + <platform> + <operatingSystem>Windows</operatingSystem> + </platform> + </platforms> + + </executablePlugin> +</executablePlugins> Added: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/resources/META-INF/plexus/components.xml URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/resources/META-INF/plexus/components.xml?rev=1330742&view=auto ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/resources/META-INF/plexus/components.xml (added) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/resources/META-INF/plexus/components.xml Thu Apr 26 10:09:02 2012 @@ -0,0 +1,26 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> + +<component-set> + <!-- + The contents of this file are generated on generate-resources + by 'src/main/scripts/plexus_components_xml.groovy' in order + to avoid endless violations of DRY. + --> +</component-set> Added: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/script/plexus_component_xml.groovy URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/script/plexus_component_xml.groovy?rev=1330742&view=auto ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/script/plexus_component_xml.groovy (added) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/script/plexus_component_xml.groovy Thu Apr 26 10:09:02 2012 @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + + + + +/** + * This script generates the plexus-configuration for registration + * of artifact handlers and lifecycles. + * + * @author <a href="mailto:[email protected]">Lars Corneliussen</a> + **/ +import npanday.lifecycle.LifecycleConfigurationGenerator +import npanday.plugin.libraryimporter.LibraryImporterLifecycleMap + +def plexus = new File(project.build.outputDirectory, 'META-INF/plexus') +plexus.mkdirs() + +def componentsXmlFile = new File(plexus, 'components.xml'); + +LifecycleConfigurationGenerator + .persistAllTypesAndLifecycles(LibraryImporterLifecycleMap, project.version, componentsXmlFile) Added: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/apt/index.apt.vm URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/apt/index.apt.vm?rev=1330742&view=auto ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/apt/index.apt.vm (added) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/apt/index.apt.vm Thu Apr 26 10:09:02 2012 @@ -0,0 +1,40 @@ +~~ Licensed to the Apache Software Foundation (ASF) under one +~~ or more contributor license agreements. See the NOTICE file +~~ distributed with this work for additional information +~~ regarding copyright ownership. The ASF licenses this file +~~ to you under the Apache License, Version 2.0 (the +~~ "License"); you may not use this file except in compliance +~~ with the License. You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, +~~ software distributed under the License is distributed on an +~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +~~ KIND, either express or implied. See the License for the +~~ specific language governing permissions and limitations +~~ under the License. + +~~ NOTE: For help withuses the syntax of this file, see: +~~ http://maven.apache.org/doxia/references/apt-format.html + +NPanday Library Importer Maven Plugin + + Hey, who ever starts from scratch? In the Java world, everything is in Maven Central. + + But sadly we were not fast enough to get there with NPanday before Nuget came along. + Now, the whole .NET OSS world is on Nuget. + + But a nuget package does not canonically map to Maven/NPanday artifacts, so we can't just go use + the {{{http://nuget.org}Nuget Gallery}} to resolve references. This is for various reasons. One is, that Nuget + packages can contain multiple libraries for multiple target frameworks. While we can handle multiple libraries + with multiple artifacts, the multiple frameworks are not as easily handled, sus not supported natively by NPanday. + + This is why we created this plugin. It will let you import Nuget projects, and deploy it's libraries to your own + Maven repositories exactly how you need them. + + It defines the packaging type <<<dotnet-library-importer>>> and the corresponding lifecycle; have a look at + the {{{./usage.html}usage documentation}} to see how to wire it up. + + + Added: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/apt/nuget-mapping.apt.vm URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/apt/nuget-mapping.apt.vm?rev=1330742&view=auto ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/apt/nuget-mapping.apt.vm (added) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/apt/nuget-mapping.apt.vm Thu Apr 26 10:09:02 2012 @@ -0,0 +1,353 @@ +~~ Licensed to the Apache Software Foundation (ASF) under one +~~ or more contributor license agreements. See the NOTICE file +~~ distributed with this work for additional information +~~ regarding copyright ownership. The ASF licenses this file +~~ to you under the Apache License, Version 2.0 (the +~~ "License"); you may not use this file except in compliance +~~ with the License. You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, +~~ software distributed under the License is distributed on an +~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +~~ KIND, either express or implied. See the License for the +~~ specific language governing permissions and limitations +~~ under the License. + +~~ NOTE: For help withuses the syntax of this file, see: +~~ http://maven.apache.org/doxia/references/apt-format.html + +Mapping Nuget Packages to NPanday Artifacts + +* The caveat + + Nuget packages can contain just about everything. The library importer tries to extract the essense and + republish that as NPanday Artifact. + + Lets have a look at the contents of a typical Nuget Package: + +** Package files + ++---+ +RavenDB.1.0.701 ++- content +| +- Web.config.transform ++- lib +| +- net35 +| | +- Raven.Abstractions-3.5.dll +| | +- Raven.Abstractions-3.5.pdb +| | +- Raven.Abstractions-3.5.XML +| | +- Raven.Client.Lightweight-3.5.dll +| | +- Raven.Client.Lightweight-3.5.pdb +| | +- Raven.Client.Lightweight-3.5.XML +| +- net40 +| | +- AsyncCtpLibrary.dll +| | +- AsyncCtpLibrary.xml +| | +- Raven.Abstractions.dll +| | +- Raven.Abstractions.pdb +| | +- Raven.Abstractions.XML +| | +- Raven.Client.Debug.dll +| | +- Raven.Client.Debug.pdb +| | +- Raven.Client.Lightweight.dll +| | +- Raven.Client.Lightweight.pdb +| | +- Raven.Client.Lightweight.XML +| | +- Raven.Client.MvcIntegration.dll +| | +- Raven.Client.MvcIntegration.pdb +| +- sl40 +| +- AsyncCtpLibrary_Silverlight.dll +| +- AsyncCtpLibrary_Silverlight.xml +| +- MissingBitFromSilverlight.dll +| +- MissingBitFromSilverlight.pdb +| +- Raven.Client.Silverlight.dll +| +- Raven.Client.Silverlight.pdb +| +- Raven.Client.Silverlight.XML ++- package +| +- services +| +- metadata +| +- core-properties +| +- b502965c79da455fa5fc0751b2dac785.psmdcp ++- RavenDB.nuspec ++- server +| +- BouncyCastle.Crypto.dll +| +- BouncyCastle.Crypto.pdb +| +- Esent.Interop.dll +| +- Esent.Interop.pdb +| +- Esent.Interop.xml +| +- ICSharpCode.NRefactory.dll +| +- Lucene.Net.Contrib.Spatial.dll +| +- Lucene.Net.Contrib.Spatial.pdb +| +- Lucene.Net.Contrib.Spatial.xml +| +- Lucene.Net.Contrib.SpellChecker.dll +| +- Lucene.Net.Contrib.SpellChecker.pdb +| +- Lucene.Net.Contrib.SpellChecker.xml +| +- Lucene.Net.dll +| +- Lucene.Net.pdb +| +- Lucene.Net.xml +| +- Newtonsoft.Json.dll +| +- Newtonsoft.Json.pdb +| +- Newtonsoft.Json.xml +| +- NLog.dll +| +- NLog.xml +| +- Raven.Abstractions.dll +| +- Raven.Abstractions.pdb +| +- Raven.Abstractions.XML +| +- Raven.Database.dll +| +- Raven.Database.pdb +| +- Raven.Database.XML +| +- Raven.Munin.dll +| +- Raven.Munin.pdb +| +- Raven.Munin.XML +| +- Raven.Server.exe +| +- Raven.Server.exe.config +| +- Raven.Storage.Esent.dll +| +- Raven.Storage.Esent.pdb +| +- Raven.Storage.Managed.dll +| +- Raven.Storage.Managed.pdb +| +- Raven.Studio.xap ++- tools +| +- Raven.Backup.exe +| +- Raven.Backup.pdb +| +- Raven.Smuggler.exe +| +- Raven.Smuggler.pdb ++- [Content_Types].xml ++- _rels + +- .rels ++---+ + + With the library importer, you have to configigure one of the <<<lib>>> directories, by specifying <<<libDirs/default>>>. + In future versions we plan to let you import multiple lib-directories at once. But we are not sure how to map the + framework name to <<<group::artifact::version::type::classifier>>>. + + {{{https://issues.apache.org/jira/browse/NPANDAY-557} See issue NPANDAY-557}} + +** Nuspec + ++---+ +<?xml version="1.0"?> +<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> + <metadata> + <id>RavenDB</id> <!-- used as package id --> + <version>1.0.701</version> <!-- used as version for each artifact, if not overriden --> + <title>RavenDB</title> <!-- copied to project.name --> + <authors>Hibernating Rhinos</authors> <!-- copied to project.developers --> + <owners>Hibernating Rhinos</owners> <!-- ignored --> + <licenseUrl>http://www.ravendb.net/licensing</licenseUrl> <!-- copied to project.licence--> + <projectUrl>http://www.ravendb.net/</projectUrl> <!-- copied to project.url --> + <iconUrl>http://static.ravendb.net/logo-for-nuget.png</iconUrl> <!-- ignored --> + <requireLicenseAcceptance>true</requireLicenseAcceptance> <!-- ignored --> + <!-- description copied to pom.description --> + <description>Raven is a document database for the .NET/Windows platform, offering a flexible data model design to fit the needs of real world systems.</description> + <language>en-US</language> <!-- ignored --> + <tags>nosql ravendb raven document database</tags> <!-- ignored --> + <dependencies> <!-- combined with real lib dependencies --> + <dependency id="NLog" version="[2.0.0.2000]" /> + <dependency id="Newtonsoft.Json" version="[4.0.8]" /> + </dependencies> + <frameworkAssemblies> <!-- ignored --> + <frameworkAssembly assemblyName="System.ComponentModel.Composition" targetFramework=".NETFramework4.0" /> + </frameworkAssemblies> + </metadata> +</package> ++---+ + + Please note, that the specified dependencies are package dependencies! The package (or its id) will eventually + become the group id. So we have to combine those dependencies with the real dependencies of the contained + libraries in order to get real Maven dependencies between the resulting artifacts. + +** The essense + + Lets say, we have configured <<<net40>>> as the default library directory. + ++---+ +RavenDB.1.0.701 ++- content // ignored ++- lib +| +- net35 // ignored +| +- net40 +| | +- AsyncCtpLibrary.dll -> RavenDB:AsyncCtpLibrary:dotnet-library:1.0.701 +| | +- AsyncCtpLibrary.xml // currently ignored +| | +- Raven.Abstractions.dll -> RavenDB:AsyncCtpLibrary:dotnet-library:1.0.701 +| | +- Raven.Abstractions.pdb // currently ignored +| | +- Raven.Abstractions.XML // currently ignored +| | +- Raven.Client.Debug.dll -> RavenDB:Raven.Client.Debug:dotnet-library:1.0.701 +| | +- Raven.Client.Debug.pdb // currently ignored +| | +- Raven.Client.Lightweight.dll -> RavenDB:Raven.Client.Lightweight:dotnet-library:1.0.701 +| | +- Raven.Client.Lightweight.pdb // currently ignored +| | +- Raven.Client.Lightweight.XML // currently ignored +| | +- Raven.Client.MvcIntegration.dll -> RavenDB:Raven.Client.MvcIntegration:dotnet-library:1.0.701 +| | +- Raven.Client.MvcIntegration.pdb // currently ignored +| +- sl40 // ignored ++- package // ignored ++- RavenDB.nuspec // extracted ++- server // ignored ++- tools // ignored ++---+ + +** Dependency mapping + + Let's have a look at the manifest of <<<Raven.Client.MvcIntegration>>>: + ++----+ +Raven.Client.MvcIntegration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + references mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + references System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + references System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 + references System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + references Raven.Client.Lightweight, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593 + references Raven.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593 + references Newtonsoft.Json, Version=4.0.8.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed + references System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ++----+ + + References to anything with Microsofts known public key tokens and System.* references will be filtered out + by default. + + We have two package-internal references here: <<<Raven.Client.Lightweight>>> and <<<Raven.Abstractions>>>, and one + package external reference: <<<Newtonsoft.Json>>>. + + The library importer will expect to find the exaxt strong name in the current or any of the package dependencies. Package + dependencies will be resolved according to Nugets rules, but ONLY inside of the specified package imports in all + of the <<<*.lib.xml>>> files. + + If there is any mismatch found, the library importer will fail; it will then be necessary to manually reconfigure or + ignore the dependency by using <<<mapReference>>> in the library import definition. + +** The resulting poms + ++---+ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <groupId>RavenDB</groupId> + <artifactId>AsyncCtpLibrary</artifactId> + <version>1.0.701</version> + <packaging>dotnet-library</packaging> + <name>RavenDB :: AsyncCtpLibrary</name> + <description>Raven is a document database for the .NET/Windows platform, offering a flexible data model design to fit the needs of real world systems.</description> + <url>http://www.ravendb.net/</url> + <licenses> + <license> + <url>http://www.ravendb.net/licensing</url> + </license> + </licenses> + <developers> + <developer> + <name>Hibernating Rhinos</name> + </developer> + </developers> +</project> ++---+ + ++---+ +<?xml version="1.0" encoding="UTF-8"?> +<project ..> +... +<artifactId>Raven.Abstractions</artifactId> +... +<name>RavenDB :: Raven.Abstractions</name> +... +<dependencies> + <dependency> + <groupId>Newtonsoft.Json</groupId> + <artifactId>Newtonsoft.Json</artifactId> + <version>4.0.8</version> + <type>dotnet-library</type> + </dependency> +</dependencies> +</project> ++---+ + ++---+ +<?xml version="1.0" encoding="UTF-8"?> +<project ..> +... +<artifactId>Raven.Client.Debug</artifactId> +... +<name>RavenDB :: Raven.Client.Debug</name> +... +<dependencies> + <dependency> + <groupId>RavenDB</groupId> + <artifactId>Raven.Client.Lightweight</artifactId> + <version>1.0.701</version> + <type>dotnet-library</type> + </dependency> + <dependency> + <groupId>Newtonsoft.Json</groupId> + <artifactId>Newtonsoft.Json</artifactId> + <version>4.0.8</version> + <type>dotnet-library</type> + </dependency> +</dependencies> +</project> ++---+ + ++---+ +<?xml version="1.0" encoding="UTF-8"?> +<project ..> +... +<artifactId>Raven.Client.Lightweight</artifactId> +... +<name>RavenDB :: Raven.Client.Lightweight</name> +... +<dependencies> + <dependency> + <groupId>Newtonsoft.Json</groupId> + <artifactId>Newtonsoft.Json</artifactId> + <version>4.0.8</version> + <type>dotnet-library</type> + </dependency> + <dependency> + <groupId>RavenDB</groupId> + <artifactId>Raven.Abstractions</artifactId> + <version>1.0.701</version> + <type>dotnet-library</type> + </dependency> + <dependency> + <groupId>NLog</groupId> + <artifactId>NLog</artifactId> + <version>2.0.0</version> + <type>dotnet-library</type> + </dependency> + <dependency> + <groupId>RavenDB</groupId> + <artifactId>AsyncCtpLibrary</artifactId> + <version>1.0.701</version> + <type>dotnet-library</type> + </dependency> +</dependencies> +</project> ++---+ + ++---+ +<?xml version="1.0" encoding="UTF-8"?> +<project ..> +... +<artifactId>Raven.Client.MvcIntegration</artifactId> +... +<name>RavenDB :: Raven.Client.MvcIntegration</name> +... +<dependencies> + <dependency> + <groupId>RavenDB</groupId> + <artifactId>Raven.Client.Lightweight</artifactId> + <version>1.0.701</version> + <type>dotnet-library</type> + </dependency> + <dependency> + <groupId>RavenDB</groupId> + <artifactId>Raven.Abstractions</artifactId> + <version>1.0.701</version> + <type>dotnet-library</type> + </dependency> + <dependency> + <groupId>Newtonsoft.Json</groupId> + <artifactId>Newtonsoft.Json</artifactId> + <version>4.0.8</version> + <type>dotnet-library</type> + </dependency> +</dependencies> +</project> ++---+ \ No newline at end of file Added: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/apt/usage.apt.vm URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/apt/usage.apt.vm?rev=1330742&view=auto ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/apt/usage.apt.vm (added) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/apt/usage.apt.vm Thu Apr 26 10:09:02 2012 @@ -0,0 +1,140 @@ +~~ Licensed to the Apache Software Foundation (ASF) under one +~~ or more contributor license agreements. See the NOTICE file +~~ distributed with this work for additional information +~~ regarding copyright ownership. The ASF licenses this file +~~ to you under the Apache License, Version 2.0 (the +~~ "License"); you may not use this file except in compliance +~~ with the License. You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, +~~ software distributed under the License is distributed on an +~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +~~ KIND, either express or implied. See the License for the +~~ specific language governing permissions and limitations +~~ under the License. + +~~ NOTE: For help withuses the syntax of this file, see: +~~ http://maven.apache.org/doxia/references/apt-format.html + +Using the NPanday Nuget Maven Plugin + +* Prerequisites + + The plugin should run out of the box, but will need to resolve these from a third-party repository. + If they can't be resolved, they must be downloaded and installed to the PATH manually. + + * {{{http://nuget.codeplex.com/}Nuget 1.7+, will be automatically resolved}} + + * {{{http://nuget.codeplex.com/}ManifestInfo 1.0+, will be automatically resolved}} + + +* Usage + + The library importer will find all <<<*.lib.xml>>> files in your directory and then resolve + all the listed packages. Afterwards it will try to resolve all references, generate the poms, + and then install and deploy the generated libraries+poms in the corresponding phases. + + The pom artifact, <<<test:libimporter>>> in this case, will not be installed or deployed. + +** Define the project + ++---+ +<?xml version="1.0" encoding="utf-8"?> +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>test</groupId> + <artifactId>libimporter</artifactId> + <version>1-SNAPSHOT</version> + <packaging>dotnet-library-importer</packaging> + + <build> + <plugins> + <plugin> + <groupId>org.apache.npanday.plugins</groupId> + <artifactId>library-importer-maven-plugin</artifactId> + <version>${project.version}</version> + <extensions>true</extensions> + </plugin> + </plugins> + </build> + + <!--<distributionManagement .../>--> + +</project> ++---+ + +** Add definitions on libraries/packages to import + ++---+ +<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"/> + </nuget> + <nuget> + <package>FluentAssertions</package> + <version source="1.7.1.1" mapTo="1.7.1"/> + <libDirs> + <default>net40</default> + </libDirs> + </nuget> + <nuget> + <package>FakeItEasy</package> + <version source="1.7.4257.42" mapTo="1.7.4257"/> + <libDirs> + <default>net40</default> + </libDirs> + </nuget> +</libs> ++---+ + +** Execution + + When executing with <<<mvn install>>> this will result in the following libraries to be installed. + ++---+ +/NUnit/nunit.framework/2.6.0/nunit.framework-2.6.0.dll +/NUnit/nunit.framework/2.6.0/nunit.framework-2.6.0.pom + +.. +.. ++---+ + +** Metadata mapping + + The library importer tries to extract as much information as possible and put it into the pom. + This will library dependencies both within the same and external to other packages. + ++---+ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <groupId>NUnit</groupId> + <artifactId>nunit.framework</artifactId> + <version>2.6.0</version> + <packaging>dotnet-library</packaging> + <name>NUnit :: nunit.framework</name> + <description>NUnit is a unit-testing framework for all .Net languages with a strong TDD focus.</description> + <licenses> + <license> + <url>http://nunit.org/nuget/license.html</url> + </license> + </licenses> + <developers> + <developer> + <name>Charlie Poole</name> + </developer> + </developers> +</project> ++---+ + +* Examples + + For further examples have a look at the integration tests for {{library-importer-maven-plugin}} + Added: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/site.xml URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/site.xml?rev=1330742&view=auto ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/site.xml (added) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/site/site.xml Thu Apr 26 10:09:02 2012 @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> +<project xmlns="http://maven.apache.org/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd"> + <body> + <menu ref="parent" /> + + <menu name="Overview"> + <item name="About" href="index.html"/> + <item name="Goals" href="plugin-info.html"/> + <item name="Usage" href="usage.html"/> + <item name="Nuget Mapping" href="nuget-mapping.html"/> + </menu> + + <menu ref="reports" /> + </body> +</project> Modified: incubator/npanday/trunk/plugins/pom.xml URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/pom.xml?rev=1330742&r1=1330741&r2=1330742&view=diff ============================================================================== --- incubator/npanday/trunk/plugins/pom.xml (original) +++ incubator/npanday/trunk/plugins/pom.xml Thu Apr 26 10:09:02 2012 @@ -58,6 +58,8 @@ <module>netplugins/NPanday.Plugin.SysRef/javabinding</module> <module>netplugins/NPanday.Plugin.Msbuild/javabinding</module> <module>silverlight-maven-plugin</module> + <!--module>nuget-maven-plugin</module--> + <module>library-importer-maven-plugin</module> </modules> <dependencies> <dependency> @@ -189,6 +191,7 @@ <projectsDirectory>src/it</projectsDirectory> <cloneProjectsTo>target/it</cloneProjectsTo> <showErrors>true</showErrors> + <debug>true</debug> <pomIncludes> <pomInclude>*/pom.xml</pomInclude> </pomIncludes> Modified: incubator/npanday/trunk/pom.xml URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/pom.xml?rev=1330742&r1=1330741&r2=1330742&view=diff ============================================================================== --- incubator/npanday/trunk/pom.xml (original) +++ incubator/npanday/trunk/pom.xml Thu Apr 26 10:09:02 2012 @@ -37,6 +37,7 @@ under the License. <properties> <mavenVersion>2.2.1</mavenVersion> <plexus.utils.version>1.5.15</plexus.utils.version> + <gmaven.version>1.2</gmaven.version> <!-- if you want to build NPanday with a specific version, replace this --> <!-- Note: this will cause problems trying to release the first time. We can do @@ -379,7 +380,7 @@ under the License. <plugin> <groupId>org.codehaus.gmaven</groupId> <artifactId>gmaven-plugin</artifactId> - <version>1.2</version> + <version>${gmaven.version}</version> <executions> <execution> <id>groovy-tests</id>
