Skip to content

Commit

Permalink
README.md Update, pom.xml Update
Browse files Browse the repository at this point in the history
  • Loading branch information
rikkarth committed Dec 3, 2023
1 parent f8cf9f8 commit 204f2b8
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 71 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ build/

### Project ###
dependency-reduced-pom.xml
javadoc
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,56 @@
Tooler-Tools: A versatile Java library for backend and CLI developers, offering a growing collection of tools to
simplify your development tasks.

This is early in development. I will release working packages as soon as there is anything useful to release.
## Easy Integration

[Sonatype Maven Central Repository][Sonatype Maven Central Repository Link]

[GitHub Packages][GitHub Packages Link]

[Sonatype Maven Central Repository Link]: https://central.sonatype.com/artifact/pt.codeforge/tooler-tools

[GitHub Packages Link]: https://github.com/rikkarth/tooler-tools/packages/2005257

## Installation

```
<dependency>
<groupId>pt.codeforge</groupId>
<artifactId>tooler-tools</artifactId>
<version>${version}</version>
</dependency>
```

## Featuring

**XmlHandler** that retrieves values from a doc when provided with the target XPath.

Why parse through a whole XML just to retrieve one value? We can use the power of tooler-tools and XPath. There's no
management or error handling.

### Example - Get String From XPath

```
String pages = getStringFromXPath("/root/path/to/element", doc);
```

#### Possible outcomes:

1. `pages` is never null;
2. `pages` can be empty if value can't be found;
3. `pages` will return value.

```
String pages = getStringFromXPath("/root/path/to/various-elements/text()", doc) // Returns First Element;
String pages = getStringFromXPath("/root/path/to/various-elements[1]/text()", doc) // Returns First Element;
String pages = getStringFromXPath("/root/path/to/various-elements[2]/text()", doc) // Returns Second Element;
String pages = getStringFromXPath("/root/path/to/various-elements[3]/text()", doc) // Returns Third Element;
```

### Example - Get NodeList From XPath
```
NodeList elements = getStringFromXPath("/root/path/to/various-elements", doc);
elements.getLength() // returns 0 if nothing found, and 'n' if something found.
```

221 changes: 151 additions & 70 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,88 +1,169 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
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>pt.codeforge</groupId>
<artifactId>tooler-tools</artifactId>
<version>0.0.4</version>
<groupId>pt.codeforge</groupId>
<artifactId>tooler-tools</artifactId>
<version>0.0.4</version>
<packaging>jar</packaging>
<name>tooler-tools</name>
<description>Versatile library for backend and CLI developers, offers a growing collection of
tools to simplify development tasks.
</description>
<url>https://github.com/rikkarth/tooler-tools</url>

<name>tooler-tools</name>
<licenses>
<license>
<name>GNU Affero General Public License v3.0</name>
<url>https://www.gnu.org/licenses/agpl-3.0.html</url>
</license>
</licenses>

<developers>
<developer>
<name>Ricardo Mendes</name>
<email>[email protected]</email>
<organization>Code Forge</organization>
<organizationUrl>http://www.codeforge.pt</organizationUrl>
<url>https://github.com/rikkarth</url>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com/rikkarth/tooler-tools.git</connection>
<developerConnection>scm:git:ssh://github.com:rikkarth/tooler-tools.git
</developerConnection>
<url>http://github.com/rikkarth/tooler-tools/tree/main</url>
</scm>

<distributionManagement>
<repository>
<!--<repository>
<id>github</id>
<name>GitHub OWNER Apache Maven Packages</name>
<url>https://maven.pkg.github.com/rikkarth/tooler-tools</url>
</repository>-->
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<dependencies>

<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-configuration2 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.9.0</version>
</dependency>
<dependencies>

<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.0</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-configuration2 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.9.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-params -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.0</version>
<scope>test</scope>
</dependency>

</dependencies>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-params -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<reportOutputDirectory>${basedir}</reportOutputDirectory>
<destDir>javadoc</destDir>
<doctitle>tooler-tools</doctitle>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<reportOutputDirectory>${basedir}</reportOutputDirectory>
<destDir>javadoc</destDir>
<doctitle>tooler-tools</doctitle>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 204f2b8

Please sign in to comment.