-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Maven Archetype for creating new Trino plugins
- Loading branch information
1 parent
3638d7c
commit 9c2efbd
Showing
10 changed files
with
297 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
target/ | ||
pom.xml.tag | ||
pom.xml.releaseBackup | ||
pom.xml.versionsBackup | ||
pom.xml.next | ||
release.properties | ||
dependency-reduced-pom.xml | ||
buildNumber.properties | ||
.mvn/timing.properties | ||
# https://github.com/takari/maven-wrapper#usage-without-binary-jar | ||
.mvn/wrapper/maven-wrapper.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
excludePatterns=*.iml,interpolated-pom.xml,build.log | ||
connectorName=example_connector | ||
classPrefix=Example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.trino</groupId> | ||
<artifactId>trino-root</artifactId> | ||
<version>440-SNAPSHOT</version> | ||
<relativePath>../../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>trino-plugin-archetype-builder</artifactId> | ||
<packaging>pom</packaging> | ||
<description>Trino - Maven Archetype Builder for Trino Plugins</description> | ||
|
||
<properties> | ||
<air.main.basedir>${project.parent.basedir}</air.main.basedir> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.trino</groupId> | ||
<artifactId>trino-example-plugin</artifactId> | ||
<version>0.1-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>copy-sources</id> | ||
<goals> | ||
<goal>copy-resources</goal> | ||
</goals> | ||
<phase>generate-sources</phase> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}/trino-example-plugin</outputDirectory> | ||
<resources> | ||
<resource> | ||
<directory>${project.basedir}/../trino-example-plugin</directory> | ||
<excludes> | ||
<exclude>**/*.iml</exclude> | ||
<exclude>target</exclude> | ||
</excludes> | ||
<filtering>false</filtering> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>overwrite-generated-meta</id> | ||
<!-- Run after archetype:create-from-project --> | ||
<goals> | ||
<goal>copy-resources</goal> | ||
</goals> | ||
<phase>process-sources</phase> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}/trino-example-plugin/target/generated-sources/archetype/src/main/resources/META-INF/maven</outputDirectory> | ||
<overwrite>true</overwrite> | ||
<resources> | ||
<resource> | ||
<directory>${project.basedir}/src/main/resources/META-INF/maven</directory> | ||
<filtering>false</filtering> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>overwrite-generated-pom</id> | ||
<!-- Run after archetype:create-from-project --> | ||
<goals> | ||
<goal>copy-resources</goal> | ||
</goals> | ||
<phase>process-sources</phase> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}/trino-example-plugin/target/generated-sources/archetype</outputDirectory> | ||
<overwrite>true</overwrite> | ||
<resources> | ||
<resource> | ||
<directory>${project.basedir}/src/main/resources</directory> | ||
<filtering>true</filtering> | ||
<includes> | ||
<include>pom.xml</include> | ||
</includes> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-invoker-plugin</artifactId> | ||
<version>3.3.0</version> | ||
<configuration> | ||
<pomIncludes> | ||
<pomInclude>pom.xml</pomInclude> | ||
</pomIncludes> | ||
<projectsDirectory>${project.build.directory}/trino-example-plugin/target/generated-sources/archetype</projectsDirectory> | ||
<noLog>false</noLog> | ||
<streamLogs>true</streamLogs> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>generate-archetype</id> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
<phase>generate-sources</phase> | ||
<configuration> | ||
<projectsDirectory>${project.build.directory}/trino-example-plugin</projectsDirectory> | ||
|
||
<goals> | ||
<goal>org.apache.maven.plugins:maven-archetype-plugin:3.2.1:create-from-project -Darchetype.properties=${project.basedir}/archetype.properties -Darchetype.postPhase=validate</goal> | ||
</goals> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>package-archetype</id> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
<phase>package</phase> | ||
<configuration> | ||
<goals> | ||
<!-- gib could be enabled by the CI workflow but it would fail --> | ||
<goal>package -Dgib.disable</goal> | ||
</goals> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>install-archetype</id> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
<phase>install</phase> | ||
<configuration> | ||
<goals> | ||
<goal>install -Dgib.disable</goal> | ||
</goals> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>deploy-archetype</id> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
<phase>deploy</phase> | ||
<configuration> | ||
<goals> | ||
<goal>deploy -Dgib.disable</goal> | ||
</goals> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
31 changes: 31 additions & 0 deletions
31
...n/trino-plugin-archetype-builder/src/main/resources/META-INF/maven/archetype-metadata.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<archetype-descriptor xsi:schemaLocation="https://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.1.0 http://maven.apache.org/xsd/archetype-descriptor-1.1.0.xsd" name="trino-example-plugin" | ||
xmlns="https://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.1.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<requiredProperties> | ||
<requiredProperty key="classPrefix"/> | ||
<requiredProperty key="connectorName"/> | ||
</requiredProperties> | ||
<fileSets> | ||
<fileSet filtered="false" packaged="false" encoding="UTF-8"> | ||
<directory /> | ||
<includes> | ||
<include>.gitignore</include> | ||
</includes> | ||
</fileSet> | ||
|
||
<fileSet filtered="true" packaged="false" encoding="UTF-8"> | ||
<directory /> | ||
<includes> | ||
<include>README.md</include> | ||
<include>LICENSE</include> | ||
</includes> | ||
</fileSet> | ||
<fileSet filtered="true" packaged="true" encoding="UTF-8"> | ||
<directory>src/main/java</directory> | ||
</fileSet> | ||
<fileSet filtered="true" packaged="true" encoding="UTF-8"> | ||
<directory>src/test/java</directory> | ||
</fileSet> | ||
</fileSets> | ||
</archetype-descriptor> |
46 changes: 46 additions & 0 deletions
46
plugin/trino-plugin-archetype-builder/src/main/resources/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.trino</groupId> | ||
<artifactId>trino-root</artifactId> | ||
<version>${project.version}</version> | ||
<!-- this file is copied to ${project.build.directory}/trino-example-plugin/target/generated-sources/archetype so add 5 levels to the relative path --> | ||
<relativePath>../../../../../../../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>trino-plugin-archetype</artifactId> | ||
<packaging>maven-archetype</packaging> | ||
<description>Trino - Maven Archetype for Trino Plugins</description> | ||
|
||
<properties> | ||
<air.main.basedir>${project.parent.basedir}</air.main.basedir> | ||
</properties> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-archetype-plugin</artifactId> | ||
<version>3.2.1</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-archetype-plugin</artifactId> | ||
<version>3.2.1</version> | ||
</plugin> | ||
</plugins> | ||
<extensions> | ||
<extension> | ||
<groupId>org.apache.maven.archetype</groupId> | ||
<artifactId>archetype-packaging</artifactId> | ||
<version>3.2.1</version> | ||
</extension> | ||
</extensions> | ||
</build> | ||
</project> |
7 changes: 7 additions & 0 deletions
7
plugin/trino-plugin-archetype-builder/src/test/resources/projects/basic/archetype.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package=it.pkg | ||
groupId=com.it | ||
artifactId=basic | ||
version=0.1-SNAPSHOT | ||
keepParent=false | ||
connectorName=example_connector | ||
classPrefix=Example |
1 change: 1 addition & 0 deletions
1
plugin/trino-plugin-archetype-builder/src/test/resources/projects/basic/goal.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters