Skip to content

Commit

Permalink
Migrate changes to plugin from upstream. Fixes mojohaus#1 (mojohaus#1)
Browse files Browse the repository at this point in the history
* Migrate changes to plugin from upstream.  Fixes mojohaus#1

This is the change set for the new fork.

* Add run-its to release process

* Add mojorelease to release process
  • Loading branch information
mykelalvis committed Sep 20, 2023
1 parent d8a48cd commit bb444e0
Show file tree
Hide file tree
Showing 29 changed files with 6,218 additions and 58 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ target
*.iml
/.idea/
/.factorypath
.checkstyle
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
# Infrastructurebuider Properties Maven Plugin

This is a fork of [the Mojohaus plugin](http://www.mojohaus.org/properties-maven-plugin/)

Original README is below the fold.

Functionality of IB versions will be _mostly_ similar to existing upstream versions. `#YMMV`

## Branching

This fork attempts to ensure changes from the upstream are present. "Sync fork", etc, should
be applied.

NO MODIFICATIONS SHOULD BE MADE TO ` master` except from upstream.

IB changes are made with git-flow to `develop`, so `develop` needs to be regularly rebased from
`master` which has been sync'd with the upstream.

## Workflow

1. Sync `master` from upstream.
2. Rebase `develop` from `master`.
3. Branch from `develop` for a feature working branch (e.g. `git flow feature start BLAH`)
4. Do work.
5. PR to `develop`, with squashed commits. PRs to develop should
1. Not be merged until you are confident it is correct and tested (obvs).
2. Be a single feature commit onto `develop`.
6. Collect work on `develop`, ensuring that rebasing from `master`/upstream is managed.

## Releases

The releases for the IB version will be done slightly off-schedule from upstream changes. For the
most part, this downstream version will be keyed to the upstream's version with an additional
number in the version. Thus, `1.2.1.7-ib` of the IB version is based on _some_ version upstream that
was called `1.2.1-SNAPSHOT` at the time of the merge. If the upstream version changes, then this
project's version will change accordingly and the final number set to `.0` again.

1. Create a PR from `develop` to `ibrelease`. Do NOT squash this PR.
2. Get acceptance for release PR.
3. Do `mvn -B release:prepare release:perform` with IB's release setup from `ibrelease`.
1. Merge changes from `ibrelease` back onto `develop`.
1. Lather
1. Rinse
1. Repeat

IB Releases are made from the /ibreleases branch, which is downstream from `develop`.

---

# MojoHaus Properties Maven Plugin

This is the [properties-maven-plugin](http://www.mojohaus.org/properties-maven-plugin/).
Expand Down
100 changes: 91 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,23 @@
<version>76</version>
</parent>

<groupId>org.infrastructurebuilder.maven</groupId>

<artifactId>properties-maven-plugin</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1.0-ib-SNAPSHOT</version>

<packaging>maven-plugin</packaging>

<name>Properties Maven Plugin</name>
<description>The Properties Maven Plugin is here to make life a little easier when dealing
with properties. It provides goals to read and write properties from files.</description>
with properties. It provides goals to read and write properties from files.


This was forked from the original properties-maven-plugin to fix issue mojohaus/properties-maven-plugin#30.

For RELEASED IB Versions prior to 1.2.0.1, see [the original forked repo](https://github.com/infrastructurebuilder/archived-properties-maven-plugin)

Note that the IB version might be released ahead or behind the mojohaus version.</description>

<url>https://www.mojohaus.org/properties-maven-plugin</url>

Expand Down Expand Up @@ -65,28 +74,48 @@
<name>Tim Gordon</name>
<email>timothygordon32@gmail.com</email>
</developer>
<developer>
<id>mykelalvis</id>
<name>Mykel Alvis</name>
<email>mykel.alvis@gmail.com</email>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com/mojohaus/properties-maven-plugin.git</connection>
<developerConnection>scm:git:ssh://git@github.com/mojohaus/properties-maven-plugin.git</developerConnection>
<tag>master</tag>
<url>https://github.com/mojohaus/properties-maven-plugin/tree/master</url>
<connection>scm:git:https://github.com/infrastructurebuilder/properties-maven-plugin.git</connection>
<developerConnection>scm:git:ssh://git@github.com/infrastructurebuilder/properties-maven-plugin.git</developerConnection>
<tag>HEAD</tag>
<url>https://github.com/infrastructurebuilder/properties-maven-plugin</url>
</scm>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/mojohaus/properties-maven-plugin/issues/</url>
<url>https://github.com/infrastructurebuilder/properties-maven-plugin/issues/</url>
</issueManagement>
<ciManagement>
<system>GitHub</system>
<url>https://github.com/mojohaus/properties-maven-plugin/actions/</url>
<system>Travis-CI</system>
<url>https://travis-ci.org/infrastructurebuilder/properties-maven-plugin</url>
</ciManagement>
<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<properties>
<mavenVersion>3.5.4</mavenVersion>
<recommendedJavaBuildVersion>11</recommendedJavaBuildVersion>
<scmpublish.content>target/staging/${project.artifactId}</scmpublish.content>
<project.build.outputTimestamp>2023-07-27T21:53:50Z</project.build.outputTimestamp>
<scmpublish.content>target/staging/${project.artifactId}</scmpublish.content>
<gpg.signing.profiles>run-its,mojorelease,release,IBgpgsigning</gpg.signing.profiles>
<maven.release.plugin.version>3.0.1</maven.release.plugin.version>
<maven.nexus.staging.plugin.version>1.6.13</maven.nexus.staging.plugin.version>
<maven.nexus.staging.plugin.skipStaging>false</maven.nexus.staging.plugin.skipStaging>
</properties>

<dependencies>
Expand Down Expand Up @@ -124,8 +153,61 @@
<artifactId>maven-plugin-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-sec-dispatcher</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230618</version>
</dependency>
<dependency>
<groupId>com.github.wnameless.json</groupId>
<artifactId>json-flattener</artifactId>
<version>0.16.6</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.12.553</version>
</dependency>
<dependency>
<groupId>org.tomlj</groupId>
<artifactId>tomlj</artifactId>
<version>1.1.0</version>
</dependency>

</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${maven.nexus.staging.plugin.version}</version>
<configuration>
<skipStaging>${maven.nexus.staging.plugin.skipStaging}</skipStaging>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>${maven.release.plugin.version}</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>true</useReleaseProfile>
<releaseProfiles>${gpg.signing.profiles}</releaseProfiles>
<goals>deploy</goals>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>run-its</id>
Expand Down
3 changes: 3 additions & 0 deletions src/it/InjectServers/invoke.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
invoker.debug = true
invoker.goals = generate-resources
invoker.buildResult = success
42 changes: 42 additions & 0 deletions src/it/InjectServers/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>@project.groupId@</groupId>
<artifactId>it-test-parent</artifactId>
<version>@project.version@</version>
<relativePath>../it-test-parent/pom.xml</relativePath>
</parent>
<!-- Build description -->
<artifactId>WriteActiveProfilePropertiesToOutputFile</artifactId>
<packaging>pom</packaging>
<name>${project.artifactId}</name>

<!-- Build plugins and extensions -->
<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>inject-servers</goal>
</goals>
<configuration>
<keyPrefix>server.%s.</keyPrefix>
<!--
<servers>
<server>sharedservices</server>
</servers>
-->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
2 changes: 2 additions & 0 deletions src/it/InjectServers/prepare.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import junit.framework.Assert;

26 changes: 26 additions & 0 deletions src/it/InjectServers/verify.bsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import java.io.*;
import org.codehaus.plexus.util.*;

if ( !basedir.exists() )
{
System.err.println( basedir.getAbsolutePath() + " is missing." );
return false;
}

File buildLog = new File( basedir, "build.log" );
if ( !buildLog.exists() )
{
System.err.println( buildLog.getAbsolutePath() + " is missing." );
return false;
}

String content = IOUtil.toString( new FileInputStream( buildLog ) );
String ior = "Using all servers";
if ( content.contains( ior ) )
{
System.err.println( "build.log contains '" + importError + "'" );
return true;
}

System.err.println("_------------------------------------ FAIL!");
return false;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
invoker.debug = true
invoker.goals = generate-resources
invoker.buildResult = success
49 changes: 49 additions & 0 deletions src/it/WriteActiveProfilePropertiesToOutputFile/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>@project.groupId@</groupId>
<artifactId>it-test-parent</artifactId>
<version>@project.version@</version>
<relativePath>../it-test-parent/pom.xml</relativePath>
</parent>
<!-- Build description -->
<artifactId>WriteActiveProfilePropertiesToOutputFile</artifactId>
<packaging>pom</packaging>
<name>${project.artifactId}</name>

<!-- Build plugins and extensions -->
<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>write-active-profile-properties</goal>
</goals>
<configuration>
<outputFile>
${project.build.directory}/itresults/WriteActiveProfilePropertiesToOutputFile</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>activeprofile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<bob>dog</bob>
</properties>
</profile>
</profiles>
</project>
14 changes: 14 additions & 0 deletions src/it/WriteActiveProfilePropertiesToOutputFile/prepare.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import junit.framework.Assert;

File target = new File(basedir, "target/itresults");
if (!target.exists()) {
target.mkdirs();
Assert.assertTrue("Folder " + target.absolutePath + " must exist", target.exists());
}

File f = new File(target, "WriteActiveProfilePropertiesToOutputFile");
if (f.exists()) {
f.deleteDir();
}

Assert.assertFalse("File " + f.absolutePath + " must exist", f.exists());
10 changes: 10 additions & 0 deletions src/it/WriteActiveProfilePropertiesToOutputFile/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import junit.framework.Assert;

File target = new File(basedir, "target/itresults");

File f = new File(target, "WriteActiveProfilePropertiesToOutputFile");
def out = f.text
Assert.assertTrue("File " + f.absolutePath + " exists", f.exists());
Assert.assertNotSame("File is empty", 0, f.length());
Assert.assertTrue("Bob is a dog", out.contains("bob=dog"))
Assert.assertFalse("Bob is not a cat", out.contains("bob=cat"))
1 change: 1 addition & 0 deletions src/it/it-test-parent/invoke.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.skip = true
24 changes: 24 additions & 0 deletions src/it/it-test-parent/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<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>

<groupId>@project.groupId@</groupId>
<artifactId>it-test-parent</artifactId>
<version>@project.version@</version>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<url>http://www.lolcats.com/images/u/08/23/lolcatsdotcomcm90ebvhwphtzqvf.jpg</url>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

0 comments on commit bb444e0

Please sign in to comment.