Skip to content

Commit

Permalink
Merge pull request #119 from fabiobrz/deploy.pom-requirements
Browse files Browse the repository at this point in the history
Implement requirements for deploying to Maven central
  • Loading branch information
simkam authored Jan 11, 2024
2 parents ef18d96 + 9ac47e7 commit 52fe791
Show file tree
Hide file tree
Showing 13 changed files with 189 additions and 106 deletions.
41 changes: 30 additions & 11 deletions deployments/intersmash-deployments-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,10 @@
</resource>
</resources>
<plugins>
<!--
We want for tests to be executed by Surefire, but the inherited configuration is enough for
the Intersmash deployments provider
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<!--
The intersmash-deployments-provider artifact must be published because there are projects which depend on it
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -94,5 +83,35 @@
<intersmash.deployments.wildfly.build.profile>eap</intersmash.deployments.wildfly.build.profile>
</properties>
</profile>
<profile>
<id>doc</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>publish</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@
import org.junit.jupiter.api.Test;

public class IntersmashSharedDeploymentsTest {
@Test
public void testBareMetalBootableJarIsAvailable() {
// jakarta
assertBootableJarIsAvailable(IntersmashSharedDeployments.bootableJarDemoBareMetal());
// javax
assertBootableJarIsAvailable(IntersmashSharedDeployments.bootableJarJavaxDemoBareMetal());
}

@Test
public void testOpenShiftBootableJarIsAvailable() {
Expand All @@ -38,22 +31,6 @@ public void testOpenShiftBootableJarIsAvailable() {
assertBootableJarIsAvailable(IntersmashSharedDeployments.bootableJarJavaxDemoOpenShift());
}

@Test
public void testBareMetalAndOpenShiftBootableJarAreNotTheSame() {
// jakarta
assertBareMetalAndOpenShiftBootableJarAreNotTheSame(IntersmashSharedDeployments.bootableJarDemoBareMetal(),
IntersmashSharedDeployments.bootableJarDemoOpenShift());
// javax
assertBareMetalAndOpenShiftBootableJarAreNotTheSame(IntersmashSharedDeployments.bootableJarJavaxDemoBareMetal(),
IntersmashSharedDeployments.bootableJarJavaxDemoOpenShift());
}

private static void assertBareMetalAndOpenShiftBootableJarAreNotTheSame(final Path bareMetalBootableJarPath,
final Path openShiftBootableJarPath) {
Assertions.assertNotEquals(bareMetalBootableJarPath.toAbsolutePath().toString(),
openShiftBootableJarPath.toAbsolutePath().toString());
}

private static void assertBootableJarIsAvailable(final Path openShiftApp) {
Assertions.assertNotNull(openShiftApp);
Assertions.assertTrue(Files.exists(openShiftApp));
Expand Down
Empty file.
Empty file.
8 changes: 0 additions & 8 deletions deployments/intersmash-deployments-shared/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<!--
The intersmash-shared-deployments POM and submodules must be published because there are projects
which could use them
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down
28 changes: 6 additions & 22 deletions deployments/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,34 +84,18 @@
</dependencies>
</dependencyManagement>

<build>
<plugins>
<!--
The intersmash-deployments POM must be published because there are projects which depend on it and, e.g.
get executed on OCP
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>openshift</id>
<id>publish</id>
<build>
<plugins>
<plugin>
<!-- Do not execute the maven-source-plugin when the openshift profile is active -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
</execution>
</executions>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
84 changes: 78 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,37 @@
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.jboss.intersmash</groupId>
<artifactId>intersmash-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Intersmash Parent: Aggregator</name>
<description>Intersmash - Run your cloud-native tests with Java!</description>
<url>http://github.com/Intersmash/intersmash</url>

<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<developers>
<developer>
<name>Fabio Burzigotti</name>
<email>[email protected]</email>
<organization>Red Hat</organization>
<organizationUrl>http://www.redhat.com</organizationUrl>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com/Intersmash/intersmash.git</connection>
<developerConnection>scm:git:ssh://github.com:Intersmash/intersmash.git</developerConnection>
<url>http://github.com/Intersmash/intersmash/tree/main</url>
</scm>

<modules>
<module>tools</module>
Expand Down Expand Up @@ -75,7 +101,7 @@
<version.maven-dependency-plugin>3.2.0</version.maven-dependency-plugin>
<version.maven-deploy-plugin>3.0.0-M1</version.maven-deploy-plugin>
<version.maven-source-plugin>3.2.1</version.maven-source-plugin>
<version.maven-javadoc-plugin>3.3.0</version.maven-javadoc-plugin>
<version.maven-javadoc-plugin>3.5.0</version.maven-javadoc-plugin>
<!--
This is needed now since XTF is using 3.11 and instead maven-aether-provider pulls 3.4 which is missing
SystemUtils#IS_Z_OS
Expand All @@ -97,6 +123,7 @@
<version.spotless-maven-plugin>2.35.0</version.spotless-maven-plugin>
<version.dev-failsafe.failsafe>3.3.1</version.dev-failsafe.failsafe>
<version.sundrio.builder-annotations>0.101.0</version.sundrio.builder-annotations>
<version.maven-gpg-plugin>3.1.0</version.maven-gpg-plugin>

<!--
By default, the follwing prop is empty, stating that the build profile (community vs. productized bits)
Expand Down Expand Up @@ -420,11 +447,27 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${version.maven-source-plugin}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${version.maven-javadoc-plugin}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -489,6 +532,20 @@
<artifactId>java-generator-maven-plugin</artifactId>
<version>${version.io.fabric8}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${version.maven-gpg-plugin}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>

Expand Down Expand Up @@ -542,11 +599,6 @@
</filesets>
</configuration>
</plugin>
<!--
The intersmash-parent POM must be published because there are projects which could use it, even as a
transitive dependency, e.g.: external projects using intersmash-deployments as the parent POM would
need intersmash-parent as well.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down Expand Up @@ -595,6 +647,26 @@
<module>demos</module>
</modules>
</profile>
<profile>
<id>publish</id>
<build>
<plugins>
<!--
The intersmash-parent POM must be published because there are projects which could use it, even as a
transitive dependency, e.g.: external projects using intersmash-deployments as the parent POM would
need intersmash-parent as well.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<repositories>
Expand Down
33 changes: 33 additions & 0 deletions tools/intersmash-tools-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,37 @@
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>doc</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>publish</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
36 changes: 36 additions & 0 deletions tools/intersmash-tools-provisioners/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,40 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>doc</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<doclint>none</doclint>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>publish</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* </pre>
* The application will be deployed by:
* <ul>
* <li>{@link RhSsoTemplateOpenShiftProvisioner}</li>
* <li>{@link org.jboss.intersmash.tools.provision.openshift.RhSsoTemplateOpenShiftProvisioner}</li>
* </ul>
* <p>
* See {@link RhSsoTemplate} for available templates the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.jboss.intersmash.tools.provision.openshift.template.OpenShiftTemplate;

/**
* OpenShift template for EAP 7.z (i.e. WildFly Jakarta EE 8 <= 26.1.2) applications.
* OpenShift template for EAP 7.z (i.e. WildFly Jakarta EE 8 &lt;= 26.1.2) applications.
* <p>
* See e.g.: https://github.com/jboss-container-images/jboss-eap-7-openshift-image
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ private void waitForKeycloakResourceReadiness() {
/**
* Get a reference to keycloak object. Use get() to get the actual object, or null in case it does not
* exist on tested cluster.
* @return A concrete {@link Resource} instance representing the {@link org.jboss.intersmash.tools.provision.openshift.operator.keycloak.keycloak.Keycloak} resource definition
* @return A concrete {@link Resource} instance representing the {@link Keycloak} resource definition
*/
public Resource<Keycloak> keycloak() {
return keycloakClient()
Expand Down
Loading

0 comments on commit 52fe791

Please sign in to comment.