nbback
diff --git a/nb-repository-plugin/.asf.yaml b/nb-repository-plugin/.asf.yaml
new file mode 100644
index 0000000..a440864
--- /dev/null
+++ b/nb-repository-plugin/.asf.yaml
@@ -0,0 +1,33 @@
+# 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.
+
+github:
+  description: "Apache NetBeans Maven Utils to populate repository with Apache Maven NetBeans bits"
+  homepage: https://netbeans.apache.org/
+  labels:
+    - netbeans
+  features:
+    wiki: false
+    issues: false
+    projects: false
+  enabled_merge_buttons:
+    squash:  true
+    merge:   true
+    rebase:  true
+notifications:
+    commits:      commits@netbeans.apache.org
+    issues:       notifications@netbeans.apache.org
+    pullrequests: notifications@netbeans.apache.org
diff --git a/nb-repository-plugin/.github/dependabot.yml b/nb-repository-plugin/.github/dependabot.yml
new file mode 100644
index 0000000..06f98d8
--- /dev/null
+++ b/nb-repository-plugin/.github/dependabot.yml
@@ -0,0 +1,25 @@
+# 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.
+
+version: 2
+updates:
+  - package-ecosystem: "maven"
+    directory: "/"
+    target-branch: "master"
+    schedule:
+      interval: "daily"
+
diff --git a/nb-repository-plugin/.gitignore b/nb-repository-plugin/.gitignore
new file mode 100644
index 0000000..6dd1416
--- /dev/null
+++ b/nb-repository-plugin/.gitignore
@@ -0,0 +1,3 @@
+/target/
+/nbactions.xml
+/nb-configuration.xml
\ No newline at end of file
diff --git a/nb-repository-plugin/Jenkinsfile.groovy b/nb-repository-plugin/Jenkinsfile.groovy
new file mode 100644
index 0000000..6eb19ef
--- /dev/null
+++ b/nb-repository-plugin/Jenkinsfile.groovy
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+asfStandardUtilitiesBuild()
diff --git a/nb-repository-plugin/LICENSE b/nb-repository-plugin/LICENSE
new file mode 100644
index 0000000..de4b130
--- /dev/null
+++ b/nb-repository-plugin/LICENSE
@@ -0,0 +1,204 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
+
+
diff --git a/nb-repository-plugin/NOTICE b/nb-repository-plugin/NOTICE
new file mode 100755
index 0000000..80bd77e
--- /dev/null
+++ b/nb-repository-plugin/NOTICE
@@ -0,0 +1,13 @@
+Apache NetBeans Utilities
+Copyright 2018-2022 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+The code is based on Mojohaus Maven Utilities, that has been kindly donated to the Apache
+Software Foundation by Mojohaus Maven Utilities.
+
+Inceptor of the tools was Milos Kleint from the Mojohaus Maven Utilities in 2006
+Import was done from: https://github.com/mojohaus/nbm-maven-plugin/tree/80021ab48705a199513abdf2ad9fc339a8c000e2
+
+
diff --git a/nb-repository-plugin/README.md b/nb-repository-plugin/README.md
new file mode 100755
index 0000000..49eccea
--- /dev/null
+++ b/nb-repository-plugin/README.md
@@ -0,0 +1,37 @@
+<!--
+
+    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.
+
+-->
+
+# Apache NetBeans Repository plugin
+
+[![Build Status](https://ci-builds.apache.org/buildStatus/icon?job=Netbeans%2Fnetbeans-maven-TLP%2Fnetbeans-mavenutils-nb-repository-plugin%2Fmaster)](https://ci-builds.apache.org/job/Netbeans/job/netbeans-maven-TLP/job/netbeans-mavenutils-nb-repository-plugin/job/master/)
+
+[Documentation Site](https://bits.netbeans.org/mavenutilities/nb-repository-plugin)
+
+### Get In Touch
+
+[Subscribe](mailto:users-subscribe@netbeans.apache.org) or [mail](mailto:users@netbeans.apache.org) the [users@netbeans.apache.org](mailto:users@netbeans.apache.org) list - Ask questions, find answers, and also help other users.
+
+[Subscribe](mailto:dev-subscribe@netbeans.apache.org) or [mail](mailto:dev@netbeans.apache.org) the [dev@netbeans.apache.org](mailto:dev@netbeans.apache.org) list - Join developement discussions, propose new ideas and connect with contributors.
+
+### Reporting Bugs
+
+Bugs should be reported to https://issues.apache.org/jira/projects/NETBEANSINFRA/issues/ using the component **MU - Apache NetBeans repository plugin**
+
diff --git a/nb-repository-plugin/pom.xml b/nb-repository-plugin/pom.xml
new file mode 100644
index 0000000..8b92b13
--- /dev/null
+++ b/nb-repository-plugin/pom.xml
@@ -0,0 +1,384 @@
+<?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/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/xsd/maven-4.0.0.xsd">
+    <parent>
+        <groupId>org.apache.netbeans.utilities</groupId>
+        <artifactId>utilities-parent</artifactId>
+        <version>2</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>nb-repository-plugin</artifactId>
+    <version>1.8-SNAPSHOT</version>
+    <packaging>maven-plugin</packaging>
+
+    <name>Apache NetBeans Maven Utilities - NB Repository Plugin</name>
+    <description>Maven plugin for creating Maven Repository out of a NetBeans installation (and other sources) for consumption by the projects using nbm-maven-plugin.
+    </description>
+    <inceptionYear>2005</inceptionYear>
+    <url>https://bits.netbeans.org/mavenutilities/nb-repository-plugin</url>
+    <issueManagement>
+        <system>jira</system>
+        <url>https://issues.apache.org/jira/browse/NETBEANSINFRA</url>
+    </issueManagement>
+    <prerequisites>
+        <maven>3.1.1</maven>
+    </prerequisites>
+    <licenses>
+        <license>
+            <name>Apache License 2</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+            <distribution>repo</distribution>
+        </license>
+    </licenses>
+    <scm>
+        <connection>scm:git:https://gitbox.apache.org/repos/asf/netbeans-mavenutils-nb-repository-plugin.git</connection>
+        <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/netbeans-mavenutils-nb-repository-plugin.git</developerConnection>
+        <url>https://github.com/apache/netbeans-mavenutils-nb-repository-plugin</url>
+      <tag>HEAD</tag>
+    </scm>
+    <!-- TODO need to override parent version value... I suppose this will eventually end up in mojo parent pom, check regularly -->    
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-checkstyle-plugin</artifactId>
+                    <version>3.1.2</version>
+                    <dependencies>
+                        <dependency>
+                            <groupId>com.puppycrawl.tools</groupId>
+                            <artifactId>checkstyle</artifactId>
+                            <!-- last jdk 8 compatible version -->
+                            <version>9.3</version>
+                        </dependency>
+                    </dependencies>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+        <plugins>
+            <plugin>
+                <!-- TODO need to override parent version value... I suppose this will eventually end up in mojo parent pom, check regularly -->
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-plugin-plugin</artifactId>
+                <version>3.6.4</version>
+                <configuration>
+                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>mojo-descriptor</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>descriptor</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>help-goal</id>
+                        <goals>
+                            <goal>helpmojo</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>animal-sniffer-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                        <configuration>
+                            <signature>
+                                <groupId>org.codehaus.mojo.signature</groupId>
+                                <artifactId>java18</artifactId>
+                                <version>1.0</version>
+                            </signature>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-site-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-project-info-reports-plugin</artifactId>
+                <reportSets>
+                    <reportSet>
+                        <reports>
+                            <report>plugins</report>
+                            <!-- <report>cim</report> -->
+                        </reports>
+                    </reportSet>
+                </reportSets>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-changes-plugin</artifactId>
+                <configuration>
+                    <!-- configure github milestone ? -->
+                    <!--<onlyMilestoneIssues>false</onlyMilestoneIssues>
+                    <onlyCurrentVersion>false</onlyCurrentVersion>-->
+                    <!--<skip>true</skip>-->
+                    <component>12336704</component>
+                </configuration>
+               
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>                           
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jxr-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-plugin-plugin</artifactId>
+                <version>3.6.4</version>
+                <configuration>
+                    <requirements>
+                        <!--
+                        NOTE: Maven 2.x does not interpolate properties of the form project.*|pom.* so the Maven Plugin Plugin
+                        gets garbage when manually examining the config of the Maven Compiler Plugin.
+                        -->
+                        <jdk>${mojo.java.target}</jdk>
+                    </requirements>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <configuration>
+                    <quiet>true</quiet>
+                    <source>8</source>
+                    <links>
+                        <!--<link>http://download-llnw.oracle.com/javaee/1.4/api/</link>-->
+                        <link>https://commons.apache.org/proper/commons-collections/javadocs/api-3.2.2/</link>
+                        <link>http://commons.apache.org/dbcp/apidocs/</link>
+                        <link>http://commons.apache.org/fileupload/apidocs/</link>
+                        <link>http://commons.apache.org/logging/apidocs/</link>
+                        <link>http://commons.apache.org/pool/apidocs/</link>
+                        <link>http://junit.sourceforge.net/javadoc/</link>
+                        <link>http://logging.apache.org/log4j/1.2/apidocs/</link>
+                        <!-- unreachable site <link>http://jakarta.apache.org/regexp/apidocs/</link> -->
+                        <link>https://velocity.apache.org/engine/1.5/apidocs/</link>
+                        <link>http://maven.apache.org/ref/${maven.version}/maven-artifact/apidocs/</link>
+                        <link>http://maven.apache.org/ref/${maven.version}/maven-model/apidocs/</link>
+                        <link>http://maven.apache.org/ref/${maven.version}/maven-plugin-api/apidocs/</link>
+                        <link>https://maven.apache.org/shared/maven-reporting-api/apidocs/</link>
+                        <link>http://maven.apache.org/ref/${maven.version}/maven-settings/apidocs/</link>
+                    </links>
+                    <tagletArtifacts>
+                        <tagletArtifact>
+                            <groupId>org.apache.maven.plugin-tools</groupId>
+                            <artifactId>maven-plugin-tools-javadoc</artifactId>
+                        </tagletArtifact>
+                        <tagletArtifact>
+                            <groupId>org.codehaus.plexus</groupId>
+                            <artifactId>plexus-component-javadoc</artifactId>
+                            <version>1.6</version>
+                        </tagletArtifact>
+                    </tagletArtifacts>
+                </configuration>
+               
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-pmd-plugin</artifactId>
+               <configuration>
+                    <targetJdk>1.8</targetJdk>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-linkcheck-plugin</artifactId>
+                <configuration>
+                    <excludedLinks>
+                        <excludedLink>../../images/codehaus-small.png</excludedLink>
+                        <excludedLink>../../images/mojo_logo.png</excludedLink>
+                        <excludedLink>plugin-info.html</excludedLink>
+                    </excludedLinks>
+                    <!--<excludedPages>
+                        <excludedPage>dependencies.html</excludedPage> 
+                    </excludedPages>-->
+                </configuration>	       
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>taglist-maven-plugin</artifactId>
+                <version>3.0.0</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <version>0.13</version>
+            </plugin>
+        </plugins>
+    </reporting>
+    <profiles>
+        <profile>
+            <id>run-its</id>
+            <build>
+
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-invoker-plugin</artifactId>
+                        <version>3.3.0</version>
+                        <configuration>
+                            <debug>false</debug>
+                            <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+                            <pomIncludes>
+                                <pomInclude>*/pom.xml</pomInclude>
+                            </pomIncludes>
+                            <postBuildHookScript>verify</postBuildHookScript>
+                            <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+                            <settingsFile>src/it/settings.xml</settingsFile>
+                            <goals>
+                                <!-- default build in netbeans IDE -->
+                                <goal>clean</goal>
+                                <goal>install</goal>
+                            </goals>
+                            <filterProperties>
+                                <netbeans.version>RELEASE110</netbeans.version> 
+                            </filterProperties>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>integration-test</id>
+                                <goals>
+                                    <goal>install</goal>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+
+            </build>
+        </profile>
+    </profiles>
+    <!--profiles>
+        <profile>
+            <id>tools.jar</id>
+            <activation>
+                <file>
+                    <exists>${java.home}/../lib/tools.jar</exists>
+                </file>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>com.sun</groupId>
+                    <artifactId>tools</artifactId>
+                    <version>1.5.0</version>
+                    <scope>system</scope>
+                    <systemPath>${java.home}/../lib/tools.jar</systemPath>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles-->
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-plugin-api</artifactId>
+            <version>${maven.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven.plugin-tools</groupId>
+            <artifactId>maven-plugin-annotations</artifactId>
+            <version>3.6.4</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.plexus</groupId>
+            <artifactId>plexus-utils</artifactId>
+            <version>3.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-model</artifactId>
+            <version>${maven.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-core</artifactId>
+            <version>${maven.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven.plugin-testing</groupId>
+            <artifactId>maven-plugin-testing-harness</artifactId>
+            <version>3.3.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-compat</artifactId>
+            <version>${maven.version}</version>
+            <type>jar</type>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>1.10.12</version>
+            <scope>compile</scope>
+            <type>jar</type>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>nb-shared</artifactId>
+            <version>1.4</version>
+        </dependency>
+    </dependencies>
+    <properties>
+        <mojo.java.target>1.8</mojo.java.target>
+        <maven.version>3.8.5</maven.version>
+    </properties>
+</project>
diff --git a/nb-repository-plugin/src/it/folder/pom.xml b/nb-repository-plugin/src/it/folder/pom.xml
new file mode 100644
index 0000000..6013933
--- /dev/null
+++ b/nb-repository-plugin/src/it/folder/pom.xml
@@ -0,0 +1,47 @@
+<?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/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/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.netbeans.utilities</groupId>
+        <artifactId>nb-repository-plugin-it-root</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>nb-repository-plugin-it-single-module</artifactId>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.netbeans.utilities</groupId>
+                <artifactId>nb-repository-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>install</phase>
+                        <goals>
+                            <goal>download</goal>
+                        </goals>
+                        <configuration>
+                            <nexusIndexDirectory>${project.build.directory}/indextest</nexusIndexDirectory>
+                            <repositoryUrl>https://repo1.maven.org/maven2</repositoryUrl>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file
diff --git a/nb-repository-plugin/src/it/pom.xml b/nb-repository-plugin/src/it/pom.xml
new file mode 100644
index 0000000..fd5d5d2
--- /dev/null
+++ b/nb-repository-plugin/src/it/pom.xml
@@ -0,0 +1,53 @@
+<?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/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/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.netbeans.utilities</groupId>
+    <artifactId>nb-repository-plugin-it-root</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+  
+    <build>
+        <pluginManagement>
+            <plugins>
+               
+                <plugin>  
+                    <groupId>@project.groupId@</groupId>
+                    <artifactId>@project.artifactId@</artifactId>  
+                    <version>@project.version@</version>
+                </plugin>
+                <!--<plugin>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <version>@compilerPluginVersion@</version>
+                    <configuration>
+                        <source>@testJavaVersion@</source>
+                        <target>@testJavaVersion@</target>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <version>@surefirePluginVersion@</version>
+                </plugin>-->
+            </plugins>
+        </pluginManagement>
+    </build>
+    <properties>
+        <jar.plugin.version>3.0.2</jar.plugin.version>
+    </properties>
+</project>
\ No newline at end of file
diff --git a/nb-repository-plugin/src/it/settings.xml b/nb-repository-plugin/src/it/settings.xml
new file mode 100644
index 0000000..5ee363c
--- /dev/null
+++ b/nb-repository-plugin/src/it/settings.xml
@@ -0,0 +1,55 @@
+<?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.
+-->
+
+<settings>
+    <profiles>
+        <profile>
+            <id>it-repo</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <repositories>
+                <repository>
+                    <id>local.central</id>
+                    <url>@localRepositoryUrl@</url>
+                    <releases>
+                        <enabled>true</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>true</enabled>
+                    </snapshots>
+                </repository>
+            </repositories>
+            <pluginRepositories>
+                <pluginRepository>
+                    <id>local.central</id>
+                    <url>@localRepositoryUrl@</url>
+                    <releases>
+                        <enabled>true</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>true</enabled>
+                    </snapshots>
+                </pluginRepository>
+            </pluginRepositories>
+        </profile>
+    </profiles>
+</settings>
diff --git a/nb-repository-plugin/src/main/java/org/apache/netbeans/nbm/repository/PopulateRepositoryMojo.java b/nb-repository-plugin/src/main/java/org/apache/netbeans/nbm/repository/PopulateRepositoryMojo.java
new file mode 100644
index 0000000..cb2ac49
--- /dev/null
+++ b/nb-repository-plugin/src/main/java/org/apache/netbeans/nbm/repository/PopulateRepositoryMojo.java
@@ -0,0 +1,1357 @@
+package org.apache.netbeans.nbm.repository;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.nio.file.Files;
+import java.security.DigestOutputStream;
+import java.security.MessageDigest;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+import java.util.jar.Attributes;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.deployer.ArtifactDeployer;
+import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.artifact.installer.ArtifactInstallationException;
+import org.apache.maven.artifact.installer.ArtifactInstaller;
+import org.apache.maven.artifact.metadata.ArtifactMetadata;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
+import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
+import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
+import org.apache.maven.artifact.resolver.AbstractArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.artifact.AttachedArtifact;
+import org.apache.maven.project.artifact.ProjectArtifactMetadata;
+import org.apache.netbeans.nbm.utils.AbstractNetbeansMojo;
+import org.apache.netbeans.nbm.utils.ExamineManifest;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Input;
+import org.apache.tools.ant.taskdefs.PathConvert;
+import org.apache.tools.ant.types.FileSet;
+import org.codehaus.plexus.util.IOUtil;
+
+/**
+ * A goal for identifying NetBeans modules from the installation and populating the local
+ * repository with them. Optionally you can also deploy to a remote repository.
+ * <p>
+ * If you are looking for an existing remote repository for NetBeans artifacts, check out <a href="https://search.maven.org/">Maven Central</a>.
+ * <a href="http://bits.netbeans.org/nexus/content/groups/netbeans/">http://bits.netbeans.org/nexus/content/groups/netbeans/</a>,
+ * contains contains API artifacts for older NetBeans releases.
+ * <a href="https://repository.apache.org/content/groups/snapshots">https://repository.apache.org/content/groups/snapshots</a>
+ * may also be used for <code>dev-SNAPSHOT</code> artifacts if you wish to test development builds.
+ * </p>
+ * <p>
+ * See this <a href="repository.html">HOWTO</a> on how to generate the NetBeans binaries required
+ * by this goal.
+ * </p>
+ *
+ * @author Milos Kleint
+ */
+@Mojo( name = "populate", aggregator = true, requiresProject = false )
+public class PopulateRepositoryMojo
+    extends AbstractNetbeansMojo
+{
+    private static final String GROUP_API = ".api";
+    private static final String GROUP_IMPL = ".modules";
+    private static final String GROUP_EXTERNAL = ".external";
+    private static final String GROUP_CLUSTER = ".cluster";
+
+
+    /**
+     * a prefix for groupId of generated content,
+     * eg. for org.netbeans value will generate org.netbeans.cluster groupId for clusters and org.netbeans.modules for module artifacts.
+     * @since 1.2
+     */
+    @Parameter( property = "groupIdPrefix", defaultValue = "org.netbeans" )
+    private String groupIdPrefix;
+
+    /**
+     * an url where to deploy the NetBeans artifacts. Optional, if not specified, the artifacts will be only installed
+     * in local repository, if you need to give credentials to access remote repo, the id of the server is hardwired to "netbeans".
+     */
+    @Parameter( property = "deployUrl" )
+    private String deployUrl;
+
+    /**
+     * an string id representing the server
+     */
+    @Parameter( defaultValue = "netbeans" , property = "deployId" )
+    private String deployId;
+
+    /**
+     * By default the generated metadata is installed in local repository.
+     * Setting this parameter to false will avoid installing the bits. Only meaningful together with
+     * a defined "deployUrl" parameter.
+     * @since 3.0
+     */
+    @Parameter( defaultValue = "false", property = "skipInstall" )
+    private boolean skipLocalInstall;
+
+
+    /**
+     * Location of NetBeans installation
+     */
+    @Parameter( property = "netbeansInstallDirectory", required = true )
+    protected File netbeansInstallDirectory;
+
+    /**
+     * If you want to install/deploy also NetBeans api javadocs, download the javadoc zip file from netbeans.org
+     * expand it to a directory, it should contain multiple zip files. Define this parameter as absolute path to the zip files folder.
+     *
+     */
+    @Parameter( property = "netbeansJavadocDirectory" )
+    protected File netbeansJavadocDirectory;
+
+    /**
+     * Assumes a folder with &lt;code-name-base&gt;.zip files containing sources for modules.
+     */
+    @Parameter( property = "netbeansSourcesDirectory" )
+    protected File netbeansSourcesDirectory;
+
+    /**
+     * If defined, will match the nbm files found in the designated folder with the modules
+     * and upload the nbm file next to the module jar in local and remote repositories.
+     *
+     * Assumes a folder with &lt;code-name-base&gt;.nbm files containing nbm files for modules.
+     * @since 3.0
+     */
+    @Parameter( property = "netbeansNbmDirectory", required = true )
+    protected File netbeansNbmDirectory;
+
+    /**
+     * When specified, will force all modules to have the designated version.
+     * Good when depending on releases. Then you would for example specify RELEASE50 in this parameter and
+     * all modules get this version in the repository. If not defined, the maven version is
+     * derived from the OpenIDE-Module-Specification-Version manifest attribute.
+     * <p>
+     * Highly Recommended!
+     * </p>
+     */
+    @Parameter( property = "forcedVersion" )
+    protected String forcedVersion;
+
+    /**
+     * When specified it points to a file containing a merge of all binaries-list
+     * sha1;coordinate;module
+     * Any dependencies not found this way, will be generated with a unique
+     * id under the org.netbeans.external groupId.
+     * <p/>
+     * @since 1.16
+     */
+    @Parameter( property = "externallist" )
+    private File externallist;
+
+    /**
+     * Whether to create cluster POMs in the {@code org.netbeans.cluster} group.
+     * Only meaningful when {@code forcedVersion} is defined.
+     * @since 3.7
+     */
+    @Parameter( defaultValue = "true", property = "defineCluster" )
+    private boolean defineCluster;
+
+    /**
+     * Optional remote repository to use for inspecting remote dependencies.
+     * This may be used to populate just part of an installation,
+     * when base modules are already available in Maven format.
+     * Currently only supported when {@code forcedVersion} is defined.
+     * @since 3.7
+     */
+    @Parameter( property = "dependencyRepositoryUrl" )
+    private String dependencyRepositoryUrl;
+
+    /**
+     * Repository ID to use when inspecting remote dependencies.
+     * Only meaningful when {@code dependencyRepositoryUrl} is defined.
+     * @since 3.7
+     */
+    @Parameter( defaultValue = "temp", property = "dependencyRepositoryId" )
+    private String dependencyRepositoryId;
+
+    /**
+     * Colon separated artefact coordinate groupId:artefactId:version that
+     * represent parent to be used
+     *
+     * @since 1.4
+     */
+    @Parameter( property = "parentGAV", required = false )
+    private String parentGAV;
+
+    // <editor-fold defaultstate="collapsed" desc="Component parameters">
+    /**
+     * Local maven repository.
+     */
+    @Parameter( required = true, readonly = true, defaultValue = "${localRepository}" )
+    protected ArtifactRepository localRepository;
+
+    /**
+     * Maven ArtifactFactory.
+     */
+    @Component
+    private ArtifactFactory artifactFactory;
+
+    /**
+     * Maven ArtifactInstaller.
+     */
+    @Component
+    private ArtifactInstaller artifactInstaller;
+
+    /**
+     * Maven ArtifactDeployer.
+     *
+     */
+    @Component
+    private ArtifactDeployer artifactDeployer;
+
+    /**
+     * Maven ArtifactHandlerManager
+     *
+     */
+    @Component
+    private ArtifactHandlerManager artifactHandlerManager;
+
+    /**
+     * Maven ArtifactRepositoryFactory.
+     *
+     */
+    @Component
+    private ArtifactRepositoryFactory repositoryFactory;
+
+    @Component
+    private ArtifactResolver artifactResolver;
+
+    @Component
+    private ArtifactRepositoryLayout artifactRepositoryLayout;
+// </editor-fold>
+
+    // parent handler in case we have one
+    private Parent artefactParent = null;
+
+    @Override
+    public void execute()
+        throws MojoExecutionException
+    {
+        getLog().info( "Populate repository with NetBeans modules" );
+        Project antProject = antProject();
+        ArtifactRepository deploymentRepository = null;
+
+        if ( parentGAV != null )
+        {
+            // populate artefactParent
+            artefactParent = new Parent();
+            String[] split = parentGAV.split( ":" );
+            if ( split.length != 3 )
+            {
+                throw new MojoExecutionException(
+                    "parentGAV should respect the following format groupId:artefactId:version" );
+            }
+            artefactParent.setGroupId( split[0] );
+            artefactParent.setArtifactId( split[1] );
+            artefactParent.setVersion( split[2] );
+        }
+
+        if ( deployUrl != null )
+        {
+            ArtifactRepositoryLayout layout = new DefaultRepositoryLayout();
+            deploymentRepository = repositoryFactory.createDeploymentArtifactRepository(
+                deployId, deployUrl, layout, true );
+        }
+        else if ( skipLocalInstall )
+        {
+            throw new MojoExecutionException(
+                    "When skipping install to local repository, one shall define the deployUrl parameter" );
+        }
+
+        if ( netbeansInstallDirectory == null )
+        {
+            Input input = (Input) antProject.createTask( "input" );
+            input.setMessage( "Please enter NetBeans installation directory:" );
+            input.setAddproperty( "installDir" );
+            try
+            {
+                input.execute();
+            }
+            catch ( BuildException e )
+            {
+                getLog().error( "Cannot run ant:input" );
+                throw new MojoExecutionException( e.getMessage(), e );
+            }
+            String prop = antProject.getProperty( "installDir" );
+            netbeansInstallDirectory = new File( prop );
+        }
+
+        File rootDir = netbeansInstallDirectory;
+        if ( !rootDir.exists() )
+        {
+            getLog().error( "NetBeans installation doesn't exist." );
+            throw new MojoExecutionException( "NetBeans installation doesn't exist." );
+        }
+        getLog().info( "Copying NetBeans artifacts from " + netbeansInstallDirectory );
+
+        PathConvert convert = (PathConvert) antProject.createTask( "pathconvert" );
+        convert.setPathSep( "," );
+        convert.setProperty( "netbeansincludes" );
+        FileSet set = new FileSet();
+        set.setDir( rootDir );
+        set.createInclude().setName( "**/modules/*.jar" );
+        set.createInclude().setName( "*/core/*.jar" );
+        set.createInclude().setName( "platform*/lib/*.jar" );
+
+        convert.createPath().addFileset( set );
+        try
+        {
+            convert.execute();
+        }
+        catch ( BuildException e )
+        {
+            getLog().error( "Cannot run ant:pathconvert" );
+            throw new MojoExecutionException( e.getMessage(), e );
+        }
+
+        String prop = antProject.getProperty( "netbeansincludes" );
+        StringTokenizer tok = new StringTokenizer( prop, "," );
+        Map<ModuleWrapper, Artifact> moduleDefinitions = new HashMap<>();
+        Map<String, Collection<ModuleWrapper>> clusters = new HashMap<>();
+        while ( tok.hasMoreTokens() )
+        {
+            String token = tok.nextToken();
+            File module = new File( token );
+            String clust = module.getAbsolutePath().substring( rootDir.getAbsolutePath().length() + 1 );
+            clust = clust.substring( 0, clust.indexOf( File.separator ) );
+            ExamineManifest examinator = new ExamineManifest( getLog() );
+            examinator.setPopulateDependencies( true );
+            examinator.setJarFile( module );
+            examinator.checkFile();
+            if ( examinator.isNetBeansModule() || examinator.isOsgiBundle() )
+            {
+                //TODO get artifact id from the module's manifest?
+                String artifact = module.getName().substring( 0, module.getName().indexOf( ".jar" ) );
+                if ( "boot".equals( artifact ) )
+                {
+                    artifact = "org-netbeans-bootstrap";
+                }
+                if ( "core".equals( artifact ) )
+                {
+                    artifact = "org-netbeans-core-startup";
+                }
+                if ( "core-base".equals( artifact ) )
+                {
+                    artifact = "org-netbeans-core-startup-base";
+                }
+                String version = forcedVersion == null ? examinator.getSpecVersion() : forcedVersion;
+                String group = groupIdPrefix + ( examinator.isOsgiBundle() ? GROUP_EXTERNAL : examinator.hasPublicPackages() ? GROUP_API : GROUP_IMPL );
+                Artifact art = createArtifact( artifact, version, group );
+                ModuleWrapper wr = new ModuleWrapper( artifact, version, group, examinator, module );
+                if ( examinator.isOsgiBundle() )
+                {
+                    Dependency dep = findExternal( module );
+                    if ( dep != null )
+                    {
+
+                        art = createArtifact( dep.getArtifactId(), dep.getVersion(), dep.getGroupId() );
+                        group = dep.getGroupId();
+                        version = dep.getVersion();
+                        wr = new ModuleWrapperMaven( artifact, version, group, examinator, module , dep );
+                    }
+                }
+                wr.setCluster( clust );
+                moduleDefinitions.put( wr, art );
+                Collection<ModuleWrapper> col = clusters.get( clust );
+                if ( col == null )
+                {
+                    col = new ArrayList<>();
+                    clusters.put( clust, col );
+                }
+                col.add( wr );
+            }
+        }
+
+        File javadocRoot = null;
+        if ( netbeansJavadocDirectory != null )
+        {
+            javadocRoot = netbeansJavadocDirectory ;
+            if ( !javadocRoot.exists() )
+            {
+                javadocRoot = null;
+                throw new MojoExecutionException(
+                    "The netbeansJavadocDirectory parameter doesn't point to an existing folder" );
+            }
+        }
+        File sourceRoot = null;
+        if ( netbeansSourcesDirectory != null )
+        {
+            sourceRoot = netbeansSourcesDirectory;
+            if ( !sourceRoot.exists() )
+            {
+                sourceRoot = null;
+                throw new MojoExecutionException(
+                    "The netbeansSourceDirectory parameter doesn't point to an existing folder" );
+            }
+        }
+
+        File nbmRoot = null;
+        if ( netbeansNbmDirectory != null )
+        {
+            nbmRoot = netbeansNbmDirectory;
+            if ( !nbmRoot.exists() )
+            {
+                nbmRoot = null;
+                throw new MojoExecutionException(
+                    "The nbmDirectory parameter doesn't point to an existing folder" );
+            }
+        }
+        List<ModuleWrapper> wrapperList = new ArrayList<>( moduleDefinitions.keySet() );
+        // artifact that we need to populate
+        Map<ModuleWrapper, Artifact> tobePopulated = new HashMap<>();
+        // external artefacts
+        Map<ModuleWrapper, Artifact> oncentralWrapper = new HashMap<>();
+        // triage
+        for ( Map.Entry<ModuleWrapper, Artifact> entry : moduleDefinitions.entrySet() )
+        {
+            if ( entry.getKey() instanceof ModuleWrapperMaven )
+            {
+                oncentralWrapper.put( entry.getKey(), entry.getValue() );
+            }
+            else
+            {
+                tobePopulated.put( entry.getKey(), entry.getValue() );
+            }
+        }
+        List<ExternalsWrapper> externals = new ArrayList<>();
+        int count = tobePopulated.size() + 1;
+        int index = 0;
+
+
+        try
+        {
+            for ( Map.Entry<ModuleWrapper, Artifact> elem : tobePopulated.entrySet() )
+            {
+                ModuleWrapper man = elem.getKey();
+                Artifact art = elem.getValue();
+                index = index + 1;
+                getLog().info( "Processing " + index + "/" + count );
+                File pom = createMavenProject( man, wrapperList, externals );
+                ArtifactMetadata metadata = new ProjectArtifactMetadata( art, pom );
+                art.addMetadata( metadata );
+                File javadoc = null;
+                Artifact javadocArt = null;
+                if ( javadocRoot != null )
+                {
+                    File zip = new File( javadocRoot, art.getArtifactId() + ".zip" );
+                    if ( zip.exists() )
+                    {
+                        javadoc = zip;
+                        javadocArt = createAttachedArtifact( art, javadoc, "jar", "javadoc" );
+                    }
+                }
+                File source = null;
+                Artifact sourceArt = null;
+                if ( sourceRoot != null )
+                {
+                    File zip = new File( sourceRoot, art.getArtifactId() + ".zip" );
+                    if ( zip.exists() )
+                    {
+                        source = zip;
+                        sourceArt = createAttachedArtifact( art, source, "jar", "sources" );
+                    }
+                }
+                File nbm = null;
+                Artifact nbmArt = null;
+                if ( nbmRoot != null )
+                {
+                    File zip = new File( nbmRoot, art.getArtifactId() + ".nbm" );
+
+                    if ( !zip.exists() )
+                    {
+                        zip = new File( nbmRoot,
+                            man.getCluster() + File.separator + art.getArtifactId() + ".nbm" );
+                    }
+                    if ( zip.exists() )
+                    {
+                        nbm = zip;
+                        nbmArt = createAttachedArtifact( art, nbm, "nbm-file", null );
+                        if ( nbmArt.getArtifactHandler().getExtension().equals( "nbm-file" ) )
+                        {
+                            // Maven 2.x compatibility.
+                            nbmArt = createAttachedArtifact( art, nbm, "nbm", null );
+                        }
+                        assert nbmArt.getArtifactHandler().getExtension().equals( "nbm" );
+                    }
+                }
+                File moduleJar = man.getFile();
+                File moduleJarMinusCP = null;
+                if ( ! man.getModuleManifest().getClasspath().isEmpty() )
+                {
+                    try
+                    {
+                        moduleJarMinusCP = File.createTempFile( man.getArtifact(), ".jar" );
+                        moduleJarMinusCP.deleteOnExit();
+                        InputStream is = new FileInputStream( moduleJar );
+                        try
+                        {
+                            OutputStream os = new FileOutputStream( moduleJarMinusCP );
+                            try
+                            {
+                                JarInputStream jis = new JarInputStream( is );
+                                Manifest mani = new Manifest( jis.getManifest() );
+                                mani.getMainAttributes().remove( Attributes.Name.CLASS_PATH );
+                                if ( !man.deps.isEmpty() )
+                                { // MNBMODULE-132
+                                    StringBuilder b = new StringBuilder();
+                                    for ( Dependency dep : man.deps )
+                                    {
+                                        if ( b.length() > 0 )
+                                        {
+                                            b.append( ' ' );
+                                        }
+                                        b.append( dep.getGroupId() ).append( ':' ).append( dep.getArtifactId() ).append( ':' ).append( dep.getVersion() );
+                                        if ( dep.getClassifier() != null )
+                                        {
+                                            b.append( ":" ).append( dep.getClassifier() );
+                                        }
+                                    }
+                                    mani.getMainAttributes().putValue( "Maven-Class-Path", b.toString() );
+                                }
+                                else
+                                {
+                                    getLog().warn( "did not find any external artifacts for " + man.getModule() );
+                                }
+                                JarOutputStream jos = new JarOutputStream( os, mani );
+                                JarEntry entry;
+                                while ( ( entry = jis.getNextJarEntry() ) != null )
+                                {
+                                    if ( entry.getName().matches( "META-INF/.+[.]SF" ) )
+                                    {
+                                        throw new IOException( "cannot handle signed JARs" );
+                                    }
+                                    jos.putNextEntry( entry );
+                                    byte[] buf = new byte[(int) entry.getSize()];
+                                    int read = jis.read( buf, 0, buf.length );
+                                    if ( read != buf.length )
+                                    {
+                                        throw new IOException( "read wrong amount" );
+                                    }
+                                    jos.write( buf );
+                                }
+                                jos.close();
+                            }
+                            finally
+                            {
+                                os.close();
+                            }
+                        }
+                        finally
+                        {
+                            is.close();
+                        }
+                    }
+                    catch ( IOException x )
+                    {
+                        getLog().warn( "Could not process " + moduleJar + ": " + x, x );
+                        moduleJarMinusCP.delete();
+                        moduleJarMinusCP = null;
+                    }
+                }
+                try
+                {
+                    if ( !skipLocalInstall )
+                    {
+                        install( moduleJarMinusCP != null ? moduleJarMinusCP : moduleJar, art );
+                        if ( javadoc != null )
+                        {
+                            install( javadoc, javadocArt );
+                        }
+                        if ( source != null )
+                        {
+                            install( source, sourceArt );
+                        }
+                        if ( nbm != null )
+                        {
+                            install( nbm, nbmArt );
+                        }
+                    }
+                    try
+                    {
+                        if ( deploymentRepository != null )
+                        {
+                            artifactDeployer.deploy( moduleJarMinusCP != null ? moduleJarMinusCP : moduleJar, art,
+                                                     deploymentRepository, localRepository );
+                            if ( javadoc != null )
+                            {
+                                artifactDeployer.deploy( javadoc, javadocArt, deploymentRepository, localRepository );
+                            }
+                            if ( source != null )
+                            {
+                                artifactDeployer.deploy( source, sourceArt, deploymentRepository, localRepository );
+                            }
+                            if ( nbm != null )
+                            {
+                                artifactDeployer.deploy( nbm, nbmArt, deploymentRepository, localRepository );
+                            }
+                        }
+                    }
+                    catch ( ArtifactDeploymentException ex )
+                    {
+                        throw new MojoExecutionException( "Error Deploying artifact", ex );
+                    }
+                }
+                finally
+                {
+                    if ( moduleJarMinusCP != null )
+                    {
+                        moduleJarMinusCP.delete();
+                    }
+                }
+            }
+        }
+        finally
+        {
+            /*if ( searcher != null )
+            {
+                try
+                {
+                    searcher.close();
+                }
+                catch ( IOException ex )
+                {
+                    getLog().error( ex );
+                }
+            }*/
+        }
+
+        //process collected non-recognized external jars..
+        if ( externals.size() > 0 )
+        {
+            index = 0;
+            count = externals.size();
+            for ( ExternalsWrapper ex : externals )
+            {
+                Artifact art = createArtifact( ex.getArtifact(), ex.getVersion(), ex.getGroupid() );
+                index = index + 1;
+                getLog().info( "Processing external " + index + "/" + count );
+                File pom = createExternalProject( ex );
+                ArtifactMetadata metadata = new ProjectArtifactMetadata( art, pom );
+                art.addMetadata( metadata );
+                if ( !skipLocalInstall )
+                {
+                    install( ex.getFile(), art );
+                }
+                try
+                {
+                    if ( deploymentRepository != null )
+                    {
+                        artifactDeployer.deploy( ex.getFile(), art,
+                            deploymentRepository, localRepository );
+                    }
+                }
+                catch ( ArtifactDeploymentException exc )
+                {
+                    throw new MojoExecutionException( "Error Deploying artifact", exc );
+                }
+            }
+        }
+
+        if ( ! defineCluster )
+        {
+            getLog().info( "Not creating cluster POMs." );
+        }
+        else if ( forcedVersion == null )
+        {
+            getLog().warn( "Version not specified, cannot create cluster POMs." );
+        }
+        else
+        {
+            for ( Map.Entry<String, Collection<ModuleWrapper>> elem : clusters.entrySet() )
+            {
+                String cluster = stripClusterName( elem.getKey() );
+                Collection<ModuleWrapper> modules = elem.getValue();
+                getLog().info( "Processing cluster " + cluster );
+                Artifact art = createClusterArtifact( cluster, forcedVersion );
+                File pom = createClusterProject( art, modules );
+                ProjectArtifactMetadata metadata = new ProjectArtifactMetadata( art, pom );
+                art.addMetadata( metadata );
+                if ( !skipLocalInstall )
+                {
+                    install( pom, art );
+                }
+                try
+                {
+                    if ( deploymentRepository != null )
+                    {
+                        artifactDeployer.deploy( pom, art, deploymentRepository, localRepository );
+                    }
+                }
+                catch ( ArtifactDeploymentException ex )
+                {
+                    throw new MojoExecutionException( "Error Deploying artifact", ex );
+                }
+            }
+
+        }
+    }
+
+    void install( File file, Artifact art )
+        throws MojoExecutionException
+    {
+        assert localRepository != null;
+        try
+        {
+            artifactInstaller.install( file, art, localRepository );
+        }
+        catch ( ArtifactInstallationException e )
+        {
+            // TODO: install exception that does not give a trace
+            throw new MojoExecutionException( "Error installing artifact", e );
+        }
+    }
+
+    //performs the same tasks as the MavenProjectHelper
+    Artifact createAttachedArtifact( Artifact primary, File file, String type, String classifier )
+    {
+        assert type != null;
+
+        ArtifactHandler handler;
+
+        handler = artifactHandlerManager.getArtifactHandler( type );
+
+        if ( handler == null )
+        {
+            getLog().warn( "No artifact handler for " + type );
+            handler = artifactHandlerManager.getArtifactHandler( "jar" );
+        }
+
+        Artifact artifact = new AttachedArtifact( primary, type, classifier, handler );
+
+        artifact.setFile( file );
+        artifact.setResolved( true );
+        return artifact;
+    }
+
+    private File createMavenProject( ModuleWrapper wrapper, List<ModuleWrapper> wrapperList,
+                                     List<ExternalsWrapper> externalsList )
+            throws MojoExecutionException
+    {
+        Model mavenModel = new Model();
+
+        mavenModel.setGroupId( wrapper.getGroup() );
+        mavenModel.setArtifactId( wrapper.getArtifact() );
+        mavenModel.setVersion( wrapper.getVersion() );
+        mavenModel.setPackaging( "jar" );
+        mavenModel.setModelVersion( "4.0.0" );
+        if ( artefactParent != null )
+        {
+            mavenModel.setParent( artefactParent );
+        }
+        ExamineManifest man = wrapper.getModuleManifest();
+        List<Dependency> deps = new ArrayList<>();
+        if ( !man.getDependencyTokens().isEmpty() )
+        {
+            for ( String elem : man.getDependencyTokens() )
+            {
+                // create pseudo wrapper
+                ModuleWrapper wr = new ModuleWrapper( elem );
+                int index = wrapperList.indexOf( wr );
+                if ( index > -1 )
+                {
+                    wr = wrapperList.get( index );
+                    Dependency dep;
+                    if ( wr instanceof ModuleWrapperMaven )
+                    {
+                       dep = ( ( ModuleWrapperMaven ) wr ).getDep();
+                    }
+                    else
+                    {
+                        dep = new Dependency();
+                        dep.setArtifactId( wr.getArtifact() );
+                        dep.setGroupId( wr.getGroup() );
+                        dep.setVersion( wr.getVersion() );
+                    }
+                    dep.setType( "jar" );
+                    //we don't want the API modules to depend on non-api ones..
+                    // otherwise the transitive dependency mechanism pollutes your classpath..
+                    if ( wrapper.getModuleManifest().hasPublicPackages()
+                            && !wr.getModuleManifest().hasPublicPackages() )
+                    {
+                        dep.setScope( "runtime" );
+                    }
+                    deps.add( dep );
+                }
+                else if ( dependencyRepositoryUrl != null )
+                {
+                    Dependency dep = new Dependency();
+                    dep.setType( "jar" );
+                    String artifactId = elem.replace( '.', '-' );
+                    dep.setArtifactId( artifactId );
+                    if ( forcedVersion == null )
+                    {
+                        throw new MojoExecutionException( "Cannot use dependencyRepositoryUrl without forcedVersion" );
+                    }
+                    dep.setVersion( forcedVersion );
+                    ArtifactRepositoryPolicy policy = new ArtifactRepositoryPolicy();
+                    List<ArtifactRepository> repos = Collections.singletonList(
+                            repositoryFactory.createArtifactRepository(
+                                    dependencyRepositoryId, dependencyRepositoryUrl, artifactRepositoryLayout, policy, policy ) );
+                    try
+                    {
+                        artifactResolver.resolve(
+                                artifactFactory.createBuildArtifact( groupIdPrefix + GROUP_API, artifactId, forcedVersion, "pom" ),
+                                repos,
+                                localRepository );
+                        dep.setGroupId( groupIdPrefix + GROUP_API );
+                    }
+                    catch ( AbstractArtifactResolutionException x )
+                    {
+                        try
+                        {
+                            artifactResolver.resolve( artifactFactory.createBuildArtifact( groupIdPrefix + GROUP_IMPL, artifactId, forcedVersion, "pom" ), repos, localRepository );
+                            dep.setGroupId( groupIdPrefix + GROUP_IMPL );
+                            if ( wrapper.getModuleManifest().hasPublicPackages() )
+                            {
+                                dep.setScope( "runtime" );
+                            }
+                        }
+                        catch ( AbstractArtifactResolutionException x2 )
+                        {
+                            try
+                            {
+                                artifactResolver.resolve( artifactFactory.createBuildArtifact( groupIdPrefix + GROUP_EXTERNAL, artifactId, forcedVersion, "pom" ), repos, localRepository );
+                                dep.setGroupId( groupIdPrefix + GROUP_EXTERNAL );
+                                if ( wrapper.getModuleManifest().hasPublicPackages() )
+                                {
+                                    dep.setScope( "runtime" );
+                                }
+                            }
+                            catch ( AbstractArtifactResolutionException x3 )
+                            {
+                                getLog().warn( x3.getOriginalMessage() );
+                                throw new MojoExecutionException( "No module found for dependency '" + elem + "'", x );
+                            }
+
+
+                        }
+
+                    }
+                    deps.add( dep );
+                }
+                else
+                {
+                    getLog().warn( "No module found for dependency '" + elem + "'" );
+                }
+            }
+        }
+        //need some generic way to handle Classpath: items.
+        //how to figure the right version?
+        String cp = wrapper.getModuleManifest().getClasspath();
+        if ( !cp.isEmpty() )
+        {
+            StringTokenizer tok = new StringTokenizer( cp );
+            while ( tok.hasMoreTokens() )
+            {
+                String path = tok.nextToken();
+                File f = new File( wrapper.getFile().getParentFile(), path );
+                if ( f.exists() )
+                {
+                    Dependency dep = findExternal( f );
+                    if ( dep != null )
+                    {
+                        deps.add( dep );
+                        // XXX MNBMODULE-170: repack NBM with *.external
+                    }
+                    else
+                    {
+                        ExternalsWrapper ex = new ExternalsWrapper();
+                        ex.setFile( f );
+                        String artId = f.getName();
+                        if ( artId.endsWith( ".jar" ) )
+                        {
+                            artId = artId.substring( 0, artId.length() - ".jar".length() );
+                        }
+                        ex.setVersion( wrapper.getVersion() );
+                        ex.setArtifact( artId );
+                        ex.setGroupid( groupIdPrefix + GROUP_EXTERNAL );
+                        externalsList.add( ex );
+                        dep = new Dependency();
+                        dep.setArtifactId( artId );
+                        dep.setGroupId( groupIdPrefix + GROUP_EXTERNAL );
+                        dep.setVersion( wrapper.getVersion() );
+                        dep.setType( "jar" );
+                        deps.add( dep );
+                    }
+                }
+            }
+        }
+
+        wrapper.deps = deps;
+        mavenModel.setDependencies( deps );
+        FileWriter writer = null;
+        File fil = null;
+        try
+        {
+            MavenXpp3Writer xpp = new MavenXpp3Writer();
+            fil = File.createTempFile( "maven", ".pom" );
+            fil.deleteOnExit();
+            writer = new FileWriter( fil );
+            xpp.write( writer, mavenModel );
+        }
+        catch ( IOException ex )
+        {
+            ex.printStackTrace();
+
+        }
+        finally
+        {
+            if ( writer != null )
+            {
+                try
+                {
+                    writer.close();
+                }
+                catch ( IOException io )
+                {
+                    io.printStackTrace();
+                }
+            }
+        }
+        return fil;
+    }
+
+    private Dependency findExternal( File f )
+    {
+        if ( externallist == null )
+        {
+            return null;
+        }
+        try
+        {
+            List<String> content512 = Files.readAllLines( externallist.toPath() );
+            MessageDigest shaDig = MessageDigest.getInstance( "SHA1" );
+
+            try ( InputStream is = new FileInputStream( f ); OutputStream os = new DigestOutputStream( new NullOutputStream(), shaDig ); )
+            {
+                IOUtil.copy( is, os );
+            }
+            String sha1 = encode ( shaDig.digest() ).toUpperCase();
+            for ( String string : content512 )
+            {
+                if ( string.startsWith( "#" ) )
+                {
+                    continue;
+                }
+                String[] split = string.split( ";" );
+                if ( split[0].equals( sha1 ) && split[1].contains( ":" ) )
+                {
+                    Dependency dep = splitDependencyString( split[1] );
+                    getLog().info( "found match " + dep.getGroupId() + ":" + dep.getArtifactId() + ":" + dep.getVersion() + " for " + f.getName() );
+                    return dep;
+                }
+            }
+            getLog().info( "no repository match for " + f.getName() + f.getAbsolutePath() + " with sha " + sha1 );
+        }
+        catch ( Exception x )
+        {
+            getLog().error( x );
+        }
+        return null;
+    }
+
+    static Dependency splitDependencyString( String split )
+    {
+        String[] splits = split.split( ":" );
+        Dependency dep = new Dependency();
+        dep.setArtifactId( splits[1] );
+        dep.setGroupId( splits[0] );
+        dep.setVersion( splits[2] );
+        dep.setType( "jar" );
+        dep.setClassifier( "" );
+        if ( splits.length > 3 )
+        {
+            String[] split2 = splits[3].split( "@" );
+            if ( split2.length > 1 )
+            {
+                dep.setClassifier( split2[0] );
+                dep.setType( split2[1] );
+            }
+            else
+            {
+                dep.setClassifier( splits[3] );
+            }
+        }
+        return dep;
+    }
+
+    File createExternalProject( ExternalsWrapper wrapper )
+    {
+        Model mavenModel = new Model();
+
+        mavenModel.setGroupId( wrapper.getGroupid() );
+        mavenModel.setArtifactId( wrapper.getArtifact() );
+        mavenModel.setVersion( wrapper.getVersion() );
+        mavenModel.setPackaging( "jar" );
+        mavenModel.setModelVersion( "4.0.0" );
+        if ( artefactParent != null )
+        {
+            mavenModel.setParent( artefactParent );
+        }
+        mavenModel.setName(
+            "Maven definition for " + wrapper.getFile().getName() + " - external part of NetBeans module." );
+        mavenModel.setDescription(
+            "POM and identification for artifact that was not possible to uniquely identify as a maven dependency." );
+        FileWriter writer = null;
+        File fil = null;
+        try
+        {
+            MavenXpp3Writer xpp = new MavenXpp3Writer();
+            fil = File.createTempFile( "maven", ".pom" );
+            fil.deleteOnExit();
+            writer = new FileWriter( fil );
+            xpp.write( writer, mavenModel );
+        }
+        catch ( IOException ex )
+        {
+            ex.printStackTrace();
+        }
+        finally
+        {
+            if ( writer != null )
+            {
+                try
+                {
+                    writer.close();
+                }
+                catch ( IOException io )
+                {
+                    io.printStackTrace();
+                }
+            }
+        }
+        return fil;
+
+    }
+
+    private File createClusterProject( Artifact cluster, Collection<ModuleWrapper> mods )
+    {
+        Model mavenModel = new Model();
+
+        mavenModel.setGroupId( cluster.getGroupId() );
+        mavenModel.setArtifactId( cluster.getArtifactId() );
+        mavenModel.setVersion( cluster.getVersion() );
+//        mavenModel.setPackaging("nbm-application");
+        mavenModel.setPackaging( "pom" );
+        mavenModel.setModelVersion( "4.0.0" );
+        if ( artefactParent != null )
+        {
+            mavenModel.setParent( artefactParent );
+        }
+        List<Dependency> deps = new ArrayList<>();
+        for ( ModuleWrapper wr : mods )
+        {
+            Dependency dep = new Dependency();
+            if ( wr.getModuleManifest().isNetBeansModule() )
+            {
+                dep.setArtifactId( wr.getArtifact() );
+                dep.setGroupId( wr.getGroup() );
+                dep.setVersion( wr.getVersion() );
+                dep.setType( "nbm-file" );
+            }
+            else if ( wr instanceof ModuleWrapperMaven )
+            {
+                ModuleWrapperMaven mwr = ( ModuleWrapperMaven ) wr;
+                dep.setArtifactId( mwr.getDep().getArtifactId() );
+                dep.setGroupId( mwr.getDep().getGroupId() );
+                dep.setVersion( mwr.getDep().getVersion() );
+                dep.setClassifier( mwr.getDep().getClassifier() );
+                dep.setScope( mwr.getDep().getScope());
+            }
+            else
+            {
+                dep.setArtifactId( wr.getArtifact() );
+                dep.setGroupId( wr.getGroup() );
+                dep.setVersion( wr.getVersion() );
+            }
+            deps.add( dep );
+        }
+        mavenModel.setDependencies( deps );
+//
+//
+//        Build build = new Build();
+//        Plugin plg = new Plugin();
+//        plg.setGroupId("org.codehaus.mojo");
+//        plg.setArtifactId("nbm-maven-plugin");
+//        plg.setVersion("2.7-SNAPSHOT");
+//        plg.setExtensions(true);
+//        build.addPlugin(plg);
+//        mavenModel.setBuild(build);
+
+        FileWriter writer = null;
+        File fil = null;
+        try
+        {
+            MavenXpp3Writer xpp = new MavenXpp3Writer();
+            fil = File.createTempFile( "maven", ".pom" );
+            fil.deleteOnExit();
+            writer = new FileWriter( fil );
+            xpp.write( writer, mavenModel );
+        }
+        catch ( IOException ex )
+        {
+            ex.printStackTrace();
+        }
+        finally
+        {
+            IOUtil.close( writer );
+        }
+        return fil;
+    }
+
+    Artifact createArtifact( String artifact, String version, String group )
+    {
+        return artifactFactory.createBuildArtifact( group, artifact, version, "jar" );
+    }
+
+    private Artifact createClusterArtifact( String artifact, String version )
+    {
+        return artifactFactory.createBuildArtifact( groupIdPrefix + GROUP_CLUSTER, artifact, version, "pom" );
+    }
+
+    private static final Pattern PATTERN_CLUSTER = Pattern.compile( "([a-zA-Z]+)[0-9\\.]*" );
+    static String stripClusterName( String key )
+    {
+        Matcher m = PATTERN_CLUSTER.matcher( key );
+        if ( m.matches() )
+        {
+            return m.group( 1 );
+        }
+        return key;
+    }
+
+    private static class ExternalsWrapper
+    {
+
+        private File file;
+
+        private String artifact;
+
+        private String groupid;
+
+        public String getArtifact()
+        {
+            return artifact;
+        }
+
+        public void setArtifact( String artifact )
+        {
+            this.artifact = artifact;
+        }
+
+        public File getFile()
+        {
+            return file;
+        }
+
+        public void setFile( File file )
+        {
+            this.file = file;
+        }
+
+        public String getGroupid()
+        {
+            return groupid;
+        }
+
+        public void setGroupid( String groupid )
+        {
+            this.groupid = groupid;
+        }
+
+        public String getVersion()
+        {
+            return version;
+        }
+
+        public void setVersion( String version )
+        {
+            this.version = version;
+        }
+        private String version;
+
+    }
+
+    private static class ModuleWrapperMaven extends ModuleWrapper
+    {
+
+        private final Dependency dep;
+
+        ModuleWrapperMaven( String art, String ver, String grp, ExamineManifest manifest, File fil, Dependency de )
+        {
+            super( art, ver, grp, manifest, fil );
+            this.dep = de;
+        }
+
+        public Dependency getDep()
+        {
+            return dep;
+        }
+    }
+
+    private static class ModuleWrapper
+    {
+
+        ExamineManifest man;
+
+        private String artifact;
+
+        private String version;
+
+        private String group;
+
+        private File file;
+
+        private String cluster;
+
+        String module;
+
+        List<Dependency> deps;
+
+        ModuleWrapper( String module )
+        {
+            this.module = module;
+        }
+
+        ModuleWrapper( String art, String ver, String grp, ExamineManifest manifest, File fil )
+        {
+            man = manifest;
+            artifact = art;
+            version = ver;
+            group = grp;
+            file = fil;
+        }
+
+        @Override
+        public int hashCode()
+        {
+            return getModule().hashCode();
+        }
+
+        @Override
+        public boolean equals( Object obj )
+        {
+            return obj instanceof ModuleWrapper && getModule().equals( ( (ModuleWrapper) obj ).getModule() );
+        }
+
+        public String getModule()
+        {
+            return module != null ? module : getModuleManifest().getModule();
+        }
+
+        public ExamineManifest getModuleManifest()
+        {
+            return man;
+        }
+
+        private String getArtifact()
+        {
+            return artifact;
+        }
+
+        private String getVersion()
+        {
+            return version;
+        }
+
+        private String getGroup()
+        {
+            return group;
+        }
+
+        private File getFile()
+        {
+            return file;
+        }
+
+        void setCluster( String clust )
+        {
+            cluster = clust;
+        }
+
+        String getCluster()
+        {
+            return cluster;
+        }
+    }
+
+    private static class NullOutputStream
+        extends OutputStream
+    {
+
+        @Override
+        public void write( int b )
+            throws IOException
+        {
+        }
+    }
+
+    /**
+     * Encodes a 128 bit or 160-bit byte array into a String.
+     *
+     * @param binaryData Array containing the digest
+     * @return Encoded hex string, or null if encoding failed
+     */
+    static String encode( byte[] binaryData )
+    {
+        int bitLength = binaryData.length * 8;
+        if ( bitLength != 128 && bitLength != 160 )
+        {
+            throw new IllegalArgumentException(
+                "Unrecognised length for binary data: " + bitLength + " bits" );
+        }
+        return String.format( "%0" + bitLength / 4 + "x", new BigInteger( 1, binaryData ) );
+    }
+}
diff --git a/nb-repository-plugin/src/site/apt/index.apt b/nb-repository-plugin/src/site/apt/index.apt
new file mode 100644
index 0000000..5b5a4e2
--- /dev/null
+++ b/nb-repository-plugin/src/site/apt/index.apt
@@ -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.
+
+ ------
+ Maven 2 NB Repository Plugin 
+ ------
+ Milos Kleint
+ <dev@apache.netbeans.org>
+ ------
+ 2012-10-19
+
+NetBeans Repository plugin
+
+ The plugin is capable of populating the local or remote maven repository with module jars and NBM files from a given NetBeans installation. Useful for
+module development, modules with public APIs are separated from those without a public API.
+See the {{{./populate-mojo.html}<<<populate>>>}} goal and the {{{./repository.html}HOWTO document}} for details.
+
+ {{{https://search.maven.org/}Maven Central}} contains artefacts of Apache NetBeans 9.0 and later.
+
+ Also see: {{{http://wiki.netbeans.org/NetBeansDeveloperFAQ#Mavenized_Builds}Maven NBM development FAQs}}
+
+Older NetBeans Version
+
+ To get access to a repository with NetBeans.org module artifacts and metadata, add {{{http://bits.netbeans.org/maven2/}http://bits.netbeans.org/maven2/}} repository to your project POM
+or the repository manager you are using. The repository hosts binaries from NetBeans 6.5 to NetBeans 8.2.
+
diff --git a/nb-repository-plugin/src/site/apt/repository.apt b/nb-repository-plugin/src/site/apt/repository.apt
new file mode 100644
index 0000000..4aa9a1c
--- /dev/null
+++ b/nb-repository-plugin/src/site/apt/repository.apt
@@ -0,0 +1,56 @@
+~~ 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.
+
+ ------
+ Maven 2 NB Repository Plugin 
+ ------
+ Milos Kleint
+ <dev@apache.netbeans.org>
+ ------
+ 2012-10-19
+
+HOWTO: Upload NetBeans release binaries to a Maven repository
+
+
+ There is a goal that converts the NetBeans module information into Maven metadata
+and is capable of uploading the module jar file, javadoc, sources and nbm files to local
+and remote repositories. See {{{./populate-mojo.html}<<<populate>>> goal}} description.
+
+ For a binary-only upload (jar files and nbm files only), it's possible to download the bits from official sites. 
+See this page {{{http://netbeans.apache.org/download/dev/index.html}Building from source}}
+
+ For the complete upload, you will need to checkout the sources of the IDE/Platform you
+want to upload. See this page {{{http://netbeans.apache.org/download/dev/index.html}Building from source}}
+
+ To have external dependencies correctly identified by their real GAV, you will need to download the index from central (or other) repository. 
+See {{{./download-mojo.html}<<<download>>> goal}}
+
+ The goal has multiple input parameters that link the goal to binaries prepared beforehand.
+
+   * <<netbeansInstallDirectory>> designates the base directory where resides the NetBeans installation
+that shall be uploaded. Run <<<ant>>> in your local git clone to build the distribution at <<<nbbuild/netbeans>>> subdirectory.
+
+   * <<netbeansNbmDirectory>> designates the base directory where the nbm files are located.
+Run <<<ant build-nbms>>> in your local <<<git clone>>> to build the nbms at <<<nbbuild/nbms>>> directory.
+
+   * <<netbeansSourcesDirectory>> designates the base directory containing zip files with module jar sources.
+Run <<<ant build-source-zips>>> in your local hg clone to build the nbms at <<<nbbuild/build/source-zips>>> directory.
+
+   * <<netbeansJavadocDirectory>> designates the base directory containing zip files with javadoc zips for modules with public apis.
+Run <<<ant build-javadoc>>> in your local hg clone to build the nbms at <<<nbbuild/build/javadoc>>> directory.
+
+
diff --git a/nb-repository-plugin/src/site/site.xml b/nb-repository-plugin/src/site/site.xml
new file mode 100644
index 0000000..3965618
--- /dev/null
+++ b/nb-repository-plugin/src/site/site.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+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">
+    <skin>
+        <groupId>org.apache.netbeans.utilities</groupId>
+        <artifactId>maven-netbeans-skin</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </skin>
+    <body>
+    <menu name="Overview">
+      <item name="Usage" href="index.html"/>
+      <item name="Plugin Goals" href="plugin-info.html"/>
+      <!-- <item name="Javadoc" href="apidocs/index.html"/> -->
+      <!--item name="FAQ" href="faq.html"/-->
+    </menu>
+    <!--<menu name="Upgrade">   
+      <item name="2.4 -> 2.5 upgrade" href="2425upgrade.html"/>
+      <item name="2.6 -> 3.0 upgrade" href="2630upgrade.html"/>
+    </menu>-->
+    <menu name="HOWTOs ">
+      <item name="Populate repository" href="repository.html"/>
+    </menu>
+  </body>
+</project>
+
diff --git a/nb-repository-plugin/src/test/java/org/apache/netbeans/nbm/repository/PopulateRepositoryMojoTest.java b/nb-repository-plugin/src/test/java/org/apache/netbeans/nbm/repository/PopulateRepositoryMojoTest.java
new file mode 100644
index 0000000..5a6ab2a
--- /dev/null
+++ b/nb-repository-plugin/src/test/java/org/apache/netbeans/nbm/repository/PopulateRepositoryMojoTest.java
@@ -0,0 +1,93 @@
+package org.apache.netbeans.nbm.repository;
+
+/*
+ * 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.
+ */
+
+import junit.framework.TestCase;
+import org.apache.maven.model.Dependency;
+
+/**
+ * 
+ * @author Milos Kleint
+ */
+public class PopulateRepositoryMojoTest extends TestCase /** AbstractMojoTestCase  the only way out of dependency hell.**/{
+    
+    public void testStripClusterName()
+    {
+        assertEquals( "platform", PopulateRepositoryMojo.stripClusterName( "platform9" ) );
+        assertEquals( "platform", PopulateRepositoryMojo.stripClusterName( "platform11" ) );
+        assertEquals( "nb", PopulateRepositoryMojo.stripClusterName( "nb6.9" ) );
+        assertEquals( "extra", PopulateRepositoryMojo.stripClusterName( "extra" ) );
+    }
+
+    public void testInstall() throws Exception
+    {
+//TODO how is this done on maven3?
+//        PopulateRepositoryMojo mojo = ( PopulateRepositoryMojo ) lookupMojo( "populate", new File( getBasedir(), "src/test/resources/PopulateMojoTest.xml" ) );
+//        File repo = new File( System.getProperty( "java.io.tmpdir" ), "PopulateRepositoryMojoTest" );
+//        FileUtils.deleteDirectory( repo );
+//        mojo.localRepository = new DefaultArtifactRepository( "test", repo.toURI().toString(), new DefaultRepositoryLayout() );
+//        Artifact art1 = mojo.createArtifact( "testarg", "1.0", "testgrp" );
+//        File f = File.createTempFile( "PopulateRepositoryMojoTest", ".nbm" );
+//        f.deleteOnExit();
+//        Artifact art2 = mojo.createAttachedArtifact( art1, f, "nbm-file", null );
+//        assertEquals( "nbm", art2.getArtifactHandler().getExtension() );
+//        //TODO does not work because of missing session
+////        mojo.install( f, art2 );
+////        assertTrue( new File( repo, "testgrp/testarg/1.0/testarg-1.0.nbm" ).isFile() );
+////        assertFalse( new File( repo, "testgrp/testarg/1.0/testarg-1.0.jar" ).isFile() );
+    }
+    
+    public void testSplit() throws Exception
+    {
+        Dependency dep1 = PopulateRepositoryMojo.splitDependencyString("org.apache.maven:apache-maven:3.6.3:bin@zip");
+        assertEquals("org.apache.maven", dep1.getGroupId() );
+        assertEquals("apache-maven", dep1.getArtifactId());
+        assertEquals("3.6.3", dep1.getVersion());
+        assertEquals("bin", dep1.getClassifier());
+        assertEquals("zip", dep1.getType());
+        
+        Dependency dep2 = PopulateRepositoryMojo.splitDependencyString("org.apache.maven:apache-maven:3.6.3:myclassifier");
+        assertEquals("org.apache.maven", dep2.getGroupId() );
+        assertEquals("apache-maven", dep2.getArtifactId());
+        assertEquals("3.6.3", dep2.getVersion());
+        assertEquals("myclassifier", dep2.getClassifier());
+        assertEquals("jar", dep2.getType());
+        
+        Dependency dep3 = PopulateRepositoryMojo.splitDependencyString("org.apache.maven:apache-maven:3.6.3");
+        assertEquals("org.apache.maven", dep3.getGroupId() );
+        assertEquals("apache-maven", dep3.getArtifactId());
+        assertEquals("3.6.3", dep3.getVersion());
+        assertEquals("", dep3.getClassifier());
+        assertEquals("jar", dep3.getType());
+    }
+
+    public void testEncode() throws Exception
+    {
+        assertEquals( "057558504e1d03e57ce6fd80ad983b3c2e803b40", PopulateRepositoryMojo.encode( new byte[] {
+            (byte) 0x05, (byte) 0x75, (byte) 0x58, (byte) 0x50, (byte) 0x4e, (byte) 0x1d, (byte) 0x03, (byte) 0xe5, (byte) 0x7c, (byte) 0xe6,
+            (byte) 0xfd, (byte) 0x80, (byte) 0xad, (byte) 0x98, (byte) 0x3b, (byte) 0x3c, (byte) 0x2e, (byte) 0x80, (byte) 0x3b, (byte) 0x40,
+        } ) );
+        assertEquals( "ca70822c47a67fc3a11670270567c2d01566dae1", PopulateRepositoryMojo.encode( new byte[] {
+            (byte) 0xca, (byte) 0x70, (byte) 0x82, (byte) 0x2c, (byte) 0x47, (byte) 0xa6, (byte) 0x7f, (byte) 0xc3, (byte) 0xa1, (byte) 0x16,
+            (byte) 0x70, (byte) 0x27, (byte) 0x05, (byte) 0x67, (byte) 0xc2, (byte) 0xd0, (byte) 0x15, (byte) 0x66, (byte) 0xda, (byte) 0xe1,
+        } ) );
+    }
+
+}
diff --git a/nb-repository-plugin/src/test/resources/PopulateMojoTest.xml b/nb-repository-plugin/src/test/resources/PopulateMojoTest.xml
new file mode 100644
index 0000000..233d42c
--- /dev/null
+++ b/nb-repository-plugin/src/test/resources/PopulateMojoTest.xml
@@ -0,0 +1,28 @@
+<?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>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>nb-repository-plugin</artifactId>
+                <configuration/>
+            </plugin>
+        </plugins>
+    </build>
+</project>