Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies and use maven for dependency management instead of ivy #8

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<project name="MapRoulette" default="dist" basedir=".">
<project name="MapRoulette" default="dist" basedir="." xmlns:mvn="antlib:org.apache.maven.resolver.ant">
<property name="plugin.src.dir" value="src/main/java"/>
<property name="plugin.test.dir" location="src/test"/>
<property name="plugin.resources.dir" value="src/main/resources"/>
Expand All @@ -20,7 +20,33 @@
<!-- ** include targets that all plugins have in common ** -->
<import file="../build-common.xml"/>

<target name="pre-compile" depends="fetch_dependencies">
<target name="download-maven-artifact-resolver">
<mkdir dir="${ivy.jar.dir}"/>
<get src="https://repo1.maven.org/maven2/org/apache/maven/resolver/maven-resolver-ant-tasks/1.5.1/maven-resolver-ant-tasks-1.5.1-uber.jar"
dest="${ivy.jar.dir}/maven-resolver-ant-tasks-uber.jar"
usetimestamp="true"/>
</target>
<target name="init-maven" depends="download-maven-artifact-resolver">
<path id="maven.lib.path">
<fileset dir="${ivy.jar.dir}" includes="maven-resolver-ant-tasks-uber.jar"/>
</path>
<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml" classpathref="maven.lib.path"/>
</target>
<target name="fetch-maven-dependencies" depends="init-maven">
<mvn:pom file="pom.xml"/>
<mvn:resolve>
<!-- I wish this stanza wasn't necessary, but the repos aren't read from pom.xml -->
<mvn:remoterepos>
<mvn:remoterepo id="JOSM-central" url="https://josm.openstreetmap.de/nexus/content/repositories/central/" />
<mvn:remoterepo id="JOSM-releases" url="https://josm.openstreetmap.de/nexus/content/repositories/releases/" />
<mvn:remoterepo id="JOSM-snapshots" url="https://josm.openstreetmap.de/nexus/content/repositories/snapshots/" />
<mvn:remoterepo id="JOSM-osgeo" url="https://josm.openstreetmap.de/nexus/content/repositories/osgeo/" />
</mvn:remoterepos>
<mvn:files refid="lib.files" dir="lib" layout="{artifactId}-{version}-{classifier}.{extension}" scopes="compile"/>
</mvn:resolve>
</target>

<target name="pre-compile" depends="fetch-maven-dependencies">
<!-- include fetch_dependencies task -->
</target>
</project>
12 changes: 0 additions & 12 deletions ivy.xml

This file was deleted.

57 changes: 37 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<dependency>
<groupId>org.openstreetmap.josm</groupId>
<artifactId>josm</artifactId>
<version>18511</version>
<version>18905</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -27,21 +27,21 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<version>2.35.0</version>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>3.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.2</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.9.2</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -50,28 +50,22 @@
<version>1.49.a</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-jcs3-core</artifactId>
<version>3.1</version>
<version>3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.1.4</version>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>2.1.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.commonmark</groupId>
<artifactId>commonmark</artifactId>
<version>0.21.0</version>
<version>0.22.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand All @@ -80,19 +74,19 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.13.0</version>
<configuration>
<release>17</release>
</configuration>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.30.0</version>
<version>2.43.0</version>
<configuration>
<java>
<eclipse>
<version>4.21.0</version>
<version>4.21</version>
<file>${project.basedir}/../00_core_tools/eclipse/formatter.xml</file>
</eclipse>
<removeUnusedImports/>
Expand All @@ -109,6 +103,29 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.6.3</version>
</requireMavenVersion>
<requireJavaVersion>
<version>17</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.TreeMap;
import java.util.regex.Pattern;

import org.commonmark.internal.util.Parsing;
import org.commonmark.text.Characters;
import org.commonmark.node.AbstractVisitor;
import org.commonmark.node.CustomNode;
import org.commonmark.node.Node;
Expand Down Expand Up @@ -82,8 +82,8 @@ private static class SelectNode extends CustomNode {
* @param selectBlock The full select block
*/
SelectNode(String selectBlock) {
final var startDefault = Parsing.find('"', selectBlock, 0) + 1;
final var endDefault = Parsing.find('"', selectBlock, startDefault);
final var startDefault = Characters.find('"', selectBlock, 0) + 1;
final var endDefault = Characters.find('"', selectBlock, startDefault);
final var valueMatcher = Pattern.compile("values=\"([^\"]*)").matcher(selectBlock);
final var nameMatcher = Pattern.compile("name=\"([^\"]*)").matcher(selectBlock);
if (nameMatcher.find()) {
Expand Down
Loading