由于考虑 CI 作部署的事情, 在网上问了一下, 有社区的高手给了个方案:html
https://clojureverse.org/t/gi...git
I would expect this to be possible since lein, boot, and CLI/deps.edn all have ways to build an uberjar and publish it to Clojars. (for the latter, see https://github.com/clojure/to... 3 – I use https://github.com/seancorfie... 2 and https://github.com/slipset/de... 4 for build/deploy)
配置 Meyvn 的时候, 安装过程询问是否要证书, 选了 NO, 而后就退出了.
后来又尝试了下 https://github.com/juxt/pack.... 安装过程就出错了.github
高手提供的方案是有两个脚本作打包和发布, 他使用的, 比较稳定的,apache
https://github.com/seancorfie...
https://github.com/slipset/de...mvc
具体的打包发布步骤基本对应 https://juxt.pro/blog/posts/p...maven
跑通之后目前的 deps.edn
配置:post
{:paths ["src"] :aliases {:depstar {:extra-deps {seancorfield/depstar {:mvn/version "0.5.2"}} :main-opts ["-m" "hf.depstar.jar" "target/lilac.jar"]} :deploy {:extra-deps {deps-deploy {:mvn/version "RELEASE"}} :main-opts ["-m" "deps-deploy.deps-deploy" "deploy" "target/lilac.jar"]} :install {:extra-deps {deps-deploy {:mvn/version "RELEASE"}} :main-opts ["-m" "deps-deploy.deps-deploy" "install" "target/lilac.jar"]}}}
启动命令:ui
"m2": "clojure -A:depstar && clojure -A:install", "deploy": "clojure -A:depstar && clojure -A:deploy",
pom.xml
文件是 clojure -Spom
生成的, 可是中间内容要修改, 包括增长部分字段,this
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>mvc-works</groupId> <artifactId>calcit-workflow</artifactId> <version>0.0.1-a1</version> <name>calcit-workflow</name> <url>https://github.com/mvc-works/calcit-workflow</url> <description>TODO</description> <scm> <url>https://github.com/mvc-works/calcit-workflow</url> </scm> <dependencies> <dependency> <groupId>org.clojure</groupId> <artifactId>clojure</artifactId> <version>1.10.1</version> </dependency> </dependencies> <build> <sourceDirectory>src</sourceDirectory> </build> <repositories> <repository> <id>clojars</id> <url>https://repo.clojars.org/</url> </repository> </repositories> </project>
单纯 pom.xml 的内容结构是很复杂的, 参考:
https://github.com/seancorfie...
https://github.com/clojure/cl...url
没有打算提供完整的 pom 文件了. Clojars 上显示的内容也不完整.
目前只是想作到能发包和使用, 维护尽可能简单可重复.
毕竟影响到的项目太多了.
另外 deps-deploy 帐号密码是经过 env 提供的, 具体看 README.对应 CI 来讲基本仍是能够配的, 管理来讲倒是不如 token 合适.