-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from vpa1977/maven-plugin-basic
feat: basic maven rock plugin
- Loading branch information
Showing
18 changed files
with
569 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
.vscode | ||
# Ignore Gradle build output directory | ||
build | ||
target |
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,38 @@ | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.canonical</groupId> | ||
<artifactId>rockcraft-parent</artifactId> | ||
<version>0.0.1</version> | ||
<packaging>pom</packaging> | ||
<properties> | ||
<maven.compiler.target>8</maven.compiler.target> | ||
<maven.compiler.source>8</maven.compiler.source> | ||
<maven.compiler.release>8</maven.compiler.release> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<distributionManagement> | ||
<snapshotRepository> | ||
<id>ossrh</id> | ||
<url>https://oss.sonatype.org/content/repositories/snapshots</url> | ||
</snapshotRepository> | ||
<repository> | ||
<id>ossrh</id> | ||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> | ||
</repository> | ||
</distributionManagement> | ||
|
||
<modules> | ||
<module>rockcraft</module> | ||
<module>rockcraft-maven</module> | ||
</modules> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>3.5.0</version> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
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,151 @@ | ||
<project> | ||
<parent> | ||
<groupId>com.canonical</groupId> | ||
<artifactId>rockcraft-parent</artifactId> | ||
<version>0.0.1</version> | ||
</parent> | ||
|
||
<packaging>maven-plugin</packaging> | ||
<properties> | ||
<maven-invoker-plugin.version>3.8.0</maven-invoker-plugin.version> | ||
<maven-plugin-tools.version>3.13.1</maven-plugin-tools.version> | ||
<mavenVersion>3.9.9</mavenVersion> | ||
<mavenPluginVersion>3.15.0</mavenPluginVersion> | ||
<guiceVersion>6.0.0</guiceVersion> | ||
<mockitoVersion>5.12.0</mockitoVersion> | ||
<mavenPluginTestingHarnessVersion>4.0.0-beta-1</mavenPluginTestingHarnessVersion> | ||
</properties> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>rockcraft-maven-plugin</artifactId> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.maven.plugin-tools</groupId> | ||
<artifactId>maven-plugin-annotations</artifactId> | ||
<version>${mavenPluginVersion}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.maven.plugin-tools</groupId> | ||
<artifactId>maven-plugin-tools-java</artifactId> | ||
<version>${maven-plugin-tools.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<!-- Maven --> | ||
<dependency> | ||
<groupId>org.apache.maven</groupId> | ||
<artifactId>maven-plugin-api</artifactId> | ||
<version>${mavenVersion}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.maven</groupId> | ||
<artifactId>maven-artifact</artifactId> | ||
<version>${mavenVersion}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.maven</groupId> | ||
<artifactId>maven-core</artifactId> | ||
<version>${mavenVersion}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.maven.shared</groupId> | ||
<artifactId>maven-shared-utils</artifactId> | ||
<version>3.4.2</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.canonical</groupId> | ||
<artifactId>rockcraft</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.yaml</groupId> | ||
<artifactId>snakeyaml</artifactId> | ||
<version>2.3</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<version>5.11.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-gpg-plugin</artifactId> | ||
<version>3.1.0</version> | ||
<executions> | ||
<execution> | ||
<id>sign-artifacts</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>sign</goal> | ||
</goals> | ||
<configuration> | ||
<gpgArguments> | ||
<arg>--pinentry-mode</arg> | ||
<arg>loopback</arg> | ||
</gpgArguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-invoker-plugin</artifactId> | ||
<version>${maven-invoker-plugin.version}</version> | ||
<configuration> | ||
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo> | ||
<settingsFile>src/it/settings.xml</settingsFile> | ||
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath> | ||
<!--- | ||
Don't use addTestClassPath as it interferes with the classpath --> | ||
<postBuildHookScript>verify</postBuildHookScript> | ||
<skipInvocation>${skipTests}</skipInvocation> | ||
<streamLogs>true</streamLogs> | ||
<!-- Silences repetitive "downloading" logs from the local repo. | ||
Note: this also silences logs about integration test runs! --> | ||
<mavenOpts>-Dorg.slf4j.simpleLogger.defaultLogLevel=WARN</mavenOpts> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>install</goal> | ||
<goal>run</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-plugin-plugin</artifactId> | ||
<version>${maven-plugin-tools.version}</version> | ||
<executions> | ||
<execution> | ||
<id>help-mojo</id> | ||
<goals> | ||
<goal>helpmojo</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<redirectTestOutputToFile>true</redirectTestOutputToFile> | ||
<excludes> | ||
<exclude>unit/**</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
</project> |
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,8 @@ | ||
package foo; | ||
|
||
public class Foo { | ||
public Foo() { | ||
System.out.println("Foo"); | ||
} | ||
|
||
} |
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 @@ | ||
invoker.goals=--no-transfer-progress install -X |
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,29 @@ | ||
<project> | ||
<groupId>foo</groupId> | ||
<artifactId>foo</artifactId> | ||
<version>1</version> | ||
<modelVersion>4.0.0</modelVersion> | ||
<properties> | ||
<maven.compiler.source>21</maven.compiler.source> | ||
<maven.compiler.target>21</maven.compiler.target> | ||
</properties> | ||
<build> | ||
<directory>${project.basedir}/target</directory> | ||
<outputDirectory>${project.basedir}/target/classes</outputDirectory> | ||
<testOutputDirectory>${project.basedir}/target/test-classes</testOutputDirectory> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.canonical</groupId> | ||
<artifactId>rockcraft-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>create-rock</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> | ||
|
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,14 @@ | ||
import java.io.*; | ||
|
||
File target = new File( basedir, "target" ); | ||
|
||
var files = target.listFiles(new FilenameFilter(){ | ||
public boolean accept(File dir, String name) { | ||
return name.equals("rockcraft.yaml"); | ||
} | ||
}); | ||
|
||
if ( files == null || files.length == 0 ) | ||
{ | ||
throw new FileNotFoundException( "Could not find generated rock file in " + rockOut ); | ||
} |
1 change: 1 addition & 0 deletions
1
rockcraft-maven/src/it/manual-create-rock-test/invoker.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 @@ | ||
invoker.goals=--no-transfer-progress install |
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,47 @@ | ||
<project> | ||
<groupId>foo</groupId> | ||
<artifactId>foo</artifactId> | ||
<version>1</version> | ||
<modelVersion>4.0.0</modelVersion> | ||
<properties> | ||
<maven.compiler.source>8</maven.compiler.source> | ||
<maven.compiler.target>8</maven.compiler.target> | ||
</properties> | ||
<build> | ||
<directory>${project.basedir}/target</directory> | ||
<outputDirectory>${project.basedir}/target/classes</outputDirectory> | ||
<testOutputDirectory>${project.basedir}/target/test-classes</testOutputDirectory> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.canonical</groupId> | ||
<artifactId>rockcraft-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>create-rock</goal> | ||
<goal>build-rock</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<docker>true</docker> | ||
<buildPackage>openjdk-17-jdk-headless</buildPackage> | ||
<targetRelease>17</targetRelease> | ||
<jlink>false</jlink> | ||
<summary>foo</summary> | ||
<description>readme.txt</description> | ||
<source>https://github.com/vpa1977/chisel-releases</source> | ||
<branch>24.04-openjdk-17</branch> | ||
<architectures> | ||
<architecture>amd64</architecture> | ||
<architecture>arm64</architecture> | ||
</architectures> | ||
<slices> | ||
<slice>busybox_bins</slice> | ||
<slice>dash_bins</slice> | ||
</slices> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
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 @@ | ||
1 |
8 changes: 8 additions & 0 deletions
8
rockcraft-maven/src/it/manual-create-rock-test/src/main/java/foo/Foo.java
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,8 @@ | ||
package foo; | ||
|
||
public class Foo { | ||
public Foo() { | ||
System.out.println("Foo"); | ||
} | ||
|
||
} |
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,34 @@ | ||
<settings> | ||
<profiles> | ||
<profile> | ||
<id>it-repo</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
</activation> | ||
<repositories> | ||
<repository> | ||
<id>local.central</id> | ||
<url>@localRepositoryUrl@</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>local.central</id> | ||
<url>@localRepositoryUrl@</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
</profile> | ||
</profiles> | ||
</settings> |
Oops, something went wrong.