Changeset 19097 in josm for trunk


Ignore:
Timestamp:
2024-06-07T13:51:44+02:00 (4 weeks ago)
Author:
taylor.smock
Message:

Fix #8269: Add initial maven pom files

This additionally deletes most IDE specific configuration, in favor of Maven
configuration.

We did have to update scripts/BuildProjectionDefinitions.java so that it would
create an empty EPSG file for the next run in the pom.xml file.

For core, we needed two additional pom.xml files:

  • A parent pom with most dependency information (for inheritance)
    • This will make it easier to keep core and the apache-commons plugin in sync
  • A unit test pom (for plugin tests)
    • Some IDEs (netbeans specifically) don't like this.

What this does not do:

  • Convert from ivy to maven for dependency management in core. This should happen eventually with maven-resolver-ant-tasks (probably with the next dependency update).
  • Deprecate the current ant scripts.
Location:
trunk
Files:
3 added
4 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/BuildProjectionDefinitions.java

    r18801 r19097  
    1414import java.util.Map;
    1515import java.util.TreeMap;
     16import java.util.logging.Logger;
    1617import java.util.regex.Matcher;
    1718import java.util.regex.Pattern;
     
    8586    }
    8687
     88    static boolean touchCustomEpsg(String baseDir) throws IOException {
     89        final Path path = Paths.get(baseDir).resolve(OUTPUT_EPSG_FILE);
     90        if (!Files.exists(path)) {
     91            Files.createDirectories(path.getParent());
     92            Files.createFile(path);
     93            Logger.getLogger(BuildProjectionDefinitions.class.getCanonicalName())
     94                    .info("Could not generate custom-epsg; an empty custom-epsg file was not available on the classpath. " +
     95                            "This should now be fixed, please rerun the command.");
     96            return true;
     97        }
     98        return false;
     99    }
     100
    87101    static void initMap(String baseDir, String file, Map<String, ProjectionDefinition> map) throws IOException {
    88102        final Path path = Paths.get(baseDir).resolve(PROJ_DIR).resolve(file);
     
    107121
    108122    static void buildList(String baseDir) throws IOException {
     123        if (touchCustomEpsg(baseDir)) {
     124            return;
     125        }
    109126        initMap(baseDir, JOSM_EPSG_FILE, epsgJosm);
    110127        initMap(baseDir, PROJ4_EPSG_FILE, epsgProj4);
     
    243260                "EPSG:103474", // lcc/GRS80     - NAD_1983_CORS96_StatePlane_Nebraska_FIPS_2600 [NAD 1983 (CORS96) SPCS Nebraska]
    244261                "EPSG:103475"  // lcc/GRS80     - NAD_1983_CORS96_StatePlane_Nebraska_FIPS_2600_Ft_US [NAD 1983 (CORS96) SPCS Nebraska (US Feet)]
    245                 ).contains(pd.code)) {
     262        ).contains(pd.code)) {
    246263            result = false;
    247264        }
Note: See TracChangeset for help on using the changeset viewer.