`
- 浏览:
104848 次
- 性别:
- 来自:
北京
-
很多人选择在Github上开源项目,但很多开源项目要依赖一些自己写的jar。如何让用户(使用者)可以通过互联网自动下载所依赖的jar呢?
下面介绍下通过GitHub做maven repository的过程;
1、在GitHub上创建项目(这步操作不细说了,过程很简单,用过GitHub的大家都懂的)
例如:我创建的项目名叫 maven-repository
2、把本地maven项目Build,build生成的maven文件夹上传到Giuhub
3、本地新建maven项目如果需要依赖jar,在pom.xml中增加
<!-- 关联下载地址-->
<repositories>
<repository>
<id>maven-repository</id>
<url>https://raw.github.com/GitHub用户名/项目名/master</url>
</repository>
</repositories>
<!-- 具体依赖项目-->
<dependency>
<groupId>具体groupId</groupId>
<artifactId>具体artifactId</artifactId>
<version>1.0.0</version>
</dependency>
例如我的GitHub用户是polimo那上面依赖仓库地址就是
https://raw.github.com/polimo/maven-repository/master
备注:
1、上面的地址直接输入返回为404,页面是无法看到的
2、master 一定要写上,否则会无法下载
3、如果本地项目依赖的groupId、artifactId跟本地项目中的maven项目groupId、artifactId相对应,则会默认依赖本地项目而不去服务端下载。
4、具体依赖项目 配置中
groupId、artifactId 一定要与依赖项目的groupId、artifactId一致。
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
maven(url = "https://raw.github.com/DSeeLP/maven-repository/main/") 使用groovy dsl时,请使用以下命令: maven { url 'https://raw.github.com/DSeeLP/maven-repository/main/' } 玛文 将其放在您的存储库...
jpos-workflow-cli jPos cli 命令将 jPos 事务管理器配置转换为有向图...<repository><id>dgrandemange-mvn-repo-releases</id><name>dgrandemange GitHub Maven Repository releases</name><url>https://gith
github-release-maven-plugin 一个用于创建GitHub版本的Maven插件,包括资产附件和版本说明用法在项目中设置pom.xml < project> [...] < build> < plugins> < plugin> < groupId>com.ragedunicorn.tools.maven</ ...
Turquoise 5.3 A comprehensive Android library for private use. https://github.com/shepherdviolet/turquoise ... //maven { url 'https://github.com/shepherdviolet/alternate-maven-repository/r
From a remote Maven repository (jcenter). From a local .aar file. 1. Setup from a remote Maven repository (jcenter) Add compile 'io.github.kexanie.library:MathView:0.0.6' into dependencies sec
Prebuilt JARs are available from the central Maven repository or the Sonatype Maven repository. Alternatively, you can get the latest code from Git and build it yourself: git clone git://github....
jitsi-maven存储库
publish-to-github-example:此存储库包含如何发布示例,并依赖使用github的Maven工件
uniauto-appupdate Add it to your build.gradle ...To enable installing into local maven repository and JitPack you need to add the android-maven plugin: Add classpath 'com.github.dcendents:android-maven
< dependency> < groupId>github.tobsef</ groupId> < artifactId>hello-maven</ artifactId> < version>1.2.1</ version></ dependency>< repositories> < repository> < id>github</ id> < name>GitHub Tobse
RSyntaxTextArea是用Swing编写的语法高亮显示,代码折叠文本组件。 注意:相当长一段时间以来,RSTA的源代码一直托管在GitHub上,但此处的发布...在Maven中也可以找到工件,例如com.fifesoft:rsyntaxtextarea:2.xx。
用于 GitHub 的 Maven Wagon 目的 该项目可用于将 GitHub 发布功能用作 Maven 存储库。 它也与mvn versions:display-dependency-updates兼容mvn versions:display-dependency-updates 。 安装 cd "$( mktemp --...
自己的Maven存储库在当前存储库上: mvn install:install-file -DgroupId= < a> -DartifactId= < an> -Dversion=... 在Maven pom.xml上: < repositories> < repository> < id>GitHub</ id> < name>My Own Maven Reposi
您可以绕过这个 GitHub 源代码存储库,通过将以下存储库和依赖项添加到 Eclipse 或 Apache Maven 等开发环境,直接依赖从 Aspose Maven Repository 发布的工件: Aspose Maven 存储库 <repositories> <repository> ...
This library is available in jitPack which is the default Maven repository used in Android Studio. Gradle Step 1. Add it in your root build.gradle at the end of repositories allprojects { ...
GitHub: : 什么是XJar XJar是基于对JAR包内部资源的加密以及扩展ClassLoader来构建的一套程序加密启动,动态解密运行的方案,避免初始化或反向编译,支持Spring Boot JAR安全加密运行,同时支持其原生JAR。更多...
Maven发布动作GitHub Action用于自动发布Maven软件包总览这个动作执行Maven deploy生命周期阶段为Maven提供您的GPG密钥和密码,以便您可以使用maven-gpg-plugin对工件进行签名向Maven提供您的Nexus凭据,以便它可以...
您可以绕过这个 GitHub 源代码存储库,通过将以下存储库和依赖项添加到 Eclipse 或 Apache Maven 等开发环境,直接依赖从 Aspose Maven Repository 发布的工件: Aspose Maven 存储库 <repository> <id>aspose...
sbt-github-packages 使用其Apache Maven支持将您的项目配置为发布到 。 请注意,GitHub软件包专门支持maven样式的发布; 使用常春藤样式将导致警告。 还根据已发布到Package Registry的工件提供一些便利功能。用法...