Skip to content

Commit c1b0f70

Browse files
committed
enh: added info goal
1 parent b6e0adc commit c1b0f70

2 files changed

Lines changed: 44 additions & 6 deletions

File tree

plugin/src/main/java/com/flowlogix/maven/plugins/DevModeMojo.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,10 @@ private void enableOrDeploy() throws IOException {
102102
deployer.sendDeployCommand(deployer::printResponse, null, 0);
103103
}
104104

105-
getLog().info("Application URL at " + getAppURL());
105+
displayInfo();
106106
if (openBrowser) {
107-
getLog().info("App Server at %s".formatted(deployer.serverLocations().properties().baseRoot()));
108-
getLog().info("Domain at %s".formatted(deployer.serverLocations().properties().instanceRoot()));
109-
getLog().info("Logging at %s/logs/server.log".formatted(deployer.serverLocations().properties().instanceRoot()));
110-
getLog().info("Deps (optional) at %s/lib/warlibs/".formatted(deployer.serverLocations().properties().instanceRoot()));
111107
ForkJoinPool.commonPool().execute(this::openBrowser);
112108
}
113-
114109
ForkJoinPool.commonPool().execute(this::deployLiveReloadHelper);
115110
}
116111

@@ -128,6 +123,16 @@ private void openBrowser() {
128123
}
129124
}
130125

126+
protected void displayInfo() {
127+
getLog().info("Application URL at " + getAppURL());
128+
if (openBrowser) {
129+
getLog().info("App Server at %s".formatted(deployer.serverLocations().properties().baseRoot()));
130+
getLog().info("Domain at %s".formatted(deployer.serverLocations().properties().instanceRoot()));
131+
getLog().info("Logging at %s/logs/server.log".formatted(deployer.serverLocations().properties().instanceRoot()));
132+
getLog().info("Deps (optional) at %s/lib/warlibs/".formatted(deployer.serverLocations().properties().instanceRoot()));
133+
}
134+
}
135+
131136
private void deployLiveReloadHelper() {
132137
if (!deployer.pingWebsite("%s/%s/ping".formatted(getBaseURL(), FLOWLOGIX_LIVERELOAD))) {
133138
getLog().info("Deploying LiveReload helper application");
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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 com.flowlogix.maven.plugins;
20+
21+
import org.apache.maven.plugins.annotations.Mojo;
22+
23+
/**
24+
* Goal which reloads the application on the server.
25+
* Works for both Payara and GlassFish servers.
26+
*/
27+
@Mojo(name = "info", requiresProject = false, threadSafe = true)
28+
public class InfoMojo extends DevModeMojo {
29+
@Override
30+
public void execute() {
31+
displayInfo();
32+
}
33+
}

0 commit comments

Comments
 (0)