diff --git a/build-logic/src/main/java/org/teavm/buildutil/PublishTeaVMExtension.java b/build-logic/src/main/java/org/teavm/buildutil/PublishTeaVMExtension.java index 5f98465e8..9c676f1dc 100644 --- a/build-logic/src/main/java/org/teavm/buildutil/PublishTeaVMExtension.java +++ b/build-logic/src/main/java/org/teavm/buildutil/PublishTeaVMExtension.java @@ -19,4 +19,8 @@ public interface PublishTeaVMExtension { String getArtifactId(); void setArtifactId(String artifactId); + + String getPackaging(); + + void setPackaging(String packaging); } diff --git a/build-logic/src/main/java/org/teavm/buildutil/PublishTeaVMPlugin.java b/build-logic/src/main/java/org/teavm/buildutil/PublishTeaVMPlugin.java index 44ca4d296..48335198a 100644 --- a/build-logic/src/main/java/org/teavm/buildutil/PublishTeaVMPlugin.java +++ b/build-logic/src/main/java/org/teavm/buildutil/PublishTeaVMPlugin.java @@ -75,10 +75,14 @@ public abstract class PublishTeaVMPlugin implements Plugin { publication.setArtifactId(extension.getArtifactId()); } publication.from(project.getComponents().getByName("java")); + if (extension.packaging != null) { + publication.getPom().setPackaging(extension.packaging); + } } private static class ExtensionImpl implements PublishTeaVMExtension { private String artifactId; + private String packaging; @Override public String getArtifactId() { @@ -89,5 +93,15 @@ public abstract class PublishTeaVMPlugin implements Plugin { public void setArtifactId(String artifactId) { this.artifactId = artifactId; } + + @Override + public String getPackaging() { + return packaging; + } + + @Override + public void setPackaging(String packaging) { + this.packaging = packaging; + } } } diff --git a/tools/maven/webapp/build.gradle.kts b/tools/maven/webapp/build.gradle.kts index f8eaa3abb..f4a29b909 100644 --- a/tools/maven/webapp/build.gradle.kts +++ b/tools/maven/webapp/build.gradle.kts @@ -30,4 +30,5 @@ tasks.processResources { teavmPublish { artifactId = "teavm-maven-webapp" + packaging = "maven-archetype" } \ No newline at end of file