Publish PostGIS Layers in GeoServer Automatically using cURL and REST
Disclaimer: The idea came from this blog . So, what's the difference? I'm using Windows. cURL should be installed already. If you have lots of tables in your database that you wanted to publish in GeoServer, you can use this method. Just prepare a list of tables (separated by new line) you want to publish in a text file format. Before proceeding in publishing layers, you need to setup a workspace and store in your GeoServer first. Although this can be done using cURL and REST API, but it is more convenient in that way. After a minute.... :D :D Create ".bat" file Use the code below but (of course) change the necessary inputs for /f %%a in ( <list of tables you want to publish> .txt) do curl -v -u <username> : <password> -XPOST -H "Content-type: text/xml" -d "<featureType><name>%%a</name></featureType>" http://localhost:8080/geoserver/rest/workspaces/ <name of workspace> /datastores/...











