Skip to content

Commit

Permalink
prepare for maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Bonifacio committed Oct 5, 2023
1 parent 2a933a2 commit 5e7e0b0
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn -B package --file try-monad/pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn -B package --file try-monad/pom.xml

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>${env.OSSRH_ID}</username>
<password>${env.OSSRH_PASSWORD}</password>
</server>
</servers>
</settings>
35 changes: 9 additions & 26 deletions try-monad/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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>org.anbonifacio</groupId>
<groupId>io.github.anbonifacio</groupId>
<artifactId>try-monad</artifactId>
<version>0.9-SNAPSHOT</version>

Expand All @@ -14,8 +14,6 @@
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.release>17</maven.compiler.release>
<maven.javadoc.skip>true</maven.javadoc.skip>
<maven.failsafe.logmanager>org.jboss.logmanager.LogManager</maven.failsafe.logmanager>
<maven.surefire.logmanager>org.jboss.logmanager.LogManager</maven.surefire.logmanager>
<maven.version.required>3.8.8</maven.version.required>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -30,7 +28,6 @@
<version.plugin.dependency>3.6.0</version.plugin.dependency>
<version.plugin.deploy>3.1.1</version.plugin.deploy>
<version.plugin.enforcer>3.3.0</version.plugin.enforcer>
<version.plugin.failsafe>3.1.0</version.plugin.failsafe>
<version.plugin.install>3.1.1</version.plugin.install>
<version.plugin.jar>3.3.0</version.plugin.jar>
<version.plugin.release>2.5.3</version.plugin.release>
Expand Down Expand Up @@ -167,20 +164,6 @@
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.plugin.failsafe}</version>
<configuration>
<forkCount>1</forkCount>
<argLine>-XX:+ShowCodeDetailsInExceptionMessages</argLine>
<systemPropertyVariables>
<java.util.logging.config.class>${maven.failsafe.logmanager}
</java.util.logging.config.class>
</systemPropertyVariables>
</configuration>
</plugin>

</plugins>

</pluginManagement>
Expand Down Expand Up @@ -257,15 +240,15 @@

</build>

<repositories>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</repositories>
</distributionManagement>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
*/

package org.anbonifacio.try_monad;
package io.github.anbonifacio.try_monad;

import java.io.Serial;
import java.io.Serializable;
Expand Down Expand Up @@ -98,7 +98,7 @@ public Try<T> filter(Predicate<? super T> p) {

@Override
public Try<T> recover(Function<? super Throwable, T> fn) {
return Try.of(() -> fn.apply(getCause()));
return of(() -> fn.apply(getCause()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
*/

package org.anbonifacio.try_monad;
package io.github.anbonifacio.try_monad;

import java.io.Serial;
import java.io.Serializable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
*/

package org.anbonifacio.try_monad;
package io.github.anbonifacio.try_monad;

import java.util.Objects;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
*/

package org.anbonifacio.try_monad;
package io.github.anbonifacio.try_monad;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down

0 comments on commit 5e7e0b0

Please sign in to comment.