我刚刚安装了Maven 3 - 我是Java新手,我想了解Maven是如何工作的。 现在,我知道我可以通过在maven项目中编辑POM文件来添加依赖项,但我想知道是否有一种“干净”的方式来使用命令行。 运行Windows 8.1,Java 8,Maven 3。
I've just installed Maven 3 - I'm new to Java and I want to learn how Maven works. For now, I know that I can add a dependency by editing POM file in the maven project, but I wonder if there is a 'clean' way to do it with command line. Running Windows 8.1, Java 8, Maven 3.
最满意答案
直接使用POM可能是一种更好的方法......但是你可以:
mvn install:install-file -Dfile = -DgroupId =“group-id”\ -DartifactId =“artifact-id”-Dversion =“version”-Dpackaging =“packaging”
https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
Using the POM directly is probably a better way, but yes you can do that:
mvn install:install-file -Dfile=<path-to-file> -DgroupId="group-id" \ -DartifactId="artifact-id" -Dversion="version" -Dpackaging="packaging"https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
更多推荐
发布评论