Skip to content

Commit

Permalink
Update profile based activation to be smarter, and property activated…
Browse files Browse the repository at this point in the history
… when needed
  • Loading branch information
brianwyka committed Nov 4, 2020
1 parent 99939dd commit 5aa4fe1
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ jobs:
[[ "$BUILD_VERSION" != *"-SNAPSHOT" ]] && BUILD_VERSION="${BUILD_VERSION}-SNAPSHOT" && ./mvnw --batch-mode versions:set -DnewVersion=$BUILD_VERSION || true
- name: Build Maven Project
if: success() && (github.event_name == 'pull_request')
run: ./mvnw --batch-mode install -P ci.build
run: ./mvnw --batch-mode install -D ci.build
- name: Build Maven Project and Deploy Snapshot
if: success() && (github.event_name == 'push')
run: ./mvnw --batch-mode deploy -P ci.deploy
run: ./mvnw --batch-mode deploy -D ci.deploy
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
echo ::set-output name=RELEASE_VERSION::$RELEASE_VERSION
- name: Build Maven Project and Deploy Release
if: success()
run: ./mvnw --batch-mode deploy -P ci.deploy
run: ./mvnw --batch-mode deploy -D ci.deploy
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Manages commonly used plugins and configurations across all types of packaging a
<parent>
<groupId>com.optum.sourcehawk</groupId>
<artifactId>sourcehawk-parent</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>
</parent>
```

Expand All @@ -35,7 +35,7 @@ Manages plugins and profiles for all JAR based projects which extend it.
<parent>
<groupId>com.optum.sourcehawk</groupId>
<artifactId>sourcehawk-jar-parent</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>
</parent>
```

Expand Down
2 changes: 1 addition & 1 deletion checkstyle-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.optum.sourcehawk</groupId>
<artifactId>sourcehawk-parent</artifactId>
<version>1.1.3-SNAPSHOT</version>
<version>1.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
32 changes: 26 additions & 6 deletions jar-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>sourcehawk-parent</artifactId>
<groupId>com.optum.sourcehawk</groupId>
<version>1.1.3-SNAPSHOT</version>
<version>1.1.4-SNAPSHOT</version>
</parent>

<artifactId>sourcehawk-jar-parent</artifactId>
Expand Down Expand Up @@ -70,7 +70,7 @@
<dependency>
<groupId>com.optum.sourcehawk</groupId>
<artifactId>sourcehawk-checkstyle-config</artifactId>
<version>1.1.3-SNAPSHOT</version>
<version>1.1.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
Expand Down Expand Up @@ -360,6 +360,9 @@
<id>java.9-plus</id>
<activation>
<jdk>[9,</jdk>
<file>
<exists>src/main/java/</exists>
</file>
</activation>
<build>
<plugins>
Expand Down Expand Up @@ -393,16 +396,33 @@
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>

<!-- JAVA: MAIN (DEPLOY) -->
<profile>
<id>java.main.deploy</id>
<activation>
<file>
<exists>src/main/java/</exists>
</file>
<property>
<name>ci.deploy</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
16 changes: 14 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.optum.sourcehawk</groupId>
<artifactId>sourcehawk-parent</artifactId>
<version>1.1.3-SNAPSHOT</version>
<version>1.1.4-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Sourcehawk Parent</name>
Expand Down Expand Up @@ -285,7 +285,9 @@
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
<file>
<exists>pom.xml</exists>
</file>
</activation>
<build>
<plugins>
Expand All @@ -307,6 +309,11 @@
<!-- CI: BUILD -->
<profile>
<id>ci.build</id>
<activation>
<property>
<name>ci.build</name>
</property>
</activation>
<build>
<plugins>
<plugin>
Expand All @@ -320,6 +327,11 @@
<!-- CI: DEPLOY -->
<profile>
<id>ci.deploy</id>
<activation>
<property>
<name>ci.deploy</name>
</property>
</activation>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
Expand Down

0 comments on commit 5aa4fe1

Please sign in to comment.