You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by ne...@apache.org on 2019/06/24 08:36:14 UTC
[netbeans] branch master updated: NP-20 Payara Micro tools
integration in Apache NetBeans IDE (#1297)
This is an automated email from the ASF dual-hosted git repository.
neilcsmith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new f149137 NP-20 Payara Micro tools integration in Apache NetBeans IDE (#1297)
f149137 is described below
commit f1491375e1a4ec42295d047d0638ad944a9c039b
Author: Gaurav Gupta <ga...@gmail.com>
AuthorDate: Mon Jun 24 14:06:09 2019 +0530
NP-20 Payara Micro tools integration in Apache NetBeans IDE (#1297)
* NP-20 Payara Micro tools integration in Apache NetBeans IDE
* NP-20 add license to form
* NP-20 add license to Bundle.properties
* NP-20 upgrade payara-micro-maven-plugin version to 1.0.5
* NP-20 polish
---
enterprise/maven.j2ee/nbproject/project.xml | 6 +-
enterprise/payara.micro/build.xml | 25 +
enterprise/payara.micro/licenseinfo.xml | 36 ++
enterprise/payara.micro/manifest.mf | 6 +
.../payara.micro/nbproject/project.properties | 18 +
enterprise/payara.micro/nbproject/project.xml | 295 +++++++++
.../modules/fish/payara/micro/Bundle.properties | 22 +
.../netbeans/modules/fish/payara/micro/layer.xml | 30 +
.../fish/payara/micro/plugin/Bundle.properties | 21 +
.../fish/payara/micro/plugin/Constants.java | 105 ++++
.../micro/plugin/MicroPluginWizardDescriptor.java | 174 ++++++
.../fish/payara/micro/plugin/POMManager.java | 484 +++++++++++++++
.../fish/payara/micro/plugin/TemplateUtil.java | 84 +++
.../modules/fish/payara/micro/plugin/Wizards.java | 86 +++
.../resources/PayaraMicroPluginDescription.html | 28 +
.../fish/payara/micro/plugin/resources/pom.xml.ftl | 59 ++
.../fish/payara/micro/project/ActionType.java | 61 ++
.../fish/payara/micro/project/Bundle.properties | 25 +
.../payara/micro/project/DeployOnSaveManager.java | 656 +++++++++++++++++++++
.../payara/micro/project/ExecutionChecker.java | 121 ++++
.../payara/micro/project/LookupProviderImpl.java | 45 ++
.../payara/micro/project/MicroActionsProvider.java | 168 ++++++
.../payara/micro/project/MicroApplication.java | 173 ++++++
.../micro/project/MicroApplicationContent.java | 41 ++
.../fish/payara/micro/project/MicroIcon.java | 68 +++
.../payara/micro/project/MicroProjectHook.java | 83 +++
.../payara/micro/project/MicroPropertiesPanel.form | 76 +++
.../payara/micro/project/MicroPropertiesPanel.java | 120 ++++
.../project/MicroPropertiesPanelProvider.java | 64 ++
.../fish/payara/micro/project/MicroVersion.java | 58 ++
.../fish/payara/micro/project/ReloadAction.java | 124 ++++
.../payara/micro/project/VersionRepository.java | 71 +++
.../resources/PayaraMicroProjectDescription.html | 29 +
.../micro/project/resources/action-mapping.xml | 100 ++++
.../micro/project/resources/payara-micro-build.png | Bin 0 -> 1029 bytes
.../project/resources/payara-micro-clean-build.png | Bin 0 -> 1112 bytes
.../micro/project/resources/payara-micro-clean.png | Bin 0 -> 1083 bytes
.../micro/project/resources/payara-micro-debug.png | Bin 0 -> 968 bytes
.../project/resources/payara-micro-profile.png | Bin 0 -> 1125 bytes
.../project/resources/payara-micro-reload.png | Bin 0 -> 993 bytes
.../project/resources/payara-micro-restart.png | Bin 0 -> 794 bytes
.../micro/project/resources/payara-micro-start.png | Bin 0 -> 837 bytes
.../micro/project/resources/payara-micro.png | Bin 0 -> 785 bytes
.../micro/project/ui/BaseWizardIterator.java | 131 ++++
.../fish/payara/micro/project/ui/Bundle.properties | 26 +
.../project/ui/MicroProjectWizardIterator.java | 122 ++++
.../micro/project/ui/PayaraMicroDescriptor.java | 77 +++
.../payara/micro/project/ui/PayaraMicroPanel.form | 110 ++++
.../payara/micro/project/ui/PayaraMicroPanel.java | 123 ++++
ide/swing.validation/nbproject/project.xml | 1 +
java/maven.embedder/nbproject/project.xml | 1 +
java/maven.model/nbproject/project.xml | 1 +
java/maven/nbproject/project.xml | 2 +
nbbuild/cluster.properties | 1 +
54 files changed, 4156 insertions(+), 1 deletion(-)
diff --git a/enterprise/maven.j2ee/nbproject/project.xml b/enterprise/maven.j2ee/nbproject/project.xml
index 0cd6595..6d79637 100644
--- a/enterprise/maven.j2ee/nbproject/project.xml
+++ b/enterprise/maven.j2ee/nbproject/project.xml
@@ -538,7 +538,11 @@
</test-dependency>
</test-type>
</test-dependencies>
- <public-packages/>
+ <friend-packages>
+ <friend>org.netbeans.modules.payara.micro</friend>
+ <package>org.netbeans.modules.maven.j2ee.utils</package>
+ <package>org.netbeans.modules.maven.j2ee.ui</package>
+ </friend-packages>
</data>
</configuration>
</project>
diff --git a/enterprise/payara.micro/build.xml b/enterprise/payara.micro/build.xml
new file mode 100644
index 0000000..96c6071
--- /dev/null
+++ b/enterprise/payara.micro/build.xml
@@ -0,0 +1,25 @@
+<?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 basedir="." default="build" name="enterprise/payara.micro">
+ <description>Builds, tests, and runs the project org.netbeans.modules.payara.micro</description>
+ <import file="../../nbbuild/templates/projectized.xml"/>
+</project>
\ No newline at end of file
diff --git a/enterprise/payara.micro/licenseinfo.xml b/enterprise/payara.micro/licenseinfo.xml
new file mode 100644
index 0000000..2f5766e
--- /dev/null
+++ b/enterprise/payara.micro/licenseinfo.xml
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<licenseinfo>
+ <fileset>
+ <file>src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-build.png</file>
+ <file>src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-clean-build.png</file>
+ <file>src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-clean.png</file>
+ <file>src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-debug.png</file>
+ <file>src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-profile.png</file>
+ <file>src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-reload.png</file>
+ <file>src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-restart.png</file>
+ <file>src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-start.png</file>
+ <file>src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro.png</file>
+ <license ref="Apache-2.0-ASF" />
+ <comment type="COMMENT_UNSUPPORTED" />
+ </fileset>
+</licenseinfo>
diff --git a/enterprise/payara.micro/manifest.mf b/enterprise/payara.micro/manifest.mf
new file mode 100644
index 0000000..eec011b
--- /dev/null
+++ b/enterprise/payara.micro/manifest.mf
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+AutoUpdate-Show-In-Client: false
+OpenIDE-Module: org.netbeans.modules.payara.micro/0
+OpenIDE-Module-Layer: org/netbeans/modules/fish/payara/micro/layer.xml
+OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/fish/payara/micro/Bundle.properties
+OpenIDE-Module-Specification-Version: 1.0
\ No newline at end of file
diff --git a/enterprise/payara.micro/nbproject/project.properties b/enterprise/payara.micro/nbproject/project.properties
new file mode 100644
index 0000000..0f4ec98
--- /dev/null
+++ b/enterprise/payara.micro/nbproject/project.properties
@@ -0,0 +1,18 @@
+# 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.
+javac.source=1.8
+javac.compilerargs=-Xlint -Xlint:-serial
diff --git a/enterprise/payara.micro/nbproject/project.xml b/enterprise/payara.micro/nbproject/project.xml
new file mode 100644
index 0000000..8bcfc73
--- /dev/null
+++ b/enterprise/payara.micro/nbproject/project.xml
@@ -0,0 +1,295 @@
+<?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://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.apisupport.project</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
+ <code-name-base>org.netbeans.modules.payara.micro</code-name-base>
+ <module-dependencies>
+ <dependency>
+ <code-name-base>org.apache.tools.ant.module</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>3</release-version>
+ <specification-version>3.81.1.2</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.api.annotations.common</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.27.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.api.scripting</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>1.2</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.api.templates</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>1.7.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.api.web.webmodule</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>1.41.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.j2ee.core</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>0</release-version>
+ <specification-version>1.27.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.j2eeapis</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.35.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.j2eeserver</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>4</release-version>
+ <specification-version>1.116</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.java.platform</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.41.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.java.source.base</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>2.20.1.2.2.25.8.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.maven</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>2</release-version>
+ <specification-version>2.133</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.maven.embedder</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>2</release-version>
+ <specification-version>2.58</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.maven.j2ee</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.65</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.maven.model</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.49</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.projectapi</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.72</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.projectuiapi</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.88.1.8</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.projectuiapi.base</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.85.1.9</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.swing.validation</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>2</release-version>
+ <specification-version>1.37</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.xml.xam</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.32.1.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.openide.awt</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>7.67.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.openide.dialogs</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>7.42.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.openide.execution</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>9.3.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.openide.explorer</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>6.62.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.openide.filesystems</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>9.10.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.openide.loaders</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>7.66.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.openide.modules</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>7.48.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.openide.nodes</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>7.45.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.openide.util</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>9.7.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.openide.util.lookup</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>8.33.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.openide.util.ui</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>9.6.1</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.openide.windows</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>6.81</specification-version>
+ </run-dependency>
+ </dependency>
+ </module-dependencies>
+ <public-packages/>
+ </data>
+ </configuration>
+</project>
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/Bundle.properties b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/Bundle.properties
new file mode 100644
index 0000000..85b0a80
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/Bundle.properties
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+OpenIDE-Module-Name=Payara Micro
+OpenIDE-Module-Display-Category=Java EE
+OpenIDE-Module-Short-Description=Payara Micro support for Java EE projects.
+OpenIDE-Module-Long-Description=Payara Micro plugin enables you to start and stop Payara Micro maven web applications.
\ No newline at end of file
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/layer.xml b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/layer.xml
new file mode 100644
index 0000000..5985dd9
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/layer.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
+<!--
+
+ 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.
+
+-->
+<filesystem>
+ <folder name="Templates">
+ <folder name="PayaraResources">
+ <attr name="displayName" bundlevalue="org.netbeans.modules.fish.payara.micro.plugin.Bundle#Templates/PayaraResources"/>
+ <attr name="position" intvalue="1750"/>
+ </folder>
+ </folder>
+</filesystem>
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/Bundle.properties b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/Bundle.properties
new file mode 100644
index 0000000..24ae75a
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/Bundle.properties
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+LBL_PayaraMicroPlugin=Maven Plugin setup
+Templates/PayaraResources=Payara
+Templates/PayaraResources/PayaraMicroMavenPlugin=Payara Micro Maven Plugin
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/Constants.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/Constants.java
new file mode 100644
index 0000000..07edf9e
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/Constants.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.plugin;
+
+import org.netbeans.api.annotations.common.StaticResource;
+import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
+import org.netbeans.modules.maven.api.NbMavenProject;
+import org.netbeans.spi.project.ActionProvider;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+public interface Constants {
+
+ J2eeModule.Type PROJECT_TYPE = J2eeModule.Type.WAR;
+
+ String PROP_GROUP_ID = "groupId";
+ String PROP_ARTIFACT_ID = "artifactId";
+ String PROP_VERSION = "version";
+ String PROP_PACKAGE = "package";
+
+ String PROP_JAVA_EE_VERSION = "javaeeVersion";
+ String PROP_PAYARA_MICRO_VERSION = "payaraMicroVersion";
+ String PROP_AUTO_BIND_HTTP = "autoBindHttp";
+
+ String VERSION = "version";
+
+ String WAR_PACKAGING = "war";
+
+ String MAVEN_WAR_PROJECT_TYPE = "org-netbeans-modules-maven/" + NbMavenProject.TYPE_WAR;
+
+ String PAYARA_MICRO_MAVEN_PLUGIN = "fish.payara.maven.plugins:payara-micro-maven-plugin";
+
+ String RELOAD_FILE = ".reload";
+ String COMMAND_EXPLODE = "explode";
+
+ String RESOURCES_GOAL = "resources:resources";
+ String COMPILE_GOAL = "compiler:compile";
+ String EXPLODED_GOAL = "war:exploded";
+ String WAR_GOAL = "war:war";
+ String STOP_GOAL = "payara-micro:stop";
+ String START_GOAL = "payara-micro:start";
+
+ String COMPILE_EXPLODE_ACTION = "micro-complie-explode";
+ String EXPLODE_ACTION = "micro-explode";
+ String STOP_ACTION = "micro-stop";
+ String RUN_ACTION = ActionProvider.COMMAND_RUN;
+ String DEBUG_ACTION = ActionProvider.COMMAND_DEBUG;
+ String PROFILE_ACTION = ActionProvider.COMMAND_PROFILE;
+ String RUN_SINGLE_ACTION = ActionProvider.COMMAND_RUN_SINGLE + ".deploy";
+ String DEBUG_SINGLE_ACTION = ActionProvider.COMMAND_DEBUG_SINGLE + ".deploy";
+ String PROFILE_SINGLE_ACTION = ActionProvider.COMMAND_PROFILE_SINGLE + ".deploy";
+
+ String ARCHETYPE_GROUP_ID = "fish.payara.maven.archetypes";
+ String ARCHETYPE_ARTIFACT_ID = "payara-micro-maven-archetype";
+ String ARCHETYPE_REPOSITORY = "https://oss.sonatype.org/content/repositories/snapshots";
+
+ @StaticResource
+ String PROJECT_ICON = "org/netbeans/modules/fish/payara/micro/project/resources/payara-micro.png";
+
+ @StaticResource
+ String CLEAN_ICON = "org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-clean.png";
+
+ @StaticResource
+ String BUILD_ICON = "org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-build.png";
+
+ @StaticResource
+ String REBUILD_ICON = "org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-clean-build.png";
+
+ @StaticResource
+ String START_ICON = "org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-start.png";
+
+ @StaticResource
+ String RESTART_ICON = "org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-restart.png";
+
+ @StaticResource
+ String RELOAD_ICON = "org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-reload.png";
+
+ @StaticResource
+ String DEBUG_ICON = "org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-debug.png";
+
+ @StaticResource
+ String PROFILE_ICON = "org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-profile.png";
+
+ @StaticResource
+ String POM_TEMPLATE = "org/netbeans/modules/fish/payara/micro/plugin/resources/pom.xml.ftl";
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/MicroPluginWizardDescriptor.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/MicroPluginWizardDescriptor.java
new file mode 100644
index 0000000..ef905f6
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/MicroPluginWizardDescriptor.java
@@ -0,0 +1,174 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.plugin;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import javax.swing.event.ChangeListener;
+import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ProjectManager;
+import org.netbeans.api.project.ui.OpenProjects;
+import org.netbeans.api.templates.TemplateRegistration;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.POM_TEMPLATE;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROJECT_ICON;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROJECT_TYPE;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROP_AUTO_BIND_HTTP;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROP_PAYARA_MICRO_VERSION;
+import static org.netbeans.modules.fish.payara.micro.plugin.TemplateUtil.expandTemplate;
+import static org.netbeans.modules.fish.payara.micro.plugin.TemplateUtil.loadResource;
+import org.netbeans.modules.fish.payara.micro.project.MicroApplication;
+import org.netbeans.modules.fish.payara.micro.project.MicroProjectHook;
+import org.netbeans.modules.fish.payara.micro.project.ui.PayaraMicroDescriptor;
+import org.netbeans.modules.maven.api.NbMavenProject;
+import org.netbeans.modules.maven.model.pom.POMExtensibilityElement;
+import org.netbeans.spi.project.ui.templates.support.Templates;
+import org.openide.WizardDescriptor;
+import org.openide.util.NbBundle;
+
+@TemplateRegistration(
+ folder = "PayaraResources",
+ displayName = "#Templates/PayaraResources/PayaraMicroMavenPlugin",
+ iconBase = PROJECT_ICON,
+ description = "resources/PayaraMicroPluginDescription.html",
+ category = {"j2ee-types", "web-types"}
+)
+public final class MicroPluginWizardDescriptor implements WizardDescriptor.InstantiatingIterator<WizardDescriptor> {
+
+ private int index;
+
+ private WizardDescriptor descriptor;
+
+ private Project project;
+
+ private List<WizardDescriptor.Panel<WizardDescriptor>> panels;
+
+ public static void updateMicroMavenPlugin(Project project, String payaraMicroVersion, String autoBindHttp) throws IOException {
+ Map<String, Object> params = new HashMap<>();
+ params.put("autoBindHttp", autoBindHttp);
+ params.put("payaraMicroVersion", payaraMicroVersion);
+
+ try (Reader sourceReader = new InputStreamReader(loadResource(POM_TEMPLATE))) {
+ try (Reader targetReader = new StringReader(expandTemplate(sourceReader, params))) {
+ POMManager pomManager = new POMManager(targetReader, project);
+ pomManager.setExtensionOverrideFilter((source, target) -> {
+ if ("option".equalsIgnoreCase(source.getName())) {
+ for (POMExtensibilityElement element : target.getExtensibilityElements()) {
+ if ("key".equals(element.getQName().getLocalPart())) {
+ return source.getChild("key").getValue().equals(element.getElementText());
+ }
+ }
+ }
+ return true;
+ });
+ pomManager.commit();
+ pomManager.reload();
+ }
+ }
+ }
+
+ @Override
+ public void initialize(WizardDescriptor descriptor) {
+ this.descriptor = descriptor;
+ index = 0;
+ if (project == null) {
+ project = Templates.getProject(descriptor);
+ }
+ panels = new ArrayList<>();
+ panels.add(new PayaraMicroDescriptor(PROJECT_TYPE));
+ String[] names = new String[]{
+ NbBundle.getMessage(MicroPluginWizardDescriptor.class, "LBL_PayaraMicroPlugin")
+ };
+
+ descriptor.putProperty("NewFileWizard_Title",
+ NbBundle.getMessage(MicroPluginWizardDescriptor.class, "Templates/PayaraResources/PayaraMicroMavenPlugin"));
+ Wizards.mergeSteps(descriptor, panels.toArray(new WizardDescriptor.Panel[0]), names);
+
+ }
+
+ @Override
+ public Set instantiate() throws IOException {
+ String payaraMicroVersion = (String) descriptor.getProperty(PROP_PAYARA_MICRO_VERSION);
+ String autoBindHttp = (String) descriptor.getProperty(PROP_AUTO_BIND_HTTP);
+
+ updateMicroMavenPlugin(project, payaraMicroVersion, autoBindHttp);
+ MicroApplication.registerInstance(project);
+ new MicroProjectHook(project).projectOpened();
+ NbMavenProject.fireMavenProjectReload(project);
+ return Collections.emptySet();
+ }
+
+ @Override
+ public void uninitialize(WizardDescriptor wizard) {
+ panels = null;
+ }
+
+ @Override
+ public WizardDescriptor.Panel current() {
+ return panels.get(index);
+ }
+
+ @Override
+ public String name() {
+ return NbBundle.getMessage(MicroPluginWizardDescriptor.class, "Templates/PayaraResources/PayaraMicroMavenPlugin");
+ }
+
+ @Override
+ public boolean hasNext() {
+ return index < panels.size() - 1;
+ }
+
+ @Override
+ public boolean hasPrevious() {
+ return index > 0;
+ }
+
+ @Override
+ public void nextPanel() {
+ if (!hasNext()) {
+ throw new NoSuchElementException();
+ }
+ index++;
+ }
+
+ @Override
+ public void previousPanel() {
+ if (!hasPrevious()) {
+ throw new NoSuchElementException();
+ }
+ index--;
+ }
+
+ @Override
+ public void addChangeListener(ChangeListener l) {
+ }
+
+ @Override
+ public void removeChangeListener(ChangeListener l) {
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/POMManager.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/POMManager.java
new file mode 100644
index 0000000..3602ee4
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/POMManager.java
@@ -0,0 +1,484 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.plugin;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.BiFunction;
+import static java.util.stream.Collectors.toSet;
+import javax.swing.SwingUtilities;
+import javax.xml.namespace.QName;
+import org.apache.maven.model.Model;
+import org.netbeans.modules.maven.model.pom.Resource;
+import org.apache.maven.model.io.ModelReader;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+import org.netbeans.api.project.Project;
+import static org.netbeans.modules.fish.payara.micro.plugin.TemplateUtil.loadResource;
+import org.netbeans.modules.maven.api.ModelUtils;
+import org.netbeans.modules.maven.api.NbMavenProject;
+import org.netbeans.modules.maven.embedder.EmbedderFactory;
+import org.netbeans.modules.maven.model.ModelOperation;
+import org.netbeans.modules.maven.model.Utilities;
+import org.netbeans.modules.maven.model.pom.Activation;
+import org.netbeans.modules.maven.model.pom.ActivationProperty;
+import org.netbeans.modules.maven.model.pom.BuildBase;
+import org.netbeans.modules.maven.model.pom.Configuration;
+import org.netbeans.modules.maven.model.pom.Dependency;
+import org.netbeans.modules.maven.model.pom.DependencyContainer;
+import org.netbeans.modules.maven.model.pom.DependencyManagement;
+import org.netbeans.modules.maven.model.pom.Exclusion;
+import org.netbeans.modules.maven.model.pom.POMComponent;
+import org.netbeans.modules.maven.model.pom.POMExtensibilityElement;
+import org.netbeans.modules.maven.model.pom.POMModel;
+import org.netbeans.modules.maven.model.pom.POMModelFactory;
+import org.netbeans.modules.maven.model.pom.Plugin;
+import org.netbeans.modules.maven.model.pom.PluginExecution;
+import org.netbeans.modules.maven.model.pom.Profile;
+import org.netbeans.modules.maven.model.pom.Properties;
+import org.netbeans.modules.maven.model.pom.Repository;
+import org.netbeans.modules.maven.model.pom.RepositoryPolicy;
+import org.openide.filesystems.FileObject;
+import static org.openide.filesystems.FileUtil.toFileObject;
+import org.openide.util.Exceptions;
+import org.openide.util.RequestProcessor;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+public class POMManager {
+
+ private Project project;
+
+ private FileObject pomFileObject;
+
+ private POMModel pomModel;
+
+ private NbMavenProject mavenProject;
+
+ private Model sourceModel;
+
+ private List<ModelOperation<POMModel>> operations;
+
+ private static final RequestProcessor RP = new RequestProcessor(POMManager.class);
+
+ private BiFunction<Xpp3Dom, POMExtensibilityElement, Boolean> extensionOverrideFilter;
+
+ public POMManager(Project project){
+ this(project, false);
+ }
+
+ public POMManager(Project project, boolean readonly) {
+ this.project = project;
+ mavenProject = project.getLookup().lookup(org.netbeans.modules.maven.api.NbMavenProject.class);
+ pomFileObject = toFileObject(mavenProject.getMavenProject().getFile());
+ pomModel = POMModelFactory.getDefault().createFreshModel(Utilities.createModelSource(pomFileObject));
+ operations = new ArrayList<>();
+ if(!readonly) {
+ pomModel.startTransaction();
+ }
+ }
+
+ public POMManager(String inputResource, Project project) {
+ this(project, false);
+ try {
+ //source
+ ModelReader reader = EmbedderFactory.getProjectEmbedder().lookupComponent(ModelReader.class);
+ sourceModel = reader.read(loadResource(inputResource), Collections.singletonMap(ModelReader.IS_STRICT, false));
+ } catch (IOException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ }
+
+ public POMManager(Reader inputResource, Project project) {
+ this(project, false);
+ try {
+ //source
+ ModelReader reader = EmbedderFactory.getProjectEmbedder().lookupComponent(ModelReader.class);
+ sourceModel = reader.read(inputResource, Collections.singletonMap(ModelReader.IS_STRICT, false));
+ } catch (IOException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ }
+
+ public void fixDistributionProperties() {
+ org.netbeans.modules.maven.model.pom.Project pomProject = getPOMProject();
+ if (pomProject.getGroupId() != null) {
+ pomProject.setGroupId(pomProject.getGroupId().toLowerCase());
+ }
+ if (pomProject.getArtifactId() != null) {
+ pomProject.setArtifactId(pomProject.getArtifactId().toLowerCase());
+ }
+ if (pomProject.getVersion() != null) {
+ pomProject.setVersion(pomProject.getVersion().toLowerCase());
+ }
+ }
+
+ private org.netbeans.modules.maven.model.pom.Project getPOMProject() {
+ return pomModel.getProject();
+ }
+
+ public String getGroupId() {
+ return getPOMProject().getGroupId();
+ }
+
+ public String getArtifactId() {
+ return getPOMProject().getArtifactId();
+ }
+
+ public String getVersion() {
+ return getPOMProject().getVersion();
+ }
+
+ public void addProperties(java.util.Properties prop) {
+ addProperties(null, prop);
+ }
+
+ public void addProperties(String profile, java.util.Properties prop) {
+ boolean tx = pomModel.isIntransaction();
+ try {
+ if (!tx) {
+ pomModel.startTransaction();
+ }
+ org.netbeans.modules.maven.model.pom.Project pomProject = getPOMProject();
+ if (profile != null) {
+ Profile targetProfile = pomProject.findProfileById(profile);
+ if (targetProfile == null) {
+ throw new IllegalArgumentException(String.format("Profile[%s] not exist", profile));
+ }
+ if (targetProfile.getProperties() == null) {
+ targetProfile.setProperties(pomModel.getFactory().createProperties());
+ }
+ registerProperties(prop, targetProfile.getProperties());
+ } else {
+ registerProperties(prop, pomProject.getProperties());
+ }
+ } finally {
+ if (!tx) {
+ pomModel.endTransaction();
+ }
+ }
+ }
+
+ public void setExtensionOverrideFilter(BiFunction<Xpp3Dom, POMExtensibilityElement, Boolean> extensionOverrideFilter) {
+ this.extensionOverrideFilter = extensionOverrideFilter;
+ }
+
+ public static boolean isMavenProject(Project project) {
+ return project.getLookup().lookup(NbMavenProject.class) != null;
+ }
+
+ public void reload() {
+ reload(project);
+ }
+
+ public static void reload(Project project) {
+ NbMavenProject mavenProject = project.getLookup().lookup(NbMavenProject.class);
+ try {
+ FileObject pomFileObject = toFileObject(mavenProject.getMavenProject().getFile());
+ POMModel model = POMModelFactory.getDefault().getModel(Utilities.createModelSource(pomFileObject));
+ Utilities.saveChanges(model);
+ } catch (IOException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+
+ RP.post(() -> {
+ mavenProject.triggerDependencyDownload();
+ });
+
+ SwingUtilities.invokeLater(() -> NbMavenProject.fireMavenProjectReload(project));
+ }
+
+ private void execute() {
+ if (sourceModel != null) {
+ org.netbeans.modules.maven.model.pom.Project pomProject = getPOMProject();
+ if (pomProject.getProperties() == null) {
+ pomProject.setProperties(pomModel.getFactory().createProperties());
+ }
+ registerProperties(sourceModel.getProperties(), pomProject.getProperties());
+ pomProject.setDependencyManagement(registerDependencyManagement(sourceModel.getDependencyManagement(), pomProject.getDependencyManagement()));
+ registerDependency(sourceModel.getDependencies(), pomProject);
+ registerRepository();
+ registerBuild();
+ registerProfile();
+ }
+ }
+
+ private Properties registerProperties(java.util.Properties source, Properties target) {
+ if (source != null && !source.isEmpty()) {
+ if (target == null) {
+ target = pomModel.getFactory().createProperties();
+ }
+ for (String sourceKey : source.stringPropertyNames()) {
+ String sourceValue = source.getProperty(sourceKey);
+ target.setProperty(sourceKey, sourceValue);
+ }
+ }
+ return target;
+ }
+
+ private void registerBuild() {
+ if (sourceModel.getBuild() != null) {
+ registerBuildBase(sourceModel.getBuild(), getPOMProject().getBuild());
+ }
+ }
+
+ private BuildBase registerBuildBase(org.apache.maven.model.BuildBase sourceBuild, BuildBase targetBuild) {
+ if (sourceBuild == null) {
+ return targetBuild;
+ }
+ if (targetBuild == null) {
+ targetBuild = pomModel.getFactory().createBuild();
+ }
+ if (sourceBuild.getFinalName() != null) {
+ targetBuild.setFinalName(sourceBuild.getFinalName());
+ }
+ if (sourceBuild.getResources()!= null && !sourceBuild.getResources().isEmpty()) {
+ for (org.apache.maven.model.Resource sourceResource : sourceBuild.getResources()) {
+ Resource targetResource = pomModel.getFactory().createResource();
+ targetResource.setFiltering(Boolean.parseBoolean(sourceResource.getFiltering()));
+ targetResource.setDirectory(sourceResource.getDirectory());
+ targetBuild.addResource(targetResource);
+ }
+ }
+ if (sourceBuild.getPlugins() != null && !sourceBuild.getPlugins().isEmpty()) {
+ for (org.apache.maven.model.Plugin sourcePlugin : sourceBuild.getPlugins()) {
+ Plugin targetPlugin = targetBuild.findPluginById(sourcePlugin.getGroupId(), sourcePlugin.getArtifactId());
+ if (targetPlugin == null) {
+ targetPlugin = pomModel.getFactory().createPlugin();
+ targetPlugin.setGroupId(sourcePlugin.getGroupId());
+ targetPlugin.setArtifactId(sourcePlugin.getArtifactId());
+ targetBuild.addPlugin(targetPlugin);
+ }
+ if (sourcePlugin.getExtensions() != null) {
+ targetPlugin.setExtensions(Boolean.TRUE);
+ }
+ registerDependency(sourcePlugin.getDependencies(), targetPlugin);
+ targetPlugin.setConfiguration(registerConfiguration(sourcePlugin.getConfiguration(), targetPlugin.getConfiguration()));
+ if (sourcePlugin.getExecutions() != null && !sourcePlugin.getExecutions().isEmpty()) {
+ for (org.apache.maven.model.PluginExecution sourceExecution : sourcePlugin.getExecutions()) {
+ PluginExecution targetExecution = targetPlugin.findExecutionById(sourceExecution.getId());
+ if (targetExecution == null) {
+ targetExecution = pomModel.getFactory().createExecution();
+ targetExecution.setId(sourceExecution.getId());
+ sourceExecution.getGoals().forEach(targetExecution::addGoal);
+ targetPlugin.addExecution(targetExecution);
+ }
+ targetExecution.setPhase(sourceExecution.getPhase());
+ targetExecution.setConfiguration(registerConfiguration(sourceExecution.getConfiguration(), targetExecution.getConfiguration()));
+
+ }
+ }
+ targetPlugin.setVersion(sourcePlugin.getVersion());
+ }
+ }
+ return targetBuild;
+ }
+
+ private Configuration registerConfiguration(Object sourceConfig, Configuration targetConfig) {
+ if (sourceConfig != null) {
+ Xpp3Dom parentDOM = (Xpp3Dom) sourceConfig;
+ if (targetConfig == null) {
+ targetConfig = pomModel.getFactory().createConfiguration();
+ }
+ loadDom(parentDOM, targetConfig);
+ }
+ return targetConfig;
+ }
+
+ private void loadDom(Xpp3Dom source, POMComponent target) {
+
+ for (Xpp3Dom childDOM : source.getChildren()) {
+ if (childDOM.getValue() != null) {
+ if (target instanceof Configuration) {
+ ((Configuration) target).setSimpleParameter(childDOM.getName(), childDOM.getValue());
+ } else if (target instanceof POMExtensibilityElement) {
+ Optional<POMComponent> targetComponentOptioal = ((POMExtensibilityElement) target).getChildren()
+ .stream()
+ .filter(targetElement -> {
+ String nodeName = targetElement.getPeer().getNodeName();
+ nodeName = nodeName.substring(nodeName.lastIndexOf(':') + 1);
+ String nodeValue = targetElement.getPeer().getChildNodes().item(0).getNodeValue();
+ return nodeName != null && nodeName.equals(childDOM.getName())
+ && nodeValue != null && nodeValue.equals(childDOM.getValue());
+ })
+ .findAny();
+ if (!targetComponentOptioal.isPresent()) {
+ POMExtensibilityElement element = pomModel.getFactory().createPOMExtensibilityElement(new QName(childDOM.getName()));
+ element.setElementText(childDOM.getValue());
+ target.addExtensibilityElement(element);
+ }
+ } else {
+ target.setChildElementText("propertyName", childDOM.getValue(), new QName(childDOM.getName()));
+ }
+ } else {
+ Optional<POMExtensibilityElement> targetElementOptioal = target.getExtensibilityElements()
+ .stream()
+ .filter(targetElement -> targetElement.getQName().getLocalPart().equals(childDOM.getName()))
+ .filter(targetElement -> extensionOverrideFilter == null || extensionOverrideFilter.apply(childDOM, targetElement))
+ .findAny();
+
+ POMExtensibilityElement element;
+ if (targetElementOptioal.isPresent()) {
+ element = targetElementOptioal.get();
+ } else {
+ element = pomModel.getFactory().createPOMExtensibilityElement(new QName(childDOM.getName()));
+ target.addExtensibilityElement(element);
+ }
+ loadDom(childDOM, element);
+ }
+ }
+ }
+
+ private void registerProfile() {
+ if (!sourceModel.getProfiles().isEmpty()) {
+ org.netbeans.modules.maven.model.pom.Project pomProject = getPOMProject();
+ for (org.apache.maven.model.Profile sourceProfile : sourceModel.getProfiles()) {
+ Profile targetProfile = pomProject.findProfileById(sourceProfile.getId());
+ if (targetProfile == null) {
+ targetProfile = pomModel.getFactory().createProfile();
+ pomProject.addProfile(targetProfile);
+ targetProfile.setId(sourceProfile.getId());
+ targetProfile.setProperties(registerProperties(sourceProfile.getProperties(), targetProfile.getProperties()));
+ if (sourceProfile.getActivation() != null) {
+ Activation activation = pomModel.getFactory().createActivation();
+ targetProfile.setActivation(activation);
+ if (sourceProfile.getActivation().getProperty() != null) {
+ org.apache.maven.model.ActivationProperty sourceProperty = sourceProfile.getActivation().getProperty();
+ ActivationProperty targetProperty = pomModel.getFactory().createActivationProperty();
+ activation.setActivationProperty(targetProperty);
+ targetProperty.setName(sourceProperty.getName());
+ targetProperty.setValue(sourceProperty.getValue());
+ } else {
+ activation.setChildElementText("activeByDefault", Boolean.toString(sourceProfile.getActivation().isActiveByDefault()), new QName("activeByDefault"));
+ }
+ }
+ }
+ targetProfile.setDependencyManagement(registerDependencyManagement(sourceProfile.getDependencyManagement(), targetProfile.getDependencyManagement()));
+ registerDependency(sourceProfile.getDependencies(), targetProfile);
+ targetProfile.setBuildBase(registerBuildBase(sourceProfile.getBuild(), targetProfile.getBuildBase()));
+ }
+ }
+ }
+
+ private DependencyManagement registerDependencyManagement(org.apache.maven.model.DependencyManagement source, DependencyManagement target) {
+ if (source != null) {
+ if (target == null) {
+ target = pomModel.getFactory().createDependencyManagement();
+ }
+ registerDependency(source.getDependencies(), target);
+ }
+ return target;
+ }
+
+ private void registerDependency(List<org.apache.maven.model.Dependency> source, DependencyContainer target) {
+ source.forEach((sourceDependency) -> {
+ org.netbeans.modules.maven.model.pom.Dependency targetDependency = target.findDependencyById(sourceDependency.getGroupId(), sourceDependency.getArtifactId(), null);
+ if (targetDependency == null) {
+ targetDependency = createDependency(sourceDependency);
+ target.addDependency(targetDependency);
+ }
+ updateDependency(sourceDependency, targetDependency);
+ });
+ }
+
+ public void registerDependency(String groupId, String artifactId, String version, String type, String classifier, String scope) {
+ org.apache.maven.model.Dependency dependency = new org.apache.maven.model.Dependency();
+ dependency.setGroupId(groupId);
+ dependency.setArtifactId(artifactId);
+ dependency.setVersion(version);
+ dependency.setType(type);
+ dependency.setClassifier(classifier);
+ dependency.setScope(scope);
+ registerDependency(Collections.singletonList(dependency), getPOMProject());
+ }
+
+ private Dependency createDependency(org.apache.maven.model.Dependency source) {
+ Dependency target = pomModel.getFactory().createDependency();
+ target.setGroupId(source.getGroupId());
+ target.setArtifactId(source.getArtifactId());
+ target.setClassifier(source.getClassifier());
+ if (!"jar".equals(source.getType())) {
+ target.setType(source.getType());
+ }
+ target.setScope(source.getScope());
+ return target;
+ }
+
+ private void updateDependency(org.apache.maven.model.Dependency source, Dependency target) {
+ target.setVersion(source.getVersion());
+ if (source.getExclusions() != null && !source.getExclusions().isEmpty()) {
+ for (org.apache.maven.model.Exclusion sourceExclusion : source.getExclusions()) {
+ Exclusion targetExclusion = target.findExclusionById(sourceExclusion.getGroupId(), sourceExclusion.getArtifactId());
+ if (targetExclusion == null) {
+ targetExclusion = pomModel.getFactory().createExclusion();
+ targetExclusion.setGroupId(sourceExclusion.getGroupId());
+ targetExclusion.setArtifactId(sourceExclusion.getArtifactId());
+ target.addExclusion(targetExclusion);
+ }
+ }
+ }
+ }
+
+ private void registerRepository() {
+ if (sourceModel.getRepositories().size() > 0) {
+ operations.add(pomModel -> {
+ Set<String> existingRepositories = getPOMProject().getRepositories() != null ?
+ getPOMProject().getRepositories()
+ .stream()
+ .map(Repository::getId)
+ .collect(toSet())
+ : Collections.EMPTY_SET;
+ for (org.apache.maven.model.Repository repository : sourceModel.getRepositories()) {
+ if (!existingRepositories.contains(repository.getId())) {
+ Repository repo = pomModel.getFactory().createRepository();
+ repo.setId(repository.getId());
+ repo.setName(repository.getName());
+ repo.setLayout(repository.getLayout());
+ repo.setUrl(repository.getUrl());
+ if (repository.getSnapshots() != null) {
+ RepositoryPolicy policy = pomModel.getFactory().createReleaseRepositoryPolicy();
+ policy.setEnabled(Boolean.valueOf(repository.getSnapshots().getEnabled()));
+ repo.setReleases(policy);
+ }
+ getPOMProject().addRepository(repo);
+ }
+ }
+ });
+ }
+ }
+
+ public void setSourceVersion(final String version) {
+ operations.add(pomModel -> ModelUtils.setSourceLevel(pomModel, version));
+ }
+
+ public void commit() {
+ execute();
+ if (operations.size() > 0) {
+ Utilities.performPOMModelOperations(pomFileObject, operations);
+ }
+ pomModel.endTransaction();
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/TemplateUtil.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/TemplateUtil.java
new file mode 100644
index 0000000..4579a65
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/TemplateUtil.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.plugin;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.net.URL;
+import java.nio.charset.Charset;
+import java.util.Map;
+import javax.script.Bindings;
+import javax.script.ScriptContext;
+import javax.script.ScriptEngine;
+import javax.script.ScriptException;
+import org.openide.util.Exceptions;
+import org.openide.util.Lookup;
+import org.netbeans.api.scripting.Scripting;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+public class TemplateUtil {
+
+ private static final String ENCODING_PROPERTY_NAME = "encoding"; //NOI18N
+
+ private static URL getResourceURL(String resource) {
+ ClassLoader loader = Lookup.getDefault().lookup(ClassLoader.class);
+ if (loader == null) {
+ loader = Thread.currentThread().getContextClassLoader();
+ }
+ return loader.getResource(resource.startsWith("/") ? resource.substring(1) : resource);
+ }
+
+ public static InputStream loadResource(String resource) {
+ InputStream inputStream = null;
+ try {
+ inputStream = getResourceURL(resource).openStream();
+ } catch (IOException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ return inputStream;
+ }
+
+ public static String expandTemplate(Reader reader, Map<String, Object> values) {
+ StringWriter writer = new StringWriter();
+ ScriptEngine eng = getScriptEngine();
+ Bindings bind = eng.getContext().getBindings(ScriptContext.ENGINE_SCOPE);
+ if (values != null) {
+ bind.putAll(values);
+ }
+ bind.put(ENCODING_PROPERTY_NAME, Charset.defaultCharset().name());
+ eng.getContext().setWriter(writer);
+ try {
+ eng.eval(reader);
+ } catch (ScriptException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+
+ return writer.toString();
+ }
+
+
+ private static ScriptEngine getScriptEngine() {
+ return Scripting.createManager().getEngineByName("freemarker"); // NOI18N
+ }
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/Wizards.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/Wizards.java
new file mode 100644
index 0000000..1cb873d
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/Wizards.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.plugin;
+
+import javax.swing.JComponent;
+import org.openide.WizardDescriptor;
+import org.openide.util.Parameters;
+
+/**
+ * This class consists of static utility methods for manipulating wizards.
+ *
+ */
+public final class Wizards {
+
+ private static final String WIZARD_PANEL_CONTENT_DATA = WizardDescriptor.PROP_CONTENT_DATA; // NOI18N
+ private static final String WIZARD_PANEL_CONTENT_SELECTED_INDEX = WizardDescriptor.PROP_CONTENT_SELECTED_INDEX; //NOI18N;
+
+ private Wizards() {
+ }
+
+ /**
+ * Merges the given <code>steps</code> with the given <code>panels</code>
+ * into the given <code>wizard</code>. If the wizard has existing steps, the
+ * new steps will be added after them.
+ *
+ * @param wizard the wizard to which to merge; must not be null.
+ * @param panels the panels to merge; must not be null.
+ * @param steps the steps to merge or null if the steps should be taken from
+ * the {@link JComponent#getName names} of the panels components.
+ */
+ public static void mergeSteps(WizardDescriptor wizard, WizardDescriptor.Panel[] panels, String[] steps) {
+ Parameters.notNull("wizard", wizard); //NOI18N
+ Parameters.notNull("panels", panels); //NOI18N
+
+ Object prop = wizard.getProperty(WIZARD_PANEL_CONTENT_DATA);
+ String[] beforeSteps;
+ int offset;
+ if (prop instanceof String[]) {
+ beforeSteps = (String[]) prop;
+ offset = beforeSteps.length;
+ if (offset > 0 && ("...".equals(beforeSteps[offset - 1]))) {// NOI18N
+ offset--;
+ }
+ } else {
+ beforeSteps = null;
+ offset = 0;
+ }
+ String[] resultSteps = new String[(offset) + panels.length];
+ for (int i = 0; i < offset; i++) {
+ resultSteps[i] = beforeSteps[i];
+ }
+ setSteps(panels, steps, resultSteps, offset);
+ }
+
+ private static void setSteps(WizardDescriptor.Panel[] panels, String[] steps, String[] resultSteps, int offset) {
+ int n = steps == null ? 0 : steps.length;
+ for (int i = 0; i < panels.length; i++) {
+ final JComponent component = (JComponent) panels[i].getComponent();
+ String step = i < n ? steps[i] : null;
+ if (step == null) {
+ step = component.getName();
+ }
+ component.putClientProperty(WIZARD_PANEL_CONTENT_DATA, resultSteps);
+ component.putClientProperty(WIZARD_PANEL_CONTENT_SELECTED_INDEX, i);
+ component.getAccessibleContext().setAccessibleDescription(step);
+ resultSteps[i + offset] = step;
+ }
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/resources/PayaraMicroPluginDescription.html b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/resources/PayaraMicroPluginDescription.html
new file mode 100644
index 0000000..dee57ca
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/resources/PayaraMicroPluginDescription.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!--
+
+ 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.
+
+-->
+<html>
+ <body>
+ <div>
+ Payara Micro maven plugin can start & stop Payara Micro instance and create an Uber JAR bundle of the application and Payara Micro.
+ </div>
+ </body>
+</html>
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/resources/pom.xml.ftl b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/resources/pom.xml.ftl
new file mode 100644
index 0000000..1173b02
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/resources/pom.xml.ftl
@@ -0,0 +1,59 @@
+<?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>fish.payara.micro</groupId>
+ <artifactId>payara-micro-sample</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+
+ <properties>
+ <version.payara>${payaraMicroVersion}</version.payara>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>fish.payara.maven.plugins</groupId>
+ <artifactId>payara-micro-maven-plugin</artifactId>
+ <version>1.0.5</version>
+ <configuration>
+ <payaraVersion>${r"${version.payara}"}</payaraVersion>
+ <deployWar>false</deployWar>
+ <commandLineOptions>
+<#if autoBindHttp == "true">
+ <option>
+ <key>--autoBindHttp</key>
+ </option>
+</#if>
+ <option>
+ <key>--deploy</key>
+ <value>${r"${project.build.directory}"}/${r"${project.build.finalName}"}</value>
+ </option>
+ </commandLineOptions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ActionType.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ActionType.java
new file mode 100644
index 0000000..a664ae0
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ActionType.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.BUILD_ICON;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.CLEAN_ICON;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.DEBUG_ICON;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROFILE_ICON;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.REBUILD_ICON;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.RELOAD_ICON;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.START_ICON;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+public enum ActionType {
+
+ CLEAN(CLEAN_ICON),
+ BUILD(BUILD_ICON),
+ BUILD_WITH_DEPENDENCIES(BUILD_ICON),
+ REBUILD(REBUILD_ICON),
+
+ MICRO_COMPLIE_EXPLODE(RELOAD_ICON),
+ MICRO_EXPLODE(RELOAD_ICON),
+
+ RUN(START_ICON),
+ DEBUG(DEBUG_ICON),
+ PROFILE(PROFILE_ICON);
+
+ private final String icon;
+
+ private ActionType(String icon) {
+ this.icon = icon;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public static ActionType toAction(String actionType) {
+ return ActionType.valueOf(actionType.toUpperCase());
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/Bundle.properties b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/Bundle.properties
new file mode 100644
index 0000000..8f2e73f
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/Bundle.properties
@@ -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.
+#
+MSG_DeployOnSave_Deployed={0} deployed.
+MSG_DeployOnSave_Failed={0} failed.
+MicroPropertiesPanel.microVersionLabel.text=Payara Micro Version:
+MSG_IncrementalDeployFailed=Error during incremental deploy\: {0}
+TXT_Reload=Reload ({0})
+ERR_Compile_On_Save_Not_Enabled=Reload Error ({0} : Compile on save not enabled)
+ERR_Payara_Micro_Plugin_Not_Found=Reload Error ({0} : Payara Micro plugin not found)
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/DeployOnSaveManager.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/DeployOnSaveManager.java
new file mode 100644
index 0000000..77a316e
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/DeployOnSaveManager.java
@@ -0,0 +1,656 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.ref.WeakReference;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import static java.util.Collections.unmodifiableList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.WeakHashMap;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.netbeans.api.java.source.BuildArtifactMapper;
+import org.netbeans.api.java.source.BuildArtifactMapper.ArtifactsUpdated;
+import org.netbeans.api.project.Project;
+import org.netbeans.modules.j2ee.deployment.devmodules.spi.ArtifactListener;
+import org.netbeans.modules.j2ee.deployment.devmodules.spi.ArtifactListener.Artifact;
+import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeApplicationProvider;
+import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
+import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider.ConfigSupport.DeployOnSaveListener;
+import org.netbeans.modules.maven.j2ee.utils.MavenProjectSupport;
+import org.openide.awt.StatusDisplayer;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.filesystems.URLMapper;
+import org.openide.util.Exceptions;
+import org.openide.util.Lookup;
+import org.openide.util.NbBundle;
+import static org.openide.util.NbBundle.getMessage;
+
+public final class DeployOnSaveManager {
+
+ public static enum DeploymentState {
+
+ MODULE_NOT_DEPLOYED,
+ MODULE_UPDATED,
+ DEPLOYMENT_FAILED
+
+ }
+
+ private static final Logger LOGGER = Logger.getLogger(DeployOnSaveManager.class.getName());
+
+ private static final int DELAY = 300;
+
+ private static DeployOnSaveManager instance;
+
+ private final WeakHashMap<J2eeModuleProvider, CompileOnSaveListener> compileListeners = new WeakHashMap<>();
+
+ private final WeakHashMap<J2eeModuleProvider, CopyOnSaveListener> copyListeners = new WeakHashMap<>();
+
+ private final WeakHashMap<J2eeModuleProvider, List<DeployOnSaveListener>> projectListeners = new WeakHashMap<>();
+
+ /**
+ * We need a custom thread factory because the default one stores the
+ * ThreadGroup in constructor. If the group is destroyed in between the
+ * submit throws IllegalThreadStateException.
+ */
+ private final ExecutorService EXECUTOR = Executors.newFixedThreadPool(1, runnable -> {
+ Thread t = new Thread(runnable);
+
+ if (t.isDaemon()) {
+ t.setDaemon(false);
+ }
+ if (t.getPriority() != Thread.NORM_PRIORITY) {
+ t.setPriority(Thread.NORM_PRIORITY);
+ }
+ return t;
+ });
+
+ //private final ExecutorService EXECUTOR = Executors.newFixedThreadPool(1);
+ /** <i>GuardedBy("this")</i>
+ */
+ private Map<J2eeModuleProvider, Set<Artifact>> toDeploy = new HashMap<>();
+
+ /** <i>GuardedBy("this")</i>
+ */
+ private final Map<J2eeModuleProvider, DeploymentState> lastDeploymentStates = new HashMap<>();
+
+ /** <i>GuardedBy("this")</i>
+ */
+ private Future<?> current;
+
+ private DeployOnSaveManager() {
+ }
+
+ public static synchronized DeployOnSaveManager getDefault() {
+ if (instance == null) {
+ instance = new DeployOnSaveManager();
+ }
+ return instance;
+ }
+
+ public void startListening(Project project, J2eeModuleProvider j2eeProvider) {
+ synchronized (this) {
+ if (compileListeners.containsKey(j2eeProvider)) {
+ // this is due to EAR childs :(
+ if (j2eeProvider instanceof J2eeApplicationProvider) {
+ stopListening(project, j2eeProvider);
+ } else {
+ LOGGER.log(Level.FINE, "Already listening on {0}", j2eeProvider);
+ return;
+ }
+ }
+
+ List<J2eeModuleProvider> providers = new ArrayList<>(4);
+ providers.add(j2eeProvider);
+
+ if (j2eeProvider instanceof J2eeApplicationProvider) {
+ Collections.addAll(providers,
+ ((J2eeApplicationProvider) j2eeProvider).getChildModuleProviders());
+ }
+
+ // get all binary urls
+ List<URL> urls = new ArrayList<>();
+ for (J2eeModuleProvider provider : providers) {
+ for (FileObject file : provider.getSourceFileMap().getSourceRoots()) {
+ URL url = URLMapper.findURL(file, URLMapper.EXTERNAL);
+ if (url != null) {
+ urls.add(url);
+ }
+ }
+ }
+
+ // register CLASS listener
+ CompileOnSaveListener listener = new CompileOnSaveListener(project, j2eeProvider, urls);
+ for (URL url : urls) {
+ BuildArtifactMapper.addArtifactsUpdatedListener(url, listener);
+ }
+ compileListeners.put(j2eeProvider, listener);
+
+ // register WEB listener
+ J2eeModuleProvider.DeployOnSaveSupport support = j2eeProvider.getDeployOnSaveSupport();
+ if (support != null) {
+ CopyOnSaveListener copyListener = new CopyOnSaveListener(project, j2eeProvider);
+ support.addArtifactListener(copyListener);
+ copyListeners.put(j2eeProvider, copyListener);
+ }
+ }
+ }
+
+ public void stopListening(Project project, J2eeModuleProvider j2eeProvider) {
+ synchronized (this) {
+ CompileOnSaveListener removed = compileListeners.remove(j2eeProvider);
+ if (removed == null) {
+ LOGGER.log(Level.FINE, "Not compile-listening on {0}", j2eeProvider);
+ } else {
+ for (URL url : removed.getRegistered()) {
+ BuildArtifactMapper.removeArtifactsUpdatedListener(url, removed);
+ }
+ }
+
+ CopyOnSaveListener copyRemoved = copyListeners.remove(j2eeProvider);
+ if (removed == null) {
+ LOGGER.log(Level.FINE, "Not copy-listening on {0}", j2eeProvider);
+ } else {
+ J2eeModuleProvider.DeployOnSaveSupport support = j2eeProvider.getDeployOnSaveSupport();
+ if (support != null) {
+ support.removeArtifactListener(copyRemoved);
+ }
+ }
+ }
+ }
+
+ public void addDeployOnSaveListener(J2eeModuleProvider provider, DeployOnSaveListener listener) {
+ synchronized (this) {
+ List<DeployOnSaveListener> listeners = projectListeners.get(provider);
+ if (listeners == null) {
+ listeners = new ArrayList<>();
+ projectListeners.put(provider, listeners);
+ }
+ listeners.add(listener);
+ }
+ }
+
+ public void removeDeployOnSaveListener(J2eeModuleProvider provider, DeployOnSaveListener listener) {
+ synchronized (this) {
+ List<DeployOnSaveListener> listeners = projectListeners.get(provider);
+ if (listeners == null) {
+ return;
+ }
+ listeners.remove(listener);
+ if (listeners.isEmpty()) {
+ projectListeners.remove(provider);
+ }
+ }
+ }
+
+ public void notifyInitialDeployment(Project project, J2eeModuleProvider provider) {
+ synchronized (this) {
+ if (compileListeners.containsKey(provider)) {
+ // this is due to EAR childs :(
+ if (provider instanceof J2eeApplicationProvider) {
+ startListening(project, provider);
+ }
+ }
+
+ if (!lastDeploymentStates.containsKey(provider)) {
+ lastDeploymentStates.put(provider, DeploymentState.MODULE_UPDATED);
+ }
+ }
+ }
+
+ public void submitChangedArtifacts(J2eeModuleProvider provider, Iterable<Artifact> artifacts) {
+ assert provider != null;
+ assert artifacts != null;
+
+ synchronized (this) {
+ Set<Artifact> preparedArtifacts = toDeploy.get(provider);
+ if (preparedArtifacts == null) {
+ preparedArtifacts = new HashSet<>();
+ toDeploy.put(provider, preparedArtifacts);
+ }
+ for (Artifact artifact : artifacts) {
+ preparedArtifacts.add(artifact);
+ }
+
+ boolean delayed = true;
+ if (current != null && !current.isDone()) {
+ // TODO interruption throws exception to user from lower levels :((
+ // this is dummy interruption signal handling :(
+ current.cancel(false);
+ delayed = false;
+ }
+
+ current = EXECUTOR.submit(new DeployTask(delayed));
+ }
+ }
+
+ private final class CompileOnSaveListener implements ArtifactsUpdated {
+
+ private final WeakReference<Project> project;
+
+ private final WeakReference<J2eeModuleProvider> provider;
+
+ private final List<URL> registered;
+
+ public CompileOnSaveListener(Project project, J2eeModuleProvider provider, List<URL> registered) {
+ this.project = new WeakReference<>(project);
+ this.provider = new WeakReference<>(provider);
+ this.registered = registered;
+ }
+
+ public List<URL> getRegistered() {
+ return unmodifiableList(registered);
+ }
+
+ @Override
+ public void artifactsUpdated(Iterable<File> artifacts) {
+ Project realProject = project.get();
+ J2eeModuleProvider realProvider = provider.get();
+
+ if (realProject == null
+ || realProvider == null
+ || !MavenProjectSupport.isDeployOnSave(realProject)) {
+ return;
+ }
+
+ MicroApplication microApplication = MicroApplication.getInstance(realProject);
+ if (microApplication != null) {
+ microApplication.setLoading(true);
+ }
+
+ J2eeModuleProvider.DeployOnSaveClassInterceptor interceptor = realProvider.getDeployOnSaveClassInterceptor();
+
+ Set<Artifact> realArtifacts = new HashSet<>();
+ for (File file : artifacts) {
+ if (file != null) {
+ Artifact a = Artifact.forFile(file);
+ if (interceptor != null) {
+ a = interceptor.convert(a);
+ }
+ realArtifacts.add(a);
+ }
+ }
+
+ if (LOGGER.isLoggable(Level.FINE)) {
+ for (Artifact artifact : realArtifacts) {
+ LOGGER.log(Level.FINE, "Delivered compile artifact: {0}", artifact);
+ }
+ }
+ DeployOnSaveManager.getDefault().submitChangedArtifacts(realProvider, realArtifacts);
+
+ try {
+ current.get();
+ if (microApplication != null) {
+ microApplication.setLoading(false);
+ }
+ } catch (InterruptedException | ExecutionException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ }
+
+ }
+
+ private final class CopyOnSaveListener implements ArtifactListener {
+
+ private final WeakReference<Project> project;
+
+ private final WeakReference<J2eeModuleProvider> provider;
+
+ public CopyOnSaveListener(Project project, J2eeModuleProvider provider) {
+ this.project = new WeakReference<>(project);
+ this.provider = new WeakReference<>(provider);
+ }
+
+ @Override
+ public void artifactsUpdated(Iterable<Artifact> artifacts) {
+ Project realProject = project.get();
+ J2eeModuleProvider realProvider = provider.get();
+
+ if (realProject == null
+ || realProvider == null
+ || !MavenProjectSupport.isDeployOnSave(realProject)) {
+ return;
+ }
+
+ MicroApplication microApplication = MicroApplication.getInstance(realProject);
+ if (microApplication != null) {
+ microApplication.setLoading(true);
+ }
+
+ if (LOGGER.isLoggable(Level.FINE)) {
+ for (Artifact artifact : artifacts) {
+ LOGGER.log(Level.FINE, "Delivered copy artifact: {0}", artifact);
+ }
+ }
+ DeployOnSaveManager.getDefault().submitChangedArtifacts(realProvider, artifacts);
+
+ try {
+ current.get();
+ if (microApplication != null) {
+ microApplication.setLoading(false);
+ }
+ } catch (InterruptedException | ExecutionException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ }
+ }
+
+ private class DeployTask implements Runnable {
+
+ private final boolean delayed;
+
+ public DeployTask(boolean delayed) {
+ this.delayed = delayed;
+ }
+
+ @Override
+ public void run() {
+ if (delayed) {
+ try {
+ Thread.sleep(DELAY);
+ } catch (InterruptedException ex) {
+ LOGGER.log(Level.INFO, null, ex);
+ return;
+ }
+ }
+
+ LOGGER.log(Level.FINE, "Performing pending deployments");
+
+ Map<J2eeModuleProvider, Set<Artifact>> deployNow;
+ Map<J2eeModuleProvider, List<DeployOnSaveListener>> listeners = new HashMap<>();
+ synchronized (DeployOnSaveManager.this) {
+ if (toDeploy.isEmpty()) {
+ return;
+ }
+
+ deployNow = toDeploy;
+ toDeploy = new HashMap<>();
+
+ // copy the listeners
+ for (Map.Entry<J2eeModuleProvider, List<DeployOnSaveListener>> entry : projectListeners.entrySet()) {
+ if (!deployNow.containsKey(entry.getKey())) {
+ continue;
+ }
+ listeners.put(entry.getKey(), new ArrayList<>(entry.getValue()));
+ }
+ }
+
+ for (Map.Entry<J2eeModuleProvider, Set<Artifact>> entry : deployNow.entrySet()) {
+ if (entry.getValue().isEmpty()) {
+ continue;
+ }
+ try {
+ boolean updated = notifyServer(entry.getKey(), entry.getValue());
+ if (updated) {
+ // run nbjpdaapprealoaded task.
+ runJPDAAppReloaded();
+
+ List<DeployOnSaveListener> toFire = listeners.get(entry.getKey());
+ if (toFire != null) {
+ toFire.forEach(listener -> listener.deployed(entry.getValue()));
+ }
+ }
+ } catch (Throwable t) {
+ // do not throw away any exception:
+ LOGGER.log(Level.SEVERE, null, t);
+ }
+ }
+ }
+
+ private boolean notifyServer(J2eeModuleProvider provider, Iterable<Artifact> artifacts) {
+ if (LOGGER.isLoggable(Level.FINEST)) {
+ StringBuilder builder = new StringBuilder("Artifacts updated: [");
+ for (Artifact artifact : artifacts) {
+ builder.append(artifact.getFile().getAbsolutePath()).append(",");
+ }
+ builder.setLength(builder.length() - 1);
+ builder.append("]");
+ LOGGER.log(Level.FINEST, builder.toString());
+ }
+
+ DeploymentState state;
+ try {
+ distributeOnSave(FileUtil.toFile(provider.getJ2eeModule().getContentDirectory()), artifacts);
+ ReloadAction.reloadApplication(provider.getJ2eeModule().getContentDirectory().getPath());
+ state = DeploymentState.MODULE_UPDATED;
+ } catch (IOException ex) {
+ LOGGER.log(Level.INFO, null, ex);
+ state = DeploymentState.DEPLOYMENT_FAILED;
+ }
+
+ String message;
+ switch (state) {
+ case MODULE_UPDATED:
+ message = getMessage(DeployOnSaveManager.class, "MSG_DeployOnSave_Deployed", provider.getDeploymentName());
+ break;
+ case DEPLOYMENT_FAILED:
+ message = getMessage(DeployOnSaveManager.class, "MSG_DeployOnSave_Failed", provider.getDeploymentName());
+ break;
+ default:
+ message = null;
+ }
+
+ if (message != null) {
+ StatusDisplayer.getDefault().setStatusText(message);
+ }
+
+ LOGGER.log(Level.FINE, "Deployment state {0}", state);
+ synchronized (this) {
+ lastDeploymentStates.put(provider, state);
+ }
+ return state == DeploymentState.MODULE_UPDATED;
+ }
+
+ private void runJPDAAppReloaded() {
+ // Hack: run nbjpdaappreloaded ANT task after deploy to fix breakpoints.
+ String reloadedClassName = org.apache.tools.ant.module.api.IntrospectedInfo.getKnownInfo().getDefs("task").get("nbjpdaappreloaded"); // NOI18N
+ if (reloadedClassName == null) {
+ // seems to be null during some unit tests
+ return;
+ }
+ String reloadedPackageName = reloadedClassName.substring(0, reloadedClassName.lastIndexOf('.'));
+ try {
+ Map<String, ClassLoader> customDefClassLoaders = (Map<String, ClassLoader>) Lookup.getDefault().lookup(ClassLoader.class).
+ loadClass("org.apache.tools.ant.module.bridge.AntBridge"). // NOI18N
+ getMethod("getCustomDefClassLoaders").invoke(null); // NOI18N
+ //Class reloadedClass = org.apache.tools.ant.module.bridge.AntBridge.getCustomDefClassLoaders().get(reloadedPackageName).loadClass(reloadedClassName);
+ ClassLoader reloadedClassLoader = customDefClassLoaders.get(reloadedPackageName);
+ if (reloadedClassLoader != null) {
+ Class reloadedClass = reloadedClassLoader.loadClass(reloadedClassName);
+ reloadedClass.getMethod("execute").invoke(reloadedClass.newInstance());
+ }
+ } catch (Exception ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ }
+
+ private void distributeOnSave(File destDir, Iterable<Artifact> artifacts) throws IOException {
+
+ try {
+ FileObject destRoot = FileUtil.createFolder(destDir);
+
+ // create target FOs map keyed by relative paths
+ java.util.Enumeration destFiles = destRoot.getChildren(true);
+ Map destMap = new HashMap();
+ int rootPathLen = destRoot.getPath().length();
+ for (; destFiles.hasMoreElements();) {
+ FileObject destFO = (FileObject) destFiles.nextElement();
+ destMap.put(destFO.getPath().substring(rootPathLen + 1), destFO);
+ }
+
+ FileObject contentDirectory = destRoot;
+ assert contentDirectory != null;
+
+ for (Artifact artifact : artifacts) {
+ File fsFile = artifact.getFile();
+ File altDistFile = artifact.getDistributionPath();
+ if (altDistFile == null) {
+ String classes = "target" + File.separator + "classes";
+ String filePath = artifact.getFile().getPath();
+ String altDistRelativePath = filePath.substring(filePath.indexOf(classes) + classes.length());
+ altDistFile = new File(destRoot.getPath() + File.separator + "WEB-INF" + File.separator + "classes" + altDistRelativePath);
+ }
+
+ FileObject file = FileUtil.toFileObject(FileUtil.normalizeFile(fsFile));
+
+ FileObject checkFile = FileUtil.toFileObject(FileUtil.normalizeFile(altDistFile));
+ if (checkFile == null && file != null) { //#165045
+ checkFile = FileUtil.createData(altDistFile);
+ }
+
+ if (checkFile != null && file != null) {
+ String relative = FileUtil.getRelativePath(contentDirectory, checkFile);
+ if (relative != null) {
+ FileObject targetFO = (FileObject) destMap.get(relative);
+ if (file.isFolder()) {
+ destMap.remove(relative);
+ //continue;
+ }
+
+ createOrReplace(file, targetFO, destRoot, relative, destMap, false);
+ }
+ } else if (checkFile != null && file == null) {
+ checkFile.delete();
+ }
+ }
+
+ } catch (Exception e) {
+ String msg = NbBundle.getMessage(DeployOnSaveManager.class, "MSG_IncrementalDeployFailed", e);
+ throw new RuntimeException(msg, e);
+ }
+ }
+
+ private void createOrReplace(
+ FileObject sourceFO,
+ FileObject targetFO,
+ FileObject destRoot,
+ String relativePath,
+ Map destMap, boolean checkTimeStamps) throws IOException {
+
+ FileObject destFolder;
+ OutputStream destStream = null;
+ InputStream sourceStream = null;
+
+ try {
+ // double check that the target does not exist... 107526
+ // the destMap seems to be incomplete....
+ if (targetFO == null) {
+ targetFO = destRoot.getFileObject(relativePath);
+ }
+ if (targetFO == null) {
+ destFolder = findOrCreateParentFolder(destRoot, relativePath);
+ } else {
+ // remove from map to form of to-remove-target-list
+ destMap.remove(relativePath);
+
+ //check timestamp
+ if (checkTimeStamps) {
+ if (!sourceFO.lastModified().after(targetFO.lastModified())) {
+ return;
+ }
+ }
+ if (targetFO.equals(sourceFO)) {
+ // do not write a file onto itself...
+ return;
+ }
+ destFolder = targetFO.getParent();
+
+ // we need to rewrite the content of the file here... thanks,
+ // to windows file locking.
+ destStream = targetFO.getOutputStream();
+
+ }
+
+ if (sourceFO.isFolder()) {
+ FileUtil.createFolder(destFolder, sourceFO.getNameExt());
+ return;
+ }
+ try {
+ if (null == destStream) {
+ FileUtil.copyFile(sourceFO, destFolder, sourceFO.getName());
+ } else {
+ // this is where we need to push the content into the file....
+ sourceStream = sourceFO.getInputStream();
+ FileUtil.copy(sourceStream, destStream);
+ }
+ } catch (FileNotFoundException ex) {
+ // this may happen when the source file disappears
+ // perhaps when source is changing rapidly ?
+ LOGGER.log(Level.INFO, null, ex);
+ }
+ } finally {
+ if (null != sourceStream) {
+ try {
+ sourceStream.close();
+ } catch (IOException ioe) {
+ LOGGER.log(Level.WARNING, null, ioe);
+ }
+ }
+ if (null != destStream) {
+ try {
+ destStream.close();
+ } catch (IOException ioe) {
+ LOGGER.log(Level.WARNING, null, ioe);
+ }
+ }
+ }
+ }
+
+ /**
+ * Find or create parent folder of a file given its root and its
+ * relative path. The target file does not need to exist.
+ *
+ * @param dest FileObject for the root of the target file
+ * @param relativePath relative path of the target file
+ * @return the FileObject for the parent folder target file.
+ * @throws java.io.IOException
+ */
+ private FileObject findOrCreateParentFolder(FileObject dest, String relativePath) throws IOException {
+ File parentRelativePath = (new File(relativePath)).getParentFile();
+ if (parentRelativePath == null) {
+ return dest;
+ }
+
+ FileObject folder = FileUtil.createFolder(dest, parentRelativePath.getPath());
+ if (folder.isData()) {
+ LOGGER.log(Level.FINER, "found file {0} when a folder was expecetd", folder.getPath());
+ folder = null;
+ }
+ return folder;
+ }
+
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ExecutionChecker.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ExecutionChecker.java
new file mode 100644
index 0000000..64be20e
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ExecutionChecker.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.COMMAND_EXPLODE;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.COMPILE_EXPLODE_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.DEBUG_SINGLE_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.EXPLODE_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.MAVEN_WAR_PROJECT_TYPE;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROFILE_SINGLE_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.RUN_SINGLE_ACTION;
+import java.io.File;
+import static java.util.Arrays.asList;
+import java.util.HashSet;
+import java.util.Set;
+import org.netbeans.api.project.Project;
+import org.netbeans.modules.maven.api.execute.ExecutionContext;
+import org.netbeans.modules.maven.api.execute.ExecutionResultChecker;
+import org.netbeans.modules.maven.api.execute.PrerequisitesChecker;
+import org.netbeans.modules.maven.api.execute.RunConfig;
+import static org.netbeans.spi.project.ActionProvider.COMMAND_BUILD;
+import static org.netbeans.spi.project.ActionProvider.COMMAND_CLEAN;
+import static org.netbeans.spi.project.ActionProvider.COMMAND_DEBUG;
+import static org.netbeans.spi.project.ActionProvider.COMMAND_PROFILE;
+import static org.netbeans.spi.project.ActionProvider.COMMAND_REBUILD;
+import static org.netbeans.spi.project.ActionProvider.COMMAND_RUN;
+import org.netbeans.spi.project.ProjectServiceProvider;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+@ProjectServiceProvider(
+ service = {
+ ExecutionResultChecker.class,
+ PrerequisitesChecker.class
+ },
+ projectType = MAVEN_WAR_PROJECT_TYPE
+)
+public class ExecutionChecker implements ExecutionResultChecker, PrerequisitesChecker {
+
+ private static final String COMMAND_BUILD_WITH_DEPENDENCIES = "build-with-dependencies";
+
+ private static final Set<String> BUILD_ACTIONS = new HashSet<>(asList(new String[]{
+ COMMAND_CLEAN,
+ COMMAND_BUILD,
+ COMMAND_REBUILD,
+ COMMAND_BUILD_WITH_DEPENDENCIES,
+ COMPILE_EXPLODE_ACTION,
+ EXPLODE_ACTION
+ }));
+
+ private static final Set<String> RUN_ACTIONS = new HashSet<>(asList(new String[]{
+ COMMAND_RUN,
+ COMMAND_DEBUG,
+ COMMAND_PROFILE,
+ RUN_SINGLE_ACTION,
+ DEBUG_SINGLE_ACTION,
+ PROFILE_SINGLE_ACTION
+ }));
+
+
+ @Override
+ public boolean checkRunConfig(RunConfig config) {
+ Project project = config.getProject();
+ MicroApplication microApplication = MicroApplication.getInstance(project);
+ if (microApplication != null) {
+ if (BUILD_ACTIONS.contains(config.getActionName())) {
+ microApplication.setBuilding(true, config.getActionName());
+ }else if (RUN_ACTIONS.contains(config.getActionName())) {
+ microApplication.setRunning(true, config.getActionName());
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public void executionResult(RunConfig config, ExecutionContext res, int resultCode) {
+ Project project = config.getProject();
+ MicroApplication microApplication = MicroApplication.getInstance(project);
+ if (microApplication != null) {
+ if (BUILD_ACTIONS.contains(config.getActionName())) {
+ if(config.getActionName().contains(COMMAND_BUILD)
+ || config.getActionName().contains(COMMAND_EXPLODE) ){
+ reloadApplication(microApplication);
+ }
+ microApplication.setBuilding(false);
+ } else if (RUN_ACTIONS.contains(config.getActionName())) {
+ microApplication.setRunning(false);
+ }
+ }
+ }
+
+ public static void reloadApplication(MicroApplication application) {
+ if (!application.isRunning()) {
+ return;
+ }
+ String buildPath = application.getMavenProject().getBuild().getDirectory()
+ + File.separator
+ + application.getMavenProject().getBuild().getFinalName();
+ ReloadAction.reloadApplication(buildPath);
+ }
+
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/LookupProviderImpl.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/LookupProviderImpl.java
new file mode 100644
index 0000000..5623345
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/LookupProviderImpl.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+import org.netbeans.api.project.Project;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.MAVEN_WAR_PROJECT_TYPE;
+import static org.netbeans.modules.fish.payara.micro.project.MicroApplication.isPayaraMicroProject;
+import org.netbeans.spi.project.LookupProvider;
+import org.openide.util.Lookup;
+import org.openide.util.lookup.Lookups;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+@LookupProvider.Registration(projectType = MAVEN_WAR_PROJECT_TYPE)
+public class LookupProviderImpl implements LookupProvider {
+
+ @Override
+ public Lookup createAdditionalLookup(Lookup lookup) {
+ Project project = lookup.lookup(Project.class);
+ MicroApplication application = null;
+ if (isPayaraMicroProject(project)) {
+ application = new MicroApplication(project);
+ }
+ return Lookups.singleton(new MicroApplicationContent(application));
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroActionsProvider.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroActionsProvider.java
new file mode 100644
index 0000000..c0ea156
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroActionsProvider.java
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.DEBUG_SINGLE_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.MAVEN_WAR_PROJECT_TYPE;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROFILE_SINGLE_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.RUN_SINGLE_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.WAR_PACKAGING;
+import org.netbeans.modules.fish.payara.micro.project.MicroApplication;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.prefs.Preferences;
+import org.netbeans.api.annotations.common.StaticResource;
+import org.netbeans.api.project.Project;
+import static org.netbeans.api.project.ProjectUtils.getPreferences;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.COMPILE_EXPLODE_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.COMPILE_GOAL;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.DEBUG_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.EXPLODED_GOAL;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.EXPLODE_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROFILE_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.RESOURCES_GOAL;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.RUN_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.START_GOAL;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.STOP_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.STOP_GOAL;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.VERSION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.WAR_GOAL;
+import org.netbeans.modules.maven.api.NbMavenProject;
+import org.netbeans.modules.maven.api.execute.RunConfig;
+import org.netbeans.modules.maven.execute.model.NetbeansActionMapping;
+import org.netbeans.modules.maven.spi.actions.AbstractMavenActionsProvider;
+import org.netbeans.modules.maven.spi.actions.MavenActionsProvider;
+import static org.netbeans.spi.project.ActionProvider.COMMAND_DEBUG;
+import static org.netbeans.spi.project.ActionProvider.COMMAND_PROFILE;
+import static org.netbeans.spi.project.ActionProvider.COMMAND_RUN;
+import org.netbeans.spi.project.ProjectServiceProvider;
+import org.openide.util.Lookup;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+@ProjectServiceProvider(
+ service = MavenActionsProvider.class,
+ projectType = MAVEN_WAR_PROJECT_TYPE
+)
+public class MicroActionsProvider implements MavenActionsProvider {
+
+ @StaticResource
+ private static final String ACTION_MAPPINGS = "org/netbeans/modules/fish/payara/micro/project/resources/action-mapping.xml";
+
+ private final AbstractMavenActionsProvider actionsProvider = new AbstractMavenActionsProvider() {
+ @Override
+ protected InputStream getActionDefinitionStream() {
+ return MicroActionsProvider.class
+ .getClassLoader()
+ .getResourceAsStream(ACTION_MAPPINGS);
+ }
+
+ @Override
+ public boolean isActionEnable(String action, Project project, Lookup lookup) {
+ NbMavenProject nbMavenProject = project.getLookup().lookup(NbMavenProject.class);
+ final String packagingType = nbMavenProject.getPackagingType();
+ if (!WAR_PACKAGING.equals(packagingType)) {
+ return false;
+ }
+ switch (action) {
+ case COMMAND_RUN:
+ case COMMAND_DEBUG:
+ case COMMAND_PROFILE:
+ case RUN_SINGLE_ACTION:
+ case DEBUG_SINGLE_ACTION:
+ case PROFILE_SINGLE_ACTION:
+ break;
+ default:
+ return false;
+ }
+ return MicroApplication.getInstance(project) != null;
+ }
+
+ };
+
+ @Override
+ public RunConfig createConfigForDefaultAction(String actionName, Project project, Lookup lookup) {
+ Preferences pref = getPreferences(project, MicroApplication.class, true);
+ String microVersionText = pref.get(VERSION, "");
+ RunConfig config = actionsProvider.createConfigForDefaultAction(actionName, project, lookup);
+ if(!microVersionText.isEmpty()){
+ config.setProperty("version.payara", microVersionText);
+ }
+ config.getGoals().addAll(getGoals(actionName));
+ return config;
+ }
+
+ @Override
+ public NetbeansActionMapping getMappingForAction(String actionName, Project project) {
+ return actionsProvider.getMappingForAction(actionName, project);
+ }
+
+ @Override
+ public boolean isActionEnable(String action, Project project, Lookup lookup) {
+ return actionsProvider.isActionEnable(action, project, lookup);
+ }
+
+ @Override
+ public Set<String> getSupportedDefaultActions() {
+ return actionsProvider.getSupportedDefaultActions();
+ }
+
+ public static List<String> getGoals(String actionName) {
+ List<String> goals = new ArrayList<>();
+ if (null != actionName) {
+ switch (actionName) {
+ case RUN_ACTION:
+ case RUN_SINGLE_ACTION:
+ goals.add(RESOURCES_GOAL);
+ goals.add(COMPILE_GOAL);
+ goals.add(EXPLODED_GOAL);
+ goals.add(STOP_GOAL);
+ goals.add(START_GOAL);
+ break;
+ case DEBUG_ACTION:
+ case DEBUG_SINGLE_ACTION:
+ case PROFILE_ACTION:
+ case PROFILE_SINGLE_ACTION:
+ goals.add(WAR_GOAL);
+ goals.add(STOP_GOAL);
+ goals.add(START_GOAL);
+ break;
+ case COMPILE_EXPLODE_ACTION:
+ goals.add(RESOURCES_GOAL);
+ goals.add(COMPILE_GOAL);
+ goals.add(EXPLODED_GOAL);
+ break;
+ case EXPLODE_ACTION:
+ goals.add(EXPLODED_GOAL);
+ break;
+ case STOP_ACTION:
+ goals.add(STOP_GOAL);
+ break;
+ default:
+ break;
+ }
+ }
+ return goals;
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroApplication.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroApplication.java
new file mode 100644
index 0000000..43ef4c3
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroApplication.java
@@ -0,0 +1,173 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.maven.project.MavenProject;
+import org.netbeans.api.project.Project;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PAYARA_MICRO_MAVEN_PLUGIN;
+import org.netbeans.modules.maven.api.NbMavenProject;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+public class MicroApplication {
+
+ private final Project project;
+
+ private final MavenProject mavenProject;
+
+ private ActionType buildActionType;
+
+ private boolean buildAction;
+
+ private ActionType runActionType;
+
+ private final AtomicInteger runActionCount = new AtomicInteger();
+
+ private boolean reloadAction;
+
+ private static final String SINGLE = ".single.deploy";
+
+ public MicroApplication(Project project) {
+ this.project = project;
+ NbMavenProject nbMavenProject = project.getLookup().lookup(NbMavenProject.class);
+ this.mavenProject = nbMavenProject.getMavenProject();
+ }
+
+ public Project getProject() {
+ return project;
+ }
+
+ public MavenProject getMavenProject() {
+ return mavenProject;
+ }
+
+ public void setBuilding(boolean buildAction, String actionType) {
+ this.buildActionType = ActionType.toAction(actionType.replace("-", "_"));
+ setBuilding(buildAction);
+ }
+
+ public void setBuilding(boolean buildAction) {
+ this.buildAction = buildAction;
+ NbMavenProject.fireMavenProjectReload(project);
+ }
+
+ public ActionType getBuildActionType() {
+ return buildActionType;
+ }
+
+ public boolean isBuilding() {
+ return buildAction;
+ }
+
+ public void setRunning(boolean running, String actionType) {
+ this.runActionType = ActionType.toAction(actionType.replace(SINGLE, ""));
+ setRunning(running);
+ }
+
+ public void setRunning(boolean running) {
+ if (running) {
+ runActionCount.incrementAndGet();
+ } else if (isRunning()) { // skip negative decrement
+ runActionCount.decrementAndGet();
+ }
+ NbMavenProject.fireMavenProjectReload(project);
+ }
+
+ public boolean isRunning() {
+// runActionCount.getAndSet(calcRunningInstanceCount());
+ return runActionCount.get() > 0;
+ }
+
+ private int calcRunningInstanceCount() {
+ System.out.println("calcRunningInstanceCount");
+ List<String> processIds = new ArrayList<>();
+ String executorFilter = "gav=" + mavenProject.getGroupId() + ":" + mavenProject.getArtifactId() + ":" + mavenProject.getVersion();
+ final Runtime re = Runtime.getRuntime();
+ try {
+ Process jpsProcess = re.exec("jps -v");
+ InputStream inputStream = jpsProcess.getInputStream();
+ BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
+ String line;
+ while ((line = in.readLine()) != null) {
+ if (line.contains(executorFilter)) {
+ String[] split = line.split(" ");
+ processIds.add(split[0]);
+ }
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return processIds.size();
+ }
+
+ public int getRunningInstanceCount() {
+ return runActionCount.get();
+ }
+
+ public ActionType getRunActionType() {
+ return runActionType;
+ }
+
+ public void setLoading(boolean loading) {
+ this.reloadAction = loading;
+ NbMavenProject.fireMavenProjectReload(project);
+ }
+
+ public boolean isLoading() {
+ return reloadAction;
+ }
+
+ public static MicroApplication getInstance(Project project) {
+ MicroApplication microApplication = null;
+ if (project != null) {
+ MicroApplicationContent content = project.getLookup().lookup(MicroApplicationContent.class);
+ microApplication = content.getMicroApplication();
+ }
+ return microApplication;
+ }
+
+ public static MicroApplication registerInstance(Project project) {
+ MicroApplication microApplication = null;
+ if (project != null) {
+ MicroApplicationContent content = project.getLookup().lookup(MicroApplicationContent.class);
+ if(content != null) {
+ microApplication = new MicroApplication(project);
+ content.setMicroApplication(microApplication);
+ }
+ }
+ return microApplication;
+ }
+
+ public static boolean isPayaraMicroProject(Project project) {
+ NbMavenProject nbMavenProject = project.getLookup().lookup(NbMavenProject.class);
+ MavenProject mavenProject = nbMavenProject.getMavenProject();
+ return mavenProject.getPluginArtifactMap()
+ .get(PAYARA_MICRO_MAVEN_PLUGIN) != null;
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroApplicationContent.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroApplicationContent.java
new file mode 100644
index 0000000..4a92c97
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroApplicationContent.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+public class MicroApplicationContent {
+
+ private MicroApplication microApplication;
+
+ public MicroApplicationContent(MicroApplication microApplication) {
+ this.microApplication = microApplication;
+ }
+
+ public MicroApplication getMicroApplication() {
+ return microApplication;
+ }
+
+ void setMicroApplication(MicroApplication microApplication) {
+ this.microApplication = microApplication;
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroIcon.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroIcon.java
new file mode 100644
index 0000000..c531c1c
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroIcon.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.MAVEN_WAR_PROJECT_TYPE;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROJECT_ICON;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.RELOAD_ICON;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.RESTART_ICON;
+import javax.swing.Icon;
+import org.netbeans.api.project.Project;
+import org.netbeans.modules.maven.j2ee.ui.EEIcons.WarIcon;
+import org.netbeans.modules.maven.spi.nodes.SpecialIcon;
+import org.netbeans.spi.project.ProjectServiceProvider;
+import static org.openide.util.ImageUtilities.loadImageIcon;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+@ProjectServiceProvider(
+ service = SpecialIcon.class,
+ projectType = MAVEN_WAR_PROJECT_TYPE
+)
+public class MicroIcon extends WarIcon {
+
+ private Project project;
+
+ public void setProject(Project project) {
+ this.project = project;
+ }
+
+ @Override
+ public Icon getIcon() {
+ MicroApplication microApplication = MicroApplication.getInstance(project);
+ String icon = PROJECT_ICON;
+ if (microApplication == null) {
+ return super.getIcon();
+ } else if (microApplication.isLoading()) {
+ icon = RELOAD_ICON;
+ } else if (microApplication.isBuilding() && microApplication.getBuildActionType() != null) {
+ icon = microApplication.getBuildActionType().getIcon();
+ } else if (microApplication.isRunning()) {
+ if (microApplication.getRunningInstanceCount() > 1) {
+ icon = RESTART_ICON;
+ } else if (microApplication.getRunActionType() != null) {
+ icon = microApplication.getRunActionType().getIcon();
+ }
+ }
+ return loadImageIcon(icon, true);
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroProjectHook.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroProjectHook.java
new file mode 100644
index 0000000..8e22f3c
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroProjectHook.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.MAVEN_WAR_PROJECT_TYPE;
+import org.netbeans.api.project.Project;
+import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
+import org.netbeans.modules.maven.spi.nodes.SpecialIcon;
+import org.netbeans.spi.project.ProjectServiceProvider;
+import org.netbeans.spi.project.ui.ProjectOpenedHook;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+@ProjectServiceProvider(
+ service = ProjectOpenedHook.class,
+ projectType = MAVEN_WAR_PROJECT_TYPE
+)
+public class MicroProjectHook extends ProjectOpenedHook {
+
+ private final Project project;
+
+ public MicroProjectHook(Project project) {
+ this.project = project;
+ }
+
+ @Override
+ public void projectOpened() {
+ if (MicroApplication.getInstance(project) != null) {
+ addDeployOnSaveManager(project);
+ updateMicroIcon();
+ }
+ }
+
+ @Override
+ public void projectClosed() {
+ if (MicroApplication.getInstance(project) != null) {
+ removeDeployOnSaveManager(project);
+ }
+ }
+
+ private void updateMicroIcon() {
+ SpecialIcon specialIcon = project.getLookup().lookup(SpecialIcon.class);
+ MicroIcon microIcon;
+ if (specialIcon instanceof MicroIcon) {
+ microIcon = (MicroIcon) specialIcon;
+ } else {
+ return;
+ }
+ microIcon.setProject(project);
+ }
+
+ private void addDeployOnSaveManager(Project project) {
+ J2eeModuleProvider moduleProvider = project.getLookup().lookup(J2eeModuleProvider.class);
+ if (moduleProvider != null) {
+ DeployOnSaveManager.getDefault().startListening(project, moduleProvider);
+ }
+ }
+
+ private void removeDeployOnSaveManager(Project project) {
+ J2eeModuleProvider moduleProvider = project.getLookup().lookup(J2eeModuleProvider.class);
+ if (moduleProvider != null) {
+ DeployOnSaveManager.getDefault().stopListening(project, moduleProvider);
+ }
+ }
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroPropertiesPanel.form b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroPropertiesPanel.form
new file mode 100644
index 0000000..d11522e
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroPropertiesPanel.form
@@ -0,0 +1,76 @@
+<?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.
+
+-->
+<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="microVersionLabel" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="microVersionCombobox" pref="272" max="32767" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="microVersionCombobox" min="-2" max="-2" attributes="0"/>
+ <Component id="microVersionLabel" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace pref="117" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="microVersionLabel">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/fish/payara/micro/project/Bundle.properties" key="MicroPropertiesPanel.microVersionLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JComboBox" name="microVersionCombobox">
+ <Properties>
+ <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection code="new DefaultComboBoxModel(getMicroVersion())" type="code"/>
+ </Property>
+ </Properties>
+ </Component>
+ </SubComponents>
+</Form>
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroPropertiesPanel.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroPropertiesPanel.java
new file mode 100644
index 0000000..61df9a3
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroPropertiesPanel.java
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import java.util.prefs.Preferences;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JPanel;
+import org.netbeans.api.project.Project;
+import static org.netbeans.api.project.ProjectUtils.getPreferences;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.VERSION;
+import org.netbeans.modules.maven.api.customizer.ModelHandle2;
+import org.netbeans.modules.maven.api.customizer.support.ComboBoxUpdater;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+public class MicroPropertiesPanel extends JPanel {
+
+ private static final MicroVersion DEFAULT_VERSION = new MicroVersion("", "", "defined in pom.xml");
+
+ private final Preferences pref;
+
+ private final ComboBoxUpdater<MicroVersion> microVersionComboBoxUpdater;
+
+ private MicroVersion selectedMicroVersion;
+
+ public MicroPropertiesPanel(ModelHandle2 handle, Project project) {
+ pref = getPreferences(project, MicroApplication.class, true);
+ initComponents();
+ String microVersionText = pref.get(VERSION, "");
+ Optional<MicroVersion> microVersionOptional = VersionRepository.toMicroVersion(microVersionText);
+ microVersionComboBoxUpdater = new ComboBoxUpdater<MicroVersion>(microVersionCombobox, microVersionLabel) {
+ @Override
+ public MicroVersion getValue() {
+ return microVersionOptional.orElse(DEFAULT_VERSION);
+ }
+
+ @Override
+ public MicroVersion getDefaultValue() {
+ return DEFAULT_VERSION;
+ }
+
+ @Override
+ public void setValue(MicroVersion microVersion) {
+ selectedMicroVersion = microVersion;
+ }
+ };
+ }
+
+ private MicroVersion[] getMicroVersion() {
+ List<MicroVersion> microVersions = new ArrayList<>();
+ microVersions.add(DEFAULT_VERSION);
+ microVersions.addAll(VersionRepository.getInstance().getMicroVersion());
+ return microVersions.toArray(new MicroVersion[]{});
+ }
+
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ microVersionLabel = new javax.swing.JLabel();
+ microVersionCombobox = new javax.swing.JComboBox();
+
+ org.openide.awt.Mnemonics.setLocalizedText(microVersionLabel, org.openide.util.NbBundle.getMessage(MicroPropertiesPanel.class, "MicroPropertiesPanel.microVersionLabel.text")); // NOI18N
+
+ microVersionCombobox.setModel(new DefaultComboBoxModel(getMicroVersion()));
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(microVersionLabel)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(microVersionCombobox, 0, 272, Short.MAX_VALUE)
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(microVersionCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(microVersionLabel))
+ .addContainerGap(117, Short.MAX_VALUE))
+ );
+ }// </editor-fold>//GEN-END:initComponents
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JComboBox microVersionCombobox;
+ private javax.swing.JLabel microVersionLabel;
+ // End of variables declaration//GEN-END:variables
+
+ public void applyChanges() {
+ pref.put(VERSION, selectedMicroVersion.getVersion());
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroPropertiesPanelProvider.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroPropertiesPanelProvider.java
new file mode 100644
index 0000000..fb3c1e2
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroPropertiesPanelProvider.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+import javax.swing.JComponent;
+import org.netbeans.api.project.Project;
+import org.netbeans.modules.maven.api.customizer.ModelHandle2;
+import org.netbeans.spi.project.ui.support.ProjectCustomizer;
+import org.openide.util.Lookup;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+public class MicroPropertiesPanelProvider implements ProjectCustomizer.CompositeCategoryProvider {
+
+ @ProjectCustomizer.CompositeCategoryProvider.Registration(
+ projectType = "org-netbeans-modules-maven",
+ position = 305
+ )
+ public static MicroPropertiesPanelProvider createRun() {
+ return new MicroPropertiesPanelProvider();
+ }
+
+ @Override
+ public ProjectCustomizer.Category createCategory(Lookup context) {
+ Project project = context.lookup(Project.class);
+ if (MicroApplication.getInstance(project) == null) {
+ return null;
+ }
+ return ProjectCustomizer.Category.create("PayaraMicro", "Payara Micro", null); // NOI18N
+ }
+
+ @Override
+ public JComponent createComponent(ProjectCustomizer.Category category, Lookup context) {
+ ModelHandle2 handle = context.lookup(ModelHandle2.class);
+ final Project project = context.lookup(Project.class);
+ if (MicroApplication.getInstance(project) == null) {
+ return null;
+ }
+
+ MicroPropertiesPanel microPanel = new MicroPropertiesPanel(handle, project);
+ category.setOkButtonListener(event -> microPanel.applyChanges());
+ category.setStoreListener(event -> microPanel.applyChanges());
+ return microPanel;
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroVersion.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroVersion.java
new file mode 100644
index 0000000..862200d
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroVersion.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+public class MicroVersion {
+
+ private final String version;
+
+ private final String javaeeVersion;
+
+ private final String displayName;
+
+ public MicroVersion(String version, String javaeeVersion) {
+ this.version = version;
+ this.javaeeVersion = javaeeVersion;
+ this.displayName = version;
+ }
+
+ public MicroVersion(String version, String javaeeVersion, String displayName) {
+ this.version = version;
+ this.javaeeVersion = javaeeVersion;
+ this.displayName = displayName;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public String getJavaeeVersion() {
+ return javaeeVersion;
+ }
+
+ @Override
+ public String toString() {
+ return displayName;
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ReloadAction.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ReloadAction.java
new file mode 100644
index 0000000..8155b7c
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ReloadAction.java
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+import java.awt.event.ActionEvent;
+import java.io.File;
+import java.io.IOException;
+import javax.swing.AbstractAction;
+import org.apache.maven.project.MavenProject;
+import org.netbeans.api.project.Project;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.COMPILE_EXPLODE_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.EXPLODE_ACTION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.RELOAD_FILE;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.RELOAD_ICON;
+import org.netbeans.modules.fish.payara.micro.project.MicroApplication;
+import org.netbeans.modules.maven.api.NbMavenProject;
+import org.netbeans.modules.maven.api.execute.RunUtils;
+import static org.netbeans.modules.maven.api.execute.RunUtils.isCompileOnSaveEnabled;
+import org.netbeans.modules.maven.execute.ActionToGoalUtils;
+import org.netbeans.modules.maven.execute.ModelRunConfig;
+import org.netbeans.modules.maven.execute.model.NetbeansActionMapping;
+import org.openide.awt.ActionID;
+import org.openide.awt.ActionReference;
+import org.openide.awt.ActionReferences;
+import org.openide.awt.ActionRegistration;
+import org.openide.awt.StatusDisplayer;
+import org.openide.util.Exceptions;
+import org.openide.util.Lookup;
+import org.openide.util.NbBundle.Messages;
+import static org.openide.util.NbBundle.getMessage;
+import org.openide.util.RequestProcessor;
+import org.openide.util.Utilities;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+@ActionID(
+ id = ReloadAction.ID,
+ category = ReloadAction.CATEGORY
+)
+@ActionRegistration(
+ displayName = "#CTL_ReloadAppAction",
+ iconBase = RELOAD_ICON,
+ lazy = true
+)
+@ActionReferences({
+ @ActionReference(path = "Menu/BuildProject", position = 55)
+ ,
+ @ActionReference(path = "Toolbars/Build", position = 325)
+ ,
+ @ActionReference(path = "Projects/org-netbeans-modules-maven/Actions", position = 1000)
+ ,
+ @ActionReference(path = "Shortcuts", name = "DS-A")
+})
+@Messages("CTL_ReloadAppAction=Reload")
+public class ReloadAction extends AbstractAction {
+
+ static final String CATEGORY = "Build";
+
+ static final String ID = "org.netbeans.modules.payara.micro.action.reload";
+
+ private static final RequestProcessor RP = new RequestProcessor(ReloadAction.class.getName());
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ Lookup context = Utilities.actionsGlobalContext();
+ Project project = context.lookup(Project.class);
+ if(project == null) {
+ return;
+ }
+ NbMavenProject nbMavenProject = project.getLookup().lookup(NbMavenProject.class);
+ MavenProject mavenProject = nbMavenProject.getMavenProject();
+
+ MicroApplication microApplication = MicroApplication.getInstance(project);
+ if (microApplication == null) {
+ StatusDisplayer.getDefault()
+ .setStatusText(getMessage(ReloadAction.class, "ERR_Payara_Micro_Plugin_Not_Found", mavenProject.getArtifactId()));
+ } else if (!isCompileOnSaveEnabled(microApplication.getProject())) {
+ StatusDisplayer.getDefault()
+ .setStatusText(getMessage(ReloadAction.class, "ERR_Compile_On_Save_Not_Enabled", mavenProject.getArtifactId()));
+ } else {
+ RP.post(() -> {
+ String action = RunUtils.isCompileOnSaveEnabled(project) ? EXPLODE_ACTION : COMPILE_EXPLODE_ACTION;
+ NetbeansActionMapping mapping = ActionToGoalUtils.getDefaultMapping(action, project);
+ ModelRunConfig rc = new ModelRunConfig(project, mapping, mapping.getActionName(), null, Lookup.EMPTY, false);
+ rc.setTaskDisplayName(getMessage(ReloadAction.class, "TXT_Reload", mavenProject.getArtifactId()));
+ rc.getGoals().addAll(MicroActionsProvider.getGoals(action));
+ RunUtils.run(rc);
+ });
+ }
+ }
+
+ public static void reloadApplication(String buildPath) {
+ File check = new File(buildPath, RELOAD_FILE);
+ if (check.exists()) {
+ check.setLastModified(System.currentTimeMillis());
+ } else {
+ try {
+ check.createNewFile();
+ } catch (IOException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ }
+ }
+
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/VersionRepository.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/VersionRepository.java
new file mode 100644
index 0000000..eee3e13
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/VersionRepository.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project;
+
+import java.util.ArrayList;
+import static java.util.Collections.unmodifiableList;
+import java.util.List;
+import java.util.Optional;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+public class VersionRepository {
+
+ private static VersionRepository versionRepository;
+ private static final List<MicroVersion> MICRO_VERSIONS = new ArrayList<>();
+
+ private VersionRepository() {
+ MICRO_VERSIONS.add(new MicroVersion("5.192", "8.0"));
+ MICRO_VERSIONS.add(new MicroVersion("5.191", "8.0"));
+ MICRO_VERSIONS.add(new MicroVersion("5.184", "8.0"));
+ MICRO_VERSIONS.add(new MicroVersion("5.183", "8.0"));
+ MICRO_VERSIONS.add(new MicroVersion("5.182", "8.0"));
+ MICRO_VERSIONS.add(new MicroVersion("5.181", "8.0"));
+ MICRO_VERSIONS.add(new MicroVersion("4.1.2.181", "7.0"));
+ MICRO_VERSIONS.add(new MicroVersion("4.1.2.174", "7.0"));
+ }
+
+ public static VersionRepository getInstance() {
+ if (versionRepository == null) {
+ versionRepository = new VersionRepository();
+ }
+ return versionRepository;
+ }
+
+ public List<MicroVersion> getMicroVersion() {
+ return unmodifiableList(MICRO_VERSIONS);
+ }
+
+ public static Optional<MicroVersion> toMicroVersion(String microVersion) {
+ return MICRO_VERSIONS
+ .stream()
+ .filter(micro -> micro.getVersion().equals(microVersion))
+ .findAny();
+ }
+
+ public String getJavaEEVersion(String microVersion) {
+ return MICRO_VERSIONS.stream()
+ .filter(micro -> micro.getVersion().equals(microVersion))
+ .map(MicroVersion::getJavaeeVersion)
+ .findAny().get();
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/PayaraMicroProjectDescription.html b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/PayaraMicroProjectDescription.html
new file mode 100644
index 0000000..caaa492
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/PayaraMicroProjectDescription.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!--
+
+ 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.
+
+-->
+<html>
+ <body>
+ <div>
+ Maven Payara Micro Application project template, created with Maven Archetype Plugin.<br/>
+ Payara Micro is designed for running Java EE applications in a modern virtualized infrastructure and perfect for microservice and cloud environments..
+ </div>
+ </body>
+</html>
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/action-mapping.xml b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/action-mapping.xml
new file mode 100644
index 0000000..b84d926
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/action-mapping.xml
@@ -0,0 +1,100 @@
+<?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.
+
+-->
+<actions>
+ <action>
+ <actionName>run</actionName>
+ <packagings>
+ <packaging>war</packaging>
+ </packagings>
+ </action>
+ <action>
+ <actionName>run.single.deploy</actionName>
+ <packagings>
+ <packaging>war</packaging>
+ </packagings>
+ <properties>
+ <netbeans.deploy.clientUrlPart>${webpagePath}</netbeans.deploy.clientUrlPart>
+ </properties>
+ </action>
+ <action>
+ <actionName>debug</actionName>
+ <packagings>
+ <packaging>war</packaging>
+ </packagings>
+ <properties>
+ <exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address}</exec.args>
+ <jpda.listen>true</jpda.listen>
+ <netbeans.deploy.debugmode>true</netbeans.deploy.debugmode>
+ </properties>
+ </action>
+ <action>
+ <actionName>debug.single.deploy</actionName>
+ <packagings>
+ <packaging>war</packaging>
+ </packagings>
+ <properties>
+ <exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address}</exec.args>
+ <jpda.listen>true</jpda.listen>
+ <netbeans.deploy.debugmode>true</netbeans.deploy.debugmode>
+ <netbeans.deploy.clientUrlPart>${webpagePath}</netbeans.deploy.clientUrlPart>
+ </properties>
+ </action>
+ <action>
+ <actionName>profile</actionName>
+ <packagings>
+ <packaging>war</packaging>
+ </packagings>
+ <properties>
+ <exec.args></exec.args>
+ <exec.executable>java</exec.executable>
+ <netbeans.deploy.profilemode>true</netbeans.deploy.profilemode>
+ </properties>
+ </action>
+ <action>
+ <actionName>profile.single.deploy</actionName>
+ <packagings>
+ <packaging>war</packaging>
+ </packagings>
+ <properties>
+ <exec.args></exec.args>
+ <exec.executable>java</exec.executable>
+ <netbeans.deploy.profilemode>true</netbeans.deploy.profilemode>
+ <netbeans.deploy.clientUrlPart>${webpagePath}</netbeans.deploy.clientUrlPart>
+ </properties>
+ </action>
+
+ <action>
+ <actionName>micro-complie-explode</actionName>
+ <packagings>
+ <packaging>war</packaging>
+ </packagings>
+ </action>
+ <action>
+ <actionName>micro-explode</actionName>
+ <packagings>
+ <packaging>war</packaging>
+ </packagings>
+ </action>
+ <action>
+ <actionName>micro-stop</actionName>
+ </action>
+</actions>
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-build.png b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-build.png
new file mode 100644
index 0000000..b42e45e
Binary files /dev/null and b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-build.png differ
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-clean-build.png b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-clean-build.png
new file mode 100644
index 0000000..c541df5
Binary files /dev/null and b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-clean-build.png differ
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-clean.png b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-clean.png
new file mode 100644
index 0000000..6d9f100
Binary files /dev/null and b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-clean.png differ
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-debug.png b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-debug.png
new file mode 100644
index 0000000..eff2818
Binary files /dev/null and b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-debug.png differ
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-profile.png b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-profile.png
new file mode 100644
index 0000000..4387ea9
Binary files /dev/null and b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-profile.png differ
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-reload.png b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-reload.png
new file mode 100644
index 0000000..44174e4
Binary files /dev/null and b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-reload.png differ
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-restart.png b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-restart.png
new file mode 100644
index 0000000..361b3f8
Binary files /dev/null and b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-restart.png differ
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-start.png b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-start.png
new file mode 100644
index 0000000..a449bee
Binary files /dev/null and b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro-start.png differ
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro.png b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro.png
new file mode 100644
index 0000000..c693da6
Binary files /dev/null and b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/resources/payara-micro.png differ
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/BaseWizardIterator.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/BaseWizardIterator.java
new file mode 100644
index 0000000..1c46176
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/BaseWizardIterator.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project.ui;
+
+import java.awt.Component;
+import java.util.NoSuchElementException;
+import javax.swing.JComponent;
+import javax.swing.event.ChangeListener;
+import org.netbeans.api.validation.adapters.WizardDescriptorAdapter;
+import org.netbeans.validation.api.ui.ValidationGroup;
+import org.openide.WizardDescriptor;
+import static org.openide.util.NbBundle.getMessage;
+
+/**
+ * Base abstract class for all types of Maven enterprise projects.
+ * Encapsulates some Wizard related stuffs and few methods common for every project type
+ *
+ * @author Martin Janicek
+ */
+public abstract class BaseWizardIterator implements WizardDescriptor.BackgroundInstantiatingIterator {
+
+ protected WizardDescriptor descriptor;
+ private int index;
+ private WizardDescriptor.Panel[] panels;
+
+ protected abstract WizardDescriptor.Panel[] createPanels(ValidationGroup validationGroup);
+
+ @Override
+ public void initialize(WizardDescriptor descriptor) {
+ this.descriptor = descriptor;
+ this.index = 0;
+ panels = createPanels(ValidationGroup.create(new WizardDescriptorAdapter(descriptor)));
+ updateSteps();
+ }
+
+ @Override
+ public void uninitialize(WizardDescriptor wiz) {
+ this.descriptor.putProperty("projdir", null); //NOI18N
+ this.descriptor.putProperty("name", null); //NOI18N
+ this.descriptor = null;
+ panels = null;
+ }
+
+ @Override
+ public String name() {
+ return getMessage(BaseWizardIterator.class, "LBL_NameFormat", index + 1, panels.length);
+ }
+
+ @Override
+ public boolean hasNext() {
+ return index < panels.length - 1;
+ }
+
+ @Override
+ public boolean hasPrevious() {
+ return index > 0;
+ }
+
+ @Override
+ public void nextPanel() {
+ if (!hasNext()) {
+ throw new NoSuchElementException();
+ }
+ index++;
+ }
+
+ @Override
+ public void previousPanel() {
+ if (!hasPrevious()) {
+ throw new NoSuchElementException();
+ }
+ index--;
+ }
+
+ @Override
+ public WizardDescriptor.Panel current() {
+ return panels[index];
+ }
+
+ @Override
+ public final void addChangeListener(ChangeListener l) {
+ }
+
+ @Override
+ public final void removeChangeListener(ChangeListener l) {
+ }
+
+ private void updateSteps() {
+ // Make sure list of steps is accurate.
+ String[] steps = new String[panels.length];
+ String[] basicOnes = new String[]{
+ getMessage(BaseWizardIterator.class, "LBL_MavenProjectSettings"),
+ getMessage(BaseWizardIterator.class, "LBL_PayaraMicroSettings")
+ };
+ System.arraycopy(basicOnes, 0, steps, 0, basicOnes.length);
+ for (int i = 0; i < panels.length; i++) {
+ Component c = panels[i].getComponent();
+ if (i >= basicOnes.length || steps[i] == null) {
+ // Default step name to component name of panel.
+ // Mainly useful for getting the name of the target
+ // chooser to appear in the list of steps.
+ steps[i] = c.getName();
+ }
+ if (c instanceof JComponent) {
+ // assume Swing components
+ JComponent jc = (JComponent) c;
+ // Step #.
+ jc.putClientProperty("WizardPanel_contentSelectedIndex", i); //NOI18N
+ // Step name (actually the whole list for reference).
+ jc.putClientProperty("WizardPanel_contentData", steps); //NOI18N
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/Bundle.properties b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/Bundle.properties
new file mode 100644
index 0000000..a10edd3
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/Bundle.properties
@@ -0,0 +1,26 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+PayaraMicroPanel.microVersionLabel.text=Payara Micro Version:
+PayaraMicroPanel.autoBindHttpCheckBox.text=
+PayaraMicroPanel.autoBindHttpLabel.text=Auto Bind Http:
+TLTP_AUTO_BIND_HTTP=Enables auto-bind functionality for the HTTP port
+LBL_MavenProjectSettings=Name and Location
+LBL_PayaraMicroSettings=Payara Micro
+TTL_NewProjectWizard=Payara Micro Application
+LBL_NameFormat={0} of {1}
\ No newline at end of file
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/MicroProjectWizardIterator.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/MicroProjectWizardIterator.java
new file mode 100644
index 0000000..d3f96f9
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/MicroProjectWizardIterator.java
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project.ui;
+
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.ARCHETYPE_ARTIFACT_ID;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.ARCHETYPE_GROUP_ID;
+import org.netbeans.modules.fish.payara.micro.project.VersionRepository;
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ProjectManager;
+import org.netbeans.api.templates.TemplateRegistration;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROJECT_ICON;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROJECT_TYPE;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROP_ARTIFACT_ID;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROP_AUTO_BIND_HTTP;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROP_GROUP_ID;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROP_JAVA_EE_VERSION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROP_PACKAGE;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROP_PAYARA_MICRO_VERSION;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROP_VERSION;
+import static org.netbeans.modules.fish.payara.micro.plugin.MicroPluginWizardDescriptor.updateMicroMavenPlugin;
+import org.netbeans.modules.maven.api.archetype.Archetype;
+import org.netbeans.modules.maven.api.archetype.ArchetypeWizards;
+import org.netbeans.modules.maven.api.archetype.ProjectInfo;
+import org.netbeans.modules.maven.j2ee.utils.MavenProjectSupport;
+import org.netbeans.validation.api.ui.ValidationGroup;
+import org.openide.WizardDescriptor;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.util.NbBundle.Messages;
+import static org.openide.util.NbBundle.getMessage;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+@TemplateRegistration(
+ folder = ArchetypeWizards.TEMPLATE_FOLDER,
+ position = 200,
+ displayName = "#TTL_NewProjectWizard",
+ iconBase = PROJECT_ICON,
+ description = "../resources/PayaraMicroProjectDescription.html"
+)
+public final class MicroProjectWizardIterator extends BaseWizardIterator {
+
+ @Override
+ public Set<FileObject> instantiate() throws IOException {
+ ProjectInfo projectInfo = new ProjectInfo(
+ (String) descriptor.getProperty(PROP_GROUP_ID),
+ (String) descriptor.getProperty(PROP_ARTIFACT_ID),
+ (String) descriptor.getProperty(PROP_VERSION),
+ (String) descriptor.getProperty(PROP_PACKAGE)
+ );
+ String payaraMicroVersion = (String) descriptor.getProperty(PROP_PAYARA_MICRO_VERSION);
+ String autoBindHttp = (String) descriptor.getProperty(PROP_AUTO_BIND_HTTP);
+ Archetype archetype = createMojoArchetype();
+
+ Map<String, String> properties = new HashMap<>();
+ properties.put(PROP_PAYARA_MICRO_VERSION, payaraMicroVersion);
+ properties.put(PROP_JAVA_EE_VERSION, VersionRepository.getInstance().getJavaEEVersion(payaraMicroVersion));
+ properties.put(PROP_AUTO_BIND_HTTP, autoBindHttp);
+
+ ArchetypeWizards.logUsage(archetype.getGroupId(), archetype.getArtifactId(), archetype.getVersion());
+
+ File rootFile = FileUtil.normalizeFile((File) descriptor.getProperty("projdir")); // NOI18N
+ ArchetypeWizards.createFromArchetype(rootFile, projectInfo, archetype, properties, true);
+
+ Set<FileObject> projects = ArchetypeWizards.openProjects(rootFile, rootFile);
+ for (FileObject projectFile : projects) {
+ Project project = ProjectManager.getDefault().findProject(projectFile);
+ if (project == null) {
+ continue;
+ }
+ MavenProjectSupport.changeServer(project, true);
+ updateMicroMavenPlugin(project, payaraMicroVersion, autoBindHttp);
+ }
+
+ return projects;
+ }
+
+ private Archetype createMojoArchetype() {
+ Archetype archetype = new Archetype();
+ archetype.setGroupId(ARCHETYPE_GROUP_ID);
+ archetype.setArtifactId(ARCHETYPE_ARTIFACT_ID);
+ // latest version of archetype automatically fetched from remote catalog
+ return archetype;
+ }
+
+ @Override
+ public void initialize(WizardDescriptor wiz) {
+ super.initialize(wiz);
+ wiz.putProperty("NewProjectWizard_Title", getMessage(MicroProjectWizardIterator.class, "TTL_NewProjectWizard"));
+ }
+
+ @Override
+ protected WizardDescriptor.Panel[] createPanels(ValidationGroup vg) {
+ return new WizardDescriptor.Panel[]{
+ ArchetypeWizards.basicWizardPanel(vg, false, null),
+ new PayaraMicroDescriptor(PROJECT_TYPE)
+ };
+ }
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/PayaraMicroDescriptor.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/PayaraMicroDescriptor.java
new file mode 100644
index 0000000..3864be6
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/PayaraMicroDescriptor.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project.ui;
+
+import java.awt.Component;
+import javax.swing.event.ChangeListener;
+import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule.Type;
+import org.openide.WizardDescriptor;
+import org.openide.util.HelpCtx;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+public class PayaraMicroDescriptor implements WizardDescriptor.FinishablePanel<WizardDescriptor> {
+
+ private final PayaraMicroPanel panel;
+
+ public PayaraMicroDescriptor(Type projectType) {
+ panel = new PayaraMicroPanel(projectType);
+ }
+
+ @Override
+ public Component getComponent() {
+ return panel;
+ }
+
+ @Override
+ public void readSettings(WizardDescriptor wizardDescriptor) {
+ panel.readSettings(wizardDescriptor);
+ }
+
+ @Override
+ public void storeSettings(WizardDescriptor wizardDescriptor) {
+ panel.storeSettings(wizardDescriptor);
+ }
+
+ @Override
+ public boolean isFinishPanel() {
+ return true;
+ }
+
+ @Override
+ public boolean isValid() {
+ return true;
+ }
+
+ @Override
+ public HelpCtx getHelp() {
+ return HelpCtx.DEFAULT_HELP;
+ }
+
+ @Override
+ public void addChangeListener(ChangeListener l) {
+ }
+
+ @Override
+ public void removeChangeListener(ChangeListener l) {
+ }
+
+}
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/PayaraMicroPanel.form b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/PayaraMicroPanel.form
new file mode 100644
index 0000000..1138649
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/PayaraMicroPanel.form
@@ -0,0 +1,110 @@
+<?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.
+
+-->
+<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="microVersionLabel" alignment="0" min="-2" max="-2" attributes="0"/>
+ <Component id="autoBindHttpLabel" alignment="0" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <Component id="autoBindHttpCheckBox" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="32767" attributes="0"/>
+ </Group>
+ <Group type="102" attributes="0">
+ <Component id="microVersionCombobox" max="32767" attributes="0"/>
+ <EmptySpace min="-2" pref="69" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="microVersionLabel" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="microVersionCombobox" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="autoBindHttpCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
+ <Component id="autoBindHttpLabel" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace pref="255" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JComboBox" name="microVersionCombobox">
+ <Properties>
+ <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection code="new DefaultComboBoxModel(VersionRepository.getInstance().getMicroVersion().toArray())" type="code"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="microVersionLabel">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/fish/payara/micro/project/ui/Bundle.properties" key="PayaraMicroPanel.microVersionLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="autoBindHttpLabel">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/fish/payara/micro/project/ui/Bundle.properties" key="PayaraMicroPanel.autoBindHttpLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/fish/payara/micro/project/ui/Bundle.properties" key="TLTP_AUTO_BIND_HTTP" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JCheckBox" name="autoBindHttpCheckBox">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/fish/payara/micro/project/ui/Bundle.properties" key="PayaraMicroPanel.autoBindHttpCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/fish/payara/micro/project/ui/Bundle.properties" key="TLTP_AUTO_BIND_HTTP" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ </SubComponents>
+</Form>
diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/PayaraMicroPanel.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/PayaraMicroPanel.java
new file mode 100644
index 0000000..97049f1
--- /dev/null
+++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/PayaraMicroPanel.java
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.fish.payara.micro.project.ui;
+
+import org.netbeans.modules.fish.payara.micro.project.VersionRepository;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JPanel;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROP_AUTO_BIND_HTTP;
+import static org.netbeans.modules.fish.payara.micro.plugin.Constants.PROP_PAYARA_MICRO_VERSION;
+import org.netbeans.modules.fish.payara.micro.project.MicroVersion;
+import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
+import org.openide.WizardDescriptor;
+import static org.openide.util.NbBundle.getMessage;
+
+/**
+ *
+ * @author Gaurav Gupta <ga...@payara.fish>
+ */
+class PayaraMicroPanel extends JPanel {
+
+ PayaraMicroPanel(J2eeModule.Type projectType) {
+ initComponents();
+ getAccessibleContext().setAccessibleDescription(getName());
+ }
+
+ @Override
+ public String getName() {
+ return getMessage(PayaraMicroPanel.class, "LBL_MavenProjectSettings");
+ }
+
+ void readSettings(WizardDescriptor descriptor) {
+ String microVersionText = (String) descriptor.getProperty(PROP_PAYARA_MICRO_VERSION);
+ if (microVersionText != null) {
+ VersionRepository.toMicroVersion(microVersionText)
+ .ifPresent(microVersion -> microVersionCombobox.setSelectedItem(microVersion));
+ }
+
+ String autoBindHTTP = (String)descriptor.getProperty(PROP_AUTO_BIND_HTTP);
+ if(autoBindHTTP == null){
+ autoBindHTTP = Boolean.TRUE.toString();
+ }
+ autoBindHttpCheckBox.setSelected(Boolean.valueOf(autoBindHTTP));
+ }
+
+ void storeSettings(WizardDescriptor descriptor) {
+ descriptor.putProperty(PROP_PAYARA_MICRO_VERSION, ((MicroVersion)microVersionCombobox.getSelectedItem()).getVersion());
+ descriptor.putProperty(PROP_AUTO_BIND_HTTP, String.valueOf(autoBindHttpCheckBox.isSelected()));
+ }
+
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ microVersionCombobox = new javax.swing.JComboBox();
+ microVersionLabel = new javax.swing.JLabel();
+ autoBindHttpLabel = new javax.swing.JLabel();
+ autoBindHttpCheckBox = new javax.swing.JCheckBox();
+
+ microVersionCombobox.setModel(new DefaultComboBoxModel(VersionRepository.getInstance().getMicroVersion().toArray()));
+
+ org.openide.awt.Mnemonics.setLocalizedText(microVersionLabel, org.openide.util.NbBundle.getMessage(PayaraMicroPanel.class, "PayaraMicroPanel.microVersionLabel.text")); // NOI18N
+
+ org.openide.awt.Mnemonics.setLocalizedText(autoBindHttpLabel, org.openide.util.NbBundle.getMessage(PayaraMicroPanel.class, "PayaraMicroPanel.autoBindHttpLabel.text")); // NOI18N
+ autoBindHttpLabel.setToolTipText(org.openide.util.NbBundle.getMessage(PayaraMicroPanel.class, "TLTP_AUTO_BIND_HTTP")); // NOI18N
+
+ org.openide.awt.Mnemonics.setLocalizedText(autoBindHttpCheckBox, org.openide.util.NbBundle.getMessage(PayaraMicroPanel.class, "PayaraMicroPanel.autoBindHttpCheckBox.text")); // NOI18N
+ autoBindHttpCheckBox.setToolTipText(org.openide.util.NbBundle.getMessage(PayaraMicroPanel.class, "TLTP_AUTO_BIND_HTTP")); // NOI18N
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(microVersionLabel)
+ .addComponent(autoBindHttpLabel))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(autoBindHttpCheckBox)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(microVersionCombobox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGap(69, 69, 69))))
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(microVersionLabel)
+ .addComponent(microVersionCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(autoBindHttpCheckBox)
+ .addComponent(autoBindHttpLabel))
+ .addContainerGap(255, Short.MAX_VALUE))
+ );
+ }// </editor-fold>//GEN-END:initComponents
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JCheckBox autoBindHttpCheckBox;
+ private javax.swing.JLabel autoBindHttpLabel;
+ private javax.swing.JComboBox microVersionCombobox;
+ private javax.swing.JLabel microVersionLabel;
+ // End of variables declaration//GEN-END:variables
+
+}
diff --git a/ide/swing.validation/nbproject/project.xml b/ide/swing.validation/nbproject/project.xml
index 9014d91..5ee5b02 100644
--- a/ide/swing.validation/nbproject/project.xml
+++ b/ide/swing.validation/nbproject/project.xml
@@ -67,6 +67,7 @@
<friend>org.netbeans.modules.maven.apisupport</friend>
<friend>org.netbeans.modules.maven.j2ee</friend>
<friend>org.netbeans.modules.nodejs</friend>
+ <friend>org.netbeans.modules.payara.micro</friend>
<package>org.netbeans.api.validation.adapters</package>
<package>org.netbeans.validation.api</package>
<package>org.netbeans.validation.api.builtin.indexvalidation</package>
diff --git a/java/maven.embedder/nbproject/project.xml b/java/maven.embedder/nbproject/project.xml
index 9838dbe..5fa877f 100644
--- a/java/maven.embedder/nbproject/project.xml
+++ b/java/maven.embedder/nbproject/project.xml
@@ -169,6 +169,7 @@
<friend>org.netbeans.modules.android.maven</friend>
<!-- danis@netbeans.org -->
<friend>org.vaadin.netbeans.maven</friend>
+ <friend>org.netbeans.modules.payara.micro</friend>
<!-- NetBeans support for Google App Engine -->
<friend>org.netbeans.modules.j2ee.appengine</friend>
<friend>org.netbeans.modules.maven.util</friend>
diff --git a/java/maven.model/nbproject/project.xml b/java/maven.model/nbproject/project.xml
index f350bb3..4f5d1e0 100644
--- a/java/maven.model/nbproject/project.xml
+++ b/java/maven.model/nbproject/project.xml
@@ -231,6 +231,7 @@
<friend>org.netbeans.modules.testng.maven</friend>
<!-- danis@netbeans.org -->
<friend>org.vaadin.netbeans.maven</friend>
+ <friend>org.netbeans.modules.payara.micro</friend>
<!-- NetBeans support for Google App Engine -->
<friend>org.netbeans.modules.j2ee.appengine</friend>
<friend>org.netbeans.modules.maven.util</friend>
diff --git a/java/maven/nbproject/project.xml b/java/maven/nbproject/project.xml
index 8dfbd33..301791c 100644
--- a/java/maven/nbproject/project.xml
+++ b/java/maven/nbproject/project.xml
@@ -622,6 +622,7 @@
<friend>org.netbeans.modules.scala.maven</friend>
<!-- danis@netbeans.org -->
<friend>org.vaadin.netbeans.maven</friend>
+ <friend>org.netbeans.modules.payara.micro</friend>
<!-- NetBeans support for Google App Engine -->
<friend>org.netbeans.modules.j2ee.appengine</friend>
<friend>org.netbeans.modules.maven.util</friend>
@@ -635,6 +636,7 @@
<package>org.netbeans.modules.maven.api.execute</package>
<package>org.netbeans.modules.maven.api.output</package>
<package>org.netbeans.modules.maven.api.problem</package>
+ <package>org.netbeans.modules.maven.execute</package>
<package>org.netbeans.modules.maven.execute.model</package>
<package>org.netbeans.modules.maven.execute.model.io.jdom</package>
<package>org.netbeans.modules.maven.execute.model.io.xpp3</package>
diff --git a/nbbuild/cluster.properties b/nbbuild/cluster.properties
index 96d499b..6f30335 100644
--- a/nbbuild/cluster.properties
+++ b/nbbuild/cluster.properties
@@ -787,6 +787,7 @@ nb.cluster.enterprise=\
libs.jstl,\
maven.j2ee,\
maven.jaxws,\
+ payara.micro,\
performance.javaee,\
performance.scripting,\
performance.web,\
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists