Skip to content

Commit 87190e0

Browse files
committed
Drop TomcatManagerException
Co-authored by OpenCode.
1 parent 67064c5 commit 87190e0

14 files changed

Lines changed: 74 additions & 185 deletions

src/main/java/org/apache/tomcat/maven/common/deployer/TomcatManager.java

Lines changed: 51 additions & 76 deletions
Large diffs are not rendered by default.

src/main/java/org/apache/tomcat/maven/common/deployer/TomcatManagerException.java

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/main/java/org/apache/tomcat/maven/plugin/tomcat/AbstractCatalinaMojo.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.apache.maven.plugins.annotations.Parameter;
2323
import org.apache.maven.settings.Server;
2424
import org.apache.tomcat.maven.common.deployer.TomcatManager;
25-
import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
2625

2726

2827
import java.io.IOException;
@@ -124,9 +123,6 @@ protected AbstractCatalinaMojo() {
124123
public void execute() throws MojoExecutionException {
125124
try {
126125
invokeManager();
127-
} catch (TomcatManagerException exception) {
128-
throw new MojoExecutionException(
129-
messagesProvider.getMessage("AbstractCatalinaMojo.managerError", exception.getMessage()));
130126
} catch (IOException exception) {
131127
throw new MojoExecutionException(messagesProvider.getMessage("AbstractCatalinaMojo.managerIOError"),
132128
exception);
@@ -140,11 +136,10 @@ public void execute() throws MojoExecutionException {
140136
/**
141137
* Invokes Tomcat manager when this Mojo is executed.
142138
*
143-
* @throws org.apache.maven.plugin.MojoExecutionException if there was a problem executing this goal
144-
* @throws org.apache.tomcat.maven.common.deployer.TomcatManagerException if the Tomcat manager request fails
145-
* @throws java.io.IOException if an i/o error occurs
139+
* @throws org.apache.maven.plugin.MojoExecutionException if there was a problem executing this goal
140+
* @throws java.io.IOException if an i/o error occurs
146141
*/
147-
protected abstract void invokeManager() throws MojoExecutionException, TomcatManagerException, IOException;
142+
protected abstract void invokeManager() throws MojoExecutionException, IOException;
148143

149144
/**
150145
* Gets the Tomcat manager wrapper object configured for this goal.

src/main/java/org/apache/tomcat/maven/plugin/tomcat/deploy/AbstractDeployMojo.java

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import org.apache.maven.plugin.MojoExecutionException;
2222
import org.apache.maven.plugins.annotations.Parameter;
23-
import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
2423
import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
2524
import org.apache.tomcat.maven.plugin.tomcat.AbstractWarCatalinaMojo;
2625

@@ -77,7 +76,7 @@ protected AbstractDeployMojo() {
7776
* {@inheritDoc}
7877
*/
7978
@Override
80-
protected void invokeManager() throws MojoExecutionException, TomcatManagerException, IOException {
79+
protected void invokeManager() throws MojoExecutionException, IOException {
8180
if ("war".equals(mode)) {
8281
deployWar();
8382
} else if ("context".equals(mode)) {
@@ -146,11 +145,10 @@ protected String getTag() {
146145
/**
147146
* Deploys the WAR to Tomcat.
148147
*
149-
* @throws org.apache.maven.plugin.MojoExecutionException if there was a problem locating the WAR
150-
* @throws org.apache.tomcat.maven.common.deployer.TomcatManagerException if the Tomcat manager request fails
151-
* @throws java.io.IOException if an i/o error occurs
148+
* @throws org.apache.maven.plugin.MojoExecutionException if there was a problem locating the WAR
149+
* @throws java.io.IOException if an i/o error occurs
152150
*/
153-
protected void deployWar() throws MojoExecutionException, TomcatManagerException, IOException {
151+
protected void deployWar() throws MojoExecutionException, IOException {
154152
validateWarFile();
155153

156154
getLog().info(messagesProvider.getMessage("AbstractDeployMojo.deployingWar", getDeployedURL()));
@@ -164,12 +162,10 @@ protected void deployWar() throws MojoExecutionException, TomcatManagerException
164162
/**
165163
* Deploys the context XML file to Tomcat.
166164
*
167-
* @throws org.apache.maven.plugin.MojoExecutionException if there was a problem locating the
168-
* context XML file
169-
* @throws org.apache.tomcat.maven.common.deployer.TomcatManagerException if the Tomcat manager request fails
170-
* @throws java.io.IOException if an i/o error occurs
165+
* @throws org.apache.maven.plugin.MojoExecutionException if there was a problem locating the context XML file
166+
* @throws java.io.IOException if an i/o error occurs
171167
*/
172-
protected void deployContext() throws MojoExecutionException, TomcatManagerException, IOException {
168+
protected void deployContext() throws MojoExecutionException, IOException {
173169
validateContextFile();
174170

175171
getLog().info(messagesProvider.getMessage("AbstractDeployMojo.deployingContext", getDeployedURL()));
@@ -183,12 +179,10 @@ protected void deployContext() throws MojoExecutionException, TomcatManagerExcep
183179
/**
184180
* Deploys the WAR and context XML file to Tomcat.
185181
*
186-
* @throws org.apache.maven.plugin.MojoExecutionException if there was a problem locating either the
187-
* WAR or the context XML file
188-
* @throws org.apache.tomcat.maven.common.deployer.TomcatManagerException if the Tomcat manager request fails
189-
* @throws java.io.IOException if an i/o error occurs
182+
* @throws org.apache.maven.plugin.MojoExecutionException if there was a problem locating either the WAR or the context XML file
183+
* @throws java.io.IOException if an i/o error occurs
190184
*/
191-
protected void deployWarAndContext() throws MojoExecutionException, TomcatManagerException, IOException {
185+
protected void deployWarAndContext() throws MojoExecutionException, IOException {
192186
validateWarFile();
193187
validateContextFile();
194188

src/main/java/org/apache/tomcat/maven/plugin/tomcat/deploy/AbstractDeployWarMojo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import org.apache.maven.plugin.MojoExecutionException;
2222
import org.apache.maven.plugins.annotations.Parameter;
23-
import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
2423
import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
2524

2625
import java.io.File;
@@ -75,7 +74,7 @@ protected void validateWarFile() throws MojoExecutionException {
7574
* {@inheritDoc}
7675
*/
7776
@Override
78-
protected void deployWar() throws MojoExecutionException, TomcatManagerException, IOException {
77+
protected void deployWar() throws MojoExecutionException, IOException {
7978
validateWarFile();
8079

8180
getLog().info(messagesProvider.getMessage("AbstractDeployMojo.deployingWar", getDeployedURL()));

src/main/java/org/apache/tomcat/maven/plugin/tomcat/deploy/ListMojo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import org.apache.maven.plugin.MojoExecutionException;
2222
import org.apache.maven.plugins.annotations.Mojo;
23-
import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
2423
import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
2524
import org.apache.tomcat.maven.plugin.tomcat.AbstractCatalinaMojo;
2625

@@ -48,7 +47,7 @@ public ListMojo() {
4847
* {@inheritDoc}
4948
*/
5049
@Override
51-
protected void invokeManager() throws MojoExecutionException, TomcatManagerException, IOException {
50+
protected void invokeManager() throws MojoExecutionException, IOException {
5251
getLog().info(messagesProvider.getMessage("ListMojo.listApps", getURL()));
5352

5453
TomcatManagerResponse tomcatResponse = getManager().list();

src/main/java/org/apache/tomcat/maven/plugin/tomcat/deploy/ReloadMojo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import org.apache.maven.plugin.MojoExecutionException;
2222
import org.apache.maven.plugins.annotations.Mojo;
23-
import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
2423
import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
2524
import org.apache.tomcat.maven.plugin.tomcat.AbstractCatalinaMojo;
2625

@@ -47,7 +46,7 @@ public ReloadMojo() {
4746
* {@inheritDoc}
4847
*/
4948
@Override
50-
protected void invokeManager() throws MojoExecutionException, TomcatManagerException, IOException {
49+
protected void invokeManager() throws MojoExecutionException, IOException {
5150
getLog().info(messagesProvider.getMessage("ReloadMojo.reloadingApp", getDeployedURL()));
5251

5352
TomcatManagerResponse tomcatResponse = getManager().reload(getPath());

src/main/java/org/apache/tomcat/maven/plugin/tomcat/deploy/ResourcesMojo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.apache.maven.plugin.MojoExecutionException;
2222
import org.apache.maven.plugins.annotations.Mojo;
2323
import org.apache.maven.plugins.annotations.Parameter;
24-
import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
2524
import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
2625
import org.apache.tomcat.maven.plugin.tomcat.AbstractCatalinaMojo;
2726

@@ -58,7 +57,7 @@ public ResourcesMojo() {
5857
* {@inheritDoc}
5958
*/
6059
@Override
61-
protected void invokeManager() throws MojoExecutionException, TomcatManagerException, IOException {
60+
protected void invokeManager() throws MojoExecutionException, IOException {
6261
if (type == null) {
6362
getLog().info(messagesProvider.getMessage("ResourcesMojo.listAllResources", getURL()));
6463
} else {

src/main/java/org/apache/tomcat/maven/plugin/tomcat/deploy/ServerInfoMojo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import org.apache.maven.plugin.MojoExecutionException;
2222
import org.apache.maven.plugins.annotations.Mojo;
23-
import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
2423
import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
2524
import org.apache.tomcat.maven.plugin.tomcat.AbstractCatalinaMojo;
2625

@@ -47,7 +46,7 @@ public ServerInfoMojo() {
4746
* {@inheritDoc}
4847
*/
4948
@Override
50-
protected void invokeManager() throws MojoExecutionException, TomcatManagerException, IOException {
49+
protected void invokeManager() throws MojoExecutionException, IOException {
5150
getLog().info(messagesProvider.getMessage("ServerInfoMojo.listInfo", getURL()));
5251

5352
TomcatManagerResponse tomcatResponse = getManager().getServerInfo();

src/main/java/org/apache/tomcat/maven/plugin/tomcat/deploy/SessionsMojo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import org.apache.maven.plugin.MojoExecutionException;
2222
import org.apache.maven.plugins.annotations.Mojo;
23-
import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
2423
import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
2524
import org.apache.tomcat.maven.plugin.tomcat.AbstractCatalinaMojo;
2625

@@ -46,7 +45,7 @@ public SessionsMojo() {
4645
// ----------------------------------------------------------------------
4746

4847
@Override
49-
protected void invokeManager() throws MojoExecutionException, TomcatManagerException, IOException {
48+
protected void invokeManager() throws MojoExecutionException, IOException {
5049
getLog().info(messagesProvider.getMessage("SessionsMojo.listSessions", getURL()));
5150
TomcatManagerResponse tomcatResponse = getManager().getSessions(getPath());
5251
checkTomcatResponse(tomcatResponse);

0 commit comments

Comments
 (0)