重来:
1、我用的是本地仓库,图在最下面。
2、在pom.xml里加上GeoTools官方的仓库
<repositories> <repository> <id>osgeo</id> <name>OSGeo Release Repository</name> <url>https://repo.osgeo.org/repository/release/</url> <snapshots><enabled>false</enabled></snapshots> <releases><enabled>true</enabled></releases> </repository> <repository> <id>osgeo-snapshot</id> <name>OSGeo Snapshot Repository</name> <url>https://repo.osgeo.org/repository/snapshot/</url> <snapshots><enabled>true</enabled></snapshots> <releases><enabled>false</enabled></releases> </repository> </repositories>
3、配置maven的 conf 中的 Settings.xml:
<?xml version="1.0" encoding="UTF-8"?> <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 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository>C:\TOOLS\maven-repositoryy</localRepository> <pluginGroups> </pluginGroups> <proxies> </proxies> <servers> </servers> <mirrors> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>*,!osgeo,!maven2-repository.dev.java.net,!boundless</mirrorOf> </mirror> <mirror> <id>osgeo</id> <mirrorOf>osgeo</mirrorOf> <name>OSGeo Release Repository</name> <url>https://repo.osgeo.org/repository/release/</url> </mirror> </mirrors> <profiles> </profiles> </settings>
4、再刷新Maven,不行。
5、把其他电脑已经配置好的仓库中的 Geotools复制覆盖本地:再刷新,这次可以。但不知编译发布有无问题。
参照了这里:
maven 国内加速,修改镜像源 - huiyi0521 - 博客园
修改了本地maven:
打开了FQ
<?xml version="1.0" encoding="UTF-8"?> <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 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository>C:\TOOLS\maven-repositoryy</localRepository> <pluginGroups> </pluginGroups> <proxies> <proxy> <id>optional</id> <active>true</active> <protocol>http</protocol> <!--<username></username> <password></password>--> <host>127.0.0.1</host> <port>10809</port> <!--<nonProxyHosts>local.net|some.host.com</nonProxyHosts>--> </proxy> </proxies> <servers> </servers> <mirrors> <!-- <mirror> <id>nexus-aliyun</id> <mirrorOf>*,!osgeo,!GeoSolutions,!osgeo-snapshot,!alfresco</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </mirror> 阿里云仓库,个人配置 <mirror> <id>aliyun-maven</id> <mirrorOf>central</mirrorOf> <url>https://maven.aliyun.com/repository/public</url> <blocked>false</blocked> </mirror> --> <mirror> <id>mvnrepository</id> <mirrorOf>mvnrepository</mirrorOf> <url>http://mvnrepository.com/</url> </mirror> <!--自定义添加--> <mirror> <id>repo2</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://repo2.maven.org/maven2/</url> </mirror> <!--默认的中央仓库--> <mirror> <id>mirrorId</id> <mirrorOf>repositoryId</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://my.repository.com/repo/path</url> </mirror> <!-- maven仓库官方--> <mirror> <id>nexus</id> <name>internal nexus repository</name> <!-- <url>http://192.168.1.100:8081/nexus/content/groups/public/</url>--> <url>http://repo.maven.apache.org/maven2</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors>
<profiles> <profile> <id>jdk-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties> </profile> </profiles> </settings>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】凌霞软件回馈社区,携手博客园推出1Panel与Halo联合会员
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步