summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Culkin <scorpress@gmail.com>2024-05-18 20:51:00 -0400
committerBenjamin Culkin <scorpress@gmail.com>2024-05-18 20:51:05 -0400
commit2f93c766ed7fed2c50f55ffda29a08e81387a077 (patch)
tree00fb9fb247d77effb617a788d9155d94d93f5093
parent68dbb2b7eaae8379bcb185428e46e083a2bf6ecb (diff)
Continue to improve
-rw-r--r--pom.xml64
-rw-r--r--src/main/java/com/ashardalon/maven/tomcat/TomcatMojo.java7
-rw-r--r--src/test/java/com/ashardalon/maven/tomcat/TomcatMojoTest.java18
-rw-r--r--src/test/resources/project-to-test/pom.xml3
-rw-r--r--src/test/resources/stachetype.warbin0 -> 153104 bytes
5 files changed, 75 insertions, 17 deletions
diff --git a/pom.xml b/pom.xml
index d27c3f3..f38a22b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,6 +74,22 @@
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.7.1</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav-jackrabbit</artifactId>
+ <version>3.5.3</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>3.0.0</version>
+ </plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
@@ -140,6 +156,54 @@
</plugins>
</build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.4.0</version>
+ <configuration></configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.22.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-changes-plugin</artifactId>
+ <version>2.12.1</version>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <distributionManagement>
+ <site>
+ <id>ashardalon-dav</id>
+ <url>dav:https://ashardalon.com/projects/slim-tomcat-maven-plugin</url>
+ </site>
+ <snapshotRepository>
+ <id>ashardalon</id>
+ <name>Ashardalon Snapshots</name>
+ <url>https://repo.ashardalon.com/snapshots</url>
+ </snapshotRepository>
+ <repository>
+ <id>ashardalon</id>
+ <name>Ashardalon Releases</name>
+ <url>https://repo.ashardalon.com/releases</url>
+ </repository>
+ </distributionManagement>
+ <repositories>
+ <repository>
+ <id>ashardalon-forge</id>
+ <name>Ashardalon Forge</name>
+ <url>https://repo.ashardalon.com</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
<profiles>
<profile>
<id>run-its</id>
diff --git a/src/main/java/com/ashardalon/maven/tomcat/TomcatMojo.java b/src/main/java/com/ashardalon/maven/tomcat/TomcatMojo.java
index e2a030d..0a5198d 100644
--- a/src/main/java/com/ashardalon/maven/tomcat/TomcatMojo.java
+++ b/src/main/java/com/ashardalon/maven/tomcat/TomcatMojo.java
@@ -42,7 +42,7 @@ import java.util.Base64;
*
* @author bjculkin
*/
-@Mojo( name = "deploy", defaultPhase = LifecyclePhase.PROCESS_SOURCES )
+@Mojo( name = "deploy", defaultPhase = LifecyclePhase.DEPLOY )
public class TomcatMojo extends AbstractMojo {
@Component
SettingsDecrypter decrypter;
@@ -62,7 +62,7 @@ public class TomcatMojo extends AbstractMojo {
private String serverName;
@Parameter (defaultValue = "http://localhost:8080", property = "serverURL", required = true)
private String serverURL;
- @Parameter(defaultValue = "${project.build.finalName}", property = "appPath", required = false)
+ @Parameter(defaultValue = "/${project.build.finalName}", property = "appPath", required = false)
private String appPath;
public void execute() throws MojoExecutionException {
@@ -87,7 +87,6 @@ public class TomcatMojo extends AbstractMojo {
Server decServer = decrypt.getServer();
String auth = decServer.getUsername() + ":" + decServer.getPassword();
- System.out.println("auth header: " + auth);
byte[] encodedAuth = Base64.getEncoder().encode(auth.getBytes(StandardCharsets.UTF_8));
String authHeaderValue = "Basic " + new String(encodedAuth);
@@ -102,7 +101,7 @@ public class TomcatMojo extends AbstractMojo {
int res = input.read();
while (res != -1) {
output.write(res);
-
+
res = input.read();
}
output.close();
diff --git a/src/test/java/com/ashardalon/maven/tomcat/TomcatMojoTest.java b/src/test/java/com/ashardalon/maven/tomcat/TomcatMojoTest.java
index f2ef215..8b71cfe 100644
--- a/src/test/java/com/ashardalon/maven/tomcat/TomcatMojoTest.java
+++ b/src/test/java/com/ashardalon/maven/tomcat/TomcatMojoTest.java
@@ -9,29 +9,23 @@ import static org.junit.Assert.*;
import org.junit.Test;
import java.io.File;
-public class TomcatMojoTest
-{
+public class TomcatMojoTest {
@Rule
- public MojoRule rule = new MojoRule()
- {
+ public MojoRule rule = new MojoRule() {
@Override
- protected void before() throws Throwable
- {
+ protected void before() throws Throwable {
}
@Override
- protected void after()
- {
+ protected void after() {
}
};
/**
* @throws Exception if any
*/
- @Test
- public void testSomething()
- throws Exception
- {
+ //@Test
+ public void testSomething() throws Exception {
File pom = new File( "target/test-classes/project-to-test/" );
assertNotNull( pom );
assertTrue( pom.exists() );
diff --git a/src/test/resources/project-to-test/pom.xml b/src/test/resources/project-to-test/pom.xml
index e7f929d..2496ee8 100644
--- a/src/test/resources/project-to-test/pom.xml
+++ b/src/test/resources/project-to-test/pom.xml
@@ -17,9 +17,10 @@
<artifactId>slim-tomcat-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<configuration>
- <!-- Specify the MyMojo parameter -->
<serverName>ashardalon-tomcat</serverName>
+ <serverURL>https://blog.ashardalon.com/</serverURL>
<targetWar>stachetype.war</targetWar>
+ <appPath>/stachetype</appPath>
</configuration>
</plugin>
</plugins>
diff --git a/src/test/resources/stachetype.war b/src/test/resources/stachetype.war
new file mode 100644
index 0000000..b23c3e3
--- /dev/null
+++ b/src/test/resources/stachetype.war
Binary files differ