将 Maven 原型存储在 Google 云存储中
Store Maven Archetype In Google Cloud Storage
我正在使用 Maven wagon 将我的工件存储在 Google Cloud Storage 中。我关注了这个博客 post https://egkatzioura.com/2018/04/09/host-your-maven-artifacts-using-google-cloud-storage/。我想避免将 nexus 用于 运行 服务器的开销和我可以从 GCS 获得的存储成本节省。
现在我正在创建一些 Maven 原型,我还想将其存储在 GCS 中,让人们能够在他们的机器上生成原型。
我一直无法找到有关如何执行此操作的任何帮助,是否可以使用 wagon 进行常规设置并从中提取原型?
我已经能够解决我自己的问题了。我需要将 Google Wagon jar 添加到我的 Maven lib 目录中。我还在我的 .m2/settings.xml.
添加了一个原型配置文件
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
...
<profiles>
<profile>
<id>Archetype</id>
<repositories>
<repository>
<id>archetype</id>
<url>gs://my-archetype-bucket</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2/</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>Archetype</activeProfile>
</activeProfiles>
</settings>
我正在使用 Maven wagon 将我的工件存储在 Google Cloud Storage 中。我关注了这个博客 post https://egkatzioura.com/2018/04/09/host-your-maven-artifacts-using-google-cloud-storage/。我想避免将 nexus 用于 运行 服务器的开销和我可以从 GCS 获得的存储成本节省。
现在我正在创建一些 Maven 原型,我还想将其存储在 GCS 中,让人们能够在他们的机器上生成原型。
我一直无法找到有关如何执行此操作的任何帮助,是否可以使用 wagon 进行常规设置并从中提取原型?
我已经能够解决我自己的问题了。我需要将 Google Wagon jar 添加到我的 Maven lib 目录中。我还在我的 .m2/settings.xml.
添加了一个原型配置文件<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
...
<profiles>
<profile>
<id>Archetype</id>
<repositories>
<repository>
<id>archetype</id>
<url>gs://my-archetype-bucket</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2/</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>Archetype</activeProfile>
</activeProfiles>
</settings>