Skip to content

Commit 107d9e4

Browse files
committed
Add Payara Server Maven Plugin NetBeans integration module
1 parent af26b7d commit 107d9e4

34 files changed

Lines changed: 1929 additions & 8 deletions

enterprise/maven.j2ee/nbproject/project.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@
542542
<friend-packages>
543543
<friend>org.netbeans.modules.maven.jaxws</friend>
544544
<friend>org.netbeans.modules.payara.micro</friend>
545+
<friend>org.netbeans.modules.payara.server.maven</friend>
545546
<friend>org.netbeans.modules.jakarta.transformer</friend>
546547
<package>org.netbeans.modules.maven.j2ee</package>
547548
<package>org.netbeans.modules.maven.j2ee.execution</package>

enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/MicroProjectHook.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,14 @@ public void projectClosed() {
6161
}
6262
}
6363
}
64-
64+
6565
private void updateMicroIcon() {
66-
SpecialIcon specialIcon = project.getLookup().lookup(SpecialIcon.class);
67-
MicroIcon microIcon;
68-
if (specialIcon instanceof MicroIcon) {
69-
microIcon = (MicroIcon) specialIcon;
70-
} else {
71-
return;
66+
for (SpecialIcon specialIcon : project.getLookup().lookupAll(SpecialIcon.class)) {
67+
if (specialIcon instanceof MicroIcon) {
68+
((MicroIcon) specialIcon).setProject(project);
69+
return;
70+
}
7271
}
73-
microIcon.setProject(project);
7472
}
7573

7674
private void addDeployOnSaveManager(Project project) {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
-->
22+
<project basedir="." default="build" name="enterprise/payara.server.maven">
23+
<description>Builds, tests, and runs the project org.netbeans.modules.payara.server.maven</description>
24+
<import file="../../nbbuild/templates/projectized.xml"/>
25+
</project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Manifest-Version: 1.0
2+
AutoUpdate-Show-In-Client: false
3+
OpenIDE-Module: org.netbeans.modules.payara.server.maven/0
4+
OpenIDE-Module-Layer: org/netbeans/modules/payara/server/maven/layer.xml
5+
OpenIDE-Module-Specification-Version: 1.0
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
javac.source=1.8
18+
javac.compilerargs=-Xlint -Xlint:-serial
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
-->
22+
<project xmlns="http://www.netbeans.org/ns/project/1">
23+
<type>org.netbeans.modules.apisupport.project</type>
24+
<configuration>
25+
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
26+
<code-name-base>org.netbeans.modules.payara.server.maven</code-name-base>
27+
<module-dependencies>
28+
<dependency>
29+
<code-name-base>org.netbeans.api.annotations.common</code-name-base>
30+
<build-prerequisite/>
31+
<compile-dependency/>
32+
<run-dependency>
33+
<release-version>1</release-version>
34+
<specification-version>1.27.1</specification-version>
35+
</run-dependency>
36+
</dependency>
37+
<dependency>
38+
<code-name-base>org.netbeans.modules.j2eeapis</code-name-base>
39+
<build-prerequisite/>
40+
<compile-dependency/>
41+
<run-dependency>
42+
<release-version>1</release-version>
43+
<specification-version>1.35.1</specification-version>
44+
</run-dependency>
45+
</dependency>
46+
<dependency>
47+
<code-name-base>org.netbeans.modules.j2eeserver</code-name-base>
48+
<build-prerequisite/>
49+
<compile-dependency/>
50+
<run-dependency>
51+
<release-version>4</release-version>
52+
<specification-version>1.116</specification-version>
53+
</run-dependency>
54+
</dependency>
55+
<dependency>
56+
<code-name-base>org.netbeans.modules.maven</code-name-base>
57+
<build-prerequisite/>
58+
<compile-dependency/>
59+
<run-dependency>
60+
<release-version>2</release-version>
61+
<specification-version>2.133</specification-version>
62+
</run-dependency>
63+
</dependency>
64+
<dependency>
65+
<code-name-base>org.netbeans.modules.maven.embedder</code-name-base>
66+
<build-prerequisite/>
67+
<compile-dependency/>
68+
<run-dependency>
69+
<release-version>2</release-version>
70+
<specification-version>2.58</specification-version>
71+
</run-dependency>
72+
</dependency>
73+
<dependency>
74+
<code-name-base>org.netbeans.modules.maven.j2ee</code-name-base>
75+
<build-prerequisite/>
76+
<compile-dependency/>
77+
<run-dependency>
78+
<release-version>1</release-version>
79+
<specification-version>1.65</specification-version>
80+
</run-dependency>
81+
</dependency>
82+
<dependency>
83+
<code-name-base>org.netbeans.modules.payara.tooling</code-name-base>
84+
<build-prerequisite/>
85+
<compile-dependency/>
86+
<run-dependency>
87+
<release-version>0</release-version>
88+
<specification-version>2.5</specification-version>
89+
</run-dependency>
90+
</dependency>
91+
<dependency>
92+
<code-name-base>org.netbeans.modules.projectapi</code-name-base>
93+
<build-prerequisite/>
94+
<compile-dependency/>
95+
<run-dependency>
96+
<release-version>1</release-version>
97+
<specification-version>1.72</specification-version>
98+
</run-dependency>
99+
</dependency>
100+
<dependency>
101+
<code-name-base>org.netbeans.modules.projectuiapi</code-name-base>
102+
<build-prerequisite/>
103+
<compile-dependency/>
104+
<run-dependency>
105+
<release-version>1</release-version>
106+
<specification-version>1.88.1.8</specification-version>
107+
</run-dependency>
108+
</dependency>
109+
<dependency>
110+
<code-name-base>org.netbeans.modules.projectuiapi.base</code-name-base>
111+
<build-prerequisite/>
112+
<compile-dependency/>
113+
<run-dependency>
114+
<release-version>1</release-version>
115+
<specification-version>1.85.1.9</specification-version>
116+
</run-dependency>
117+
</dependency>
118+
<dependency>
119+
<code-name-base>org.openide.execution</code-name-base>
120+
<build-prerequisite/>
121+
<compile-dependency/>
122+
<run-dependency>
123+
<specification-version>9.3.1</specification-version>
124+
</run-dependency>
125+
</dependency>
126+
<dependency>
127+
<code-name-base>org.openide.filesystems</code-name-base>
128+
<build-prerequisite/>
129+
<compile-dependency/>
130+
<run-dependency>
131+
<specification-version>9.10.1</specification-version>
132+
</run-dependency>
133+
</dependency>
134+
<dependency>
135+
<code-name-base>org.openide.util</code-name-base>
136+
<build-prerequisite/>
137+
<compile-dependency/>
138+
<run-dependency>
139+
<specification-version>9.7.1</specification-version>
140+
</run-dependency>
141+
</dependency>
142+
<dependency>
143+
<code-name-base>org.openide.util.lookup</code-name-base>
144+
<build-prerequisite/>
145+
<compile-dependency/>
146+
<run-dependency>
147+
<specification-version>8.33.1</specification-version>
148+
</run-dependency>
149+
</dependency>
150+
<dependency>
151+
<code-name-base>org.openide.awt</code-name-base>
152+
<build-prerequisite/>
153+
<compile-dependency/>
154+
<run-dependency>
155+
<specification-version>7.73</specification-version>
156+
</run-dependency>
157+
</dependency>
158+
<dependency>
159+
<code-name-base>org.openide.util.ui</code-name-base>
160+
<build-prerequisite/>
161+
<compile-dependency/>
162+
<run-dependency>
163+
<specification-version>9.6.1</specification-version>
164+
</run-dependency>
165+
</dependency>
166+
</module-dependencies>
167+
<public-packages>
168+
<package>org.netbeans.modules.payara.server.maven.plugin</package>
169+
</public-packages>
170+
</data>
171+
</configuration>
172+
</project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN"
3+
"http://www.netbeans.org/dtds/filesystem-1_2.dtd">
4+
<filesystem>
5+
</filesystem>
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.netbeans.modules.payara.server.maven.plugin;
20+
21+
import org.netbeans.api.annotations.common.StaticResource;
22+
import org.netbeans.modules.maven.api.NbMavenProject;
23+
import org.netbeans.spi.project.ActionProvider;
24+
25+
/**
26+
* @author Gaurav Gupta <gaurav.gupta@azul.com>
27+
*/
28+
public interface Constants {
29+
30+
String WAR_PACKAGING = "war";
31+
32+
String MAVEN_WAR_PROJECT_TYPE = "org-netbeans-modules-maven/" + NbMavenProject.TYPE_WAR;
33+
34+
String PAYARA_SERVER_MAVEN_PLUGIN = "fish.payara.maven.plugins:payara-server-maven-plugin";
35+
36+
String PLUGIN_GROUP_ID = "fish.payara.maven.plugins";
37+
String PLUGIN_ARTIFACT_ID = "payara-server-maven-plugin";
38+
39+
String RUN_SINGLE_ACTION = ActionProvider.COMMAND_RUN_SINGLE + ".deploy";
40+
String DEBUG_SINGLE_ACTION = ActionProvider.COMMAND_DEBUG_SINGLE + ".deploy";
41+
String PROFILE_SINGLE_ACTION = ActionProvider.COMMAND_PROFILE_SINGLE + ".deploy";
42+
43+
// ── Preference keys (stored per-project via ProjectUtils.getPreferences) ──
44+
String PREF_SERVER_VERSION = "payaraServerVersion";
45+
String PREF_SERVER_PATH = "payaraServerPath";
46+
String PREF_DOMAIN_NAME = "domainName";
47+
String PREF_CONTEXT_ROOT = "contextRoot";
48+
String PREF_EXPLODED = "exploded";
49+
String PREF_REMOTE = "remote";
50+
String PREF_HOST_NAME = "hostName";
51+
String PREF_ADMIN_PORT = "adminPort";
52+
String PREF_ADMIN_USER = "adminUser";
53+
String PREF_INSTANCE_NAME = "instanceName";
54+
String PREF_HOT_DEPLOY = "hotDeploy";
55+
String PREF_AUTO_DEPLOY = "autoDeploy";
56+
String PREF_LIVE_RELOAD = "liveReload";
57+
String PREF_KEEP_STATE = "keepState";
58+
String PREF_TRIM_LOG = "trimLog";
59+
String PREF_DAEMON = "daemon";
60+
String PREF_IGNORE_TEST = "ignoreTestChanges";
61+
62+
// ── Maven property names (passed as -D arguments to the plugin) ──────────
63+
String MVNPROP_SERVER_VERSION = "payara.server.version";
64+
String MVNPROP_SERVER_PATH = "payara.server.path";
65+
String MVNPROP_DOMAIN_NAME = "payara.domain.name";
66+
String MVNPROP_CONTEXT_ROOT = "payara.context.root";
67+
String MVNPROP_EXPLODED = "payara.exploded";
68+
String MVNPROP_REMOTE = "payara.remote";
69+
String MVNPROP_HOST_NAME = "payara.host.name";
70+
String MVNPROP_ADMIN_PORT = "payara.admin.port";
71+
String MVNPROP_ADMIN_USER = "payara.admin.user";
72+
String MVNPROP_INSTANCE_NAME = "payara.instance.name";
73+
String MVNPROP_HOT_DEPLOY = "payara.hot.deploy";
74+
String MVNPROP_AUTO_DEPLOY = "payara.auto.deploy";
75+
String MVNPROP_LIVE_RELOAD = "payara.live.reload";
76+
String MVNPROP_KEEP_STATE = "payara.keep.state";
77+
String MVNPROP_TRIM_LOG = "payara.trim.log";
78+
String MVNPROP_DAEMON = "payara.daemon";
79+
String MVNPROP_IGNORE_TEST = "payara.ignore.test.changes";
80+
String PREF_AI_AGENT = "aiAgent";
81+
String PREF_AI_API_KEY = "aiApiKey";
82+
String PREF_AI_PROVIDER = "aiProvider";
83+
String PREF_AI_PROVIDER_LOC = "aiProviderLocation";
84+
String PREF_AI_MODEL = "aiModel";
85+
86+
String ENV_AI_API_KEY = "PAYARA_AI_API_KEY";
87+
88+
String MVNPROP_AI_AGENT = "payara.ai.agent";
89+
String MVNPROP_AI_API_KEY = "payara.ai.api.key";
90+
String MVNPROP_AI_PROVIDER = "payara.ai.provider";
91+
String MVNPROP_AI_PROVIDER_LOC = "payara.ai.provider.location";
92+
String MVNPROP_AI_MODEL = "payara.ai.model";
93+
94+
@StaticResource
95+
String PROJECT_ICON = "org/netbeans/modules/payara/server/maven/project/resources/payara-server-maven.png";
96+
97+
@StaticResource
98+
String CLEAN_ICON = "org/netbeans/modules/payara/server/maven/project/resources/payara-server-maven-clean.png";
99+
100+
@StaticResource
101+
String BUILD_ICON = "org/netbeans/modules/payara/server/maven/project/resources/payara-server-maven-build.png";
102+
103+
@StaticResource
104+
String REBUILD_ICON = "org/netbeans/modules/payara/server/maven/project/resources/payara-server-maven-clean-build.png";
105+
106+
@StaticResource
107+
String START_ICON = "org/netbeans/modules/payara/server/maven/project/resources/payara-server-maven-start.png";
108+
109+
@StaticResource
110+
String RESTART_ICON = "org/netbeans/modules/payara/server/maven/project/resources/payara-server-maven-restart.png";
111+
112+
@StaticResource
113+
String RELOAD_ICON = "org/netbeans/modules/payara/server/maven/project/resources/payara-server-maven-reload.png";
114+
115+
@StaticResource
116+
String DEBUG_ICON = "org/netbeans/modules/payara/server/maven/project/resources/payara-server-maven-debug.png";
117+
118+
@StaticResource
119+
String PROFILE_ICON = "org/netbeans/modules/payara/server/maven/project/resources/payara-server-maven-profile.png";
120+
}

0 commit comments

Comments
 (0)