NutzCN Logo
问答 请问MAVEN如何引入或者编译本地的jar包
发布于 264天前 作者 LovelyIsJustice 264 次浏览 复制 上一个帖子 下一个帖子
标签: maven

我把本地的jar包放入Maven的本地库里,文件夹路径是“ssoFilter\ssoFilter\1.1”里面的jar文件命名为“ssoFilter-1.1.jar”
然后在该文件夹里放入pom.xml,源码:
4.0.0ssoFilterssoFilter1.1ssoFilterzhao lao shi

但是使用install命令的时候
D:\Maven\LocalWarehouse\ssoFilter\ssoFilter\1.1>mvn install:install-file -Dfile:ssoFilter-1.1.jar DgroupId=ssoFilter -DartifactId=ssoFilter -Dversion=1.1 -Dpackaging=jar -DgeneratePom=true
[INFO] Scanning for projects...
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom (0 B at 0.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar (0 B at 0.0 KB/sec)
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Building ssoFilter 1.1
[INFO] ------------------------------------------------------------------------
[INFO] [INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ ssoFilter ---
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Skipping ssoFilter
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.430 s
[INFO] Finished at: 2017-01-03T13:59:30+08:00
[INFO] Final Memory: 9M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project ssoFilter: The parameters 'file' for goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file are missing or invalid -> [Help 1] [ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginParameterException

--------------------------------------------------------------------------------
我的问题是,我就算把这个jar包放入项目本地的lib文件夹内,用idea引入,在编译运行的时候,就会报错

03-Jan-2017 14:37:07.632 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start. Full details will be found in the appropriate container log file
03-Jan-2017 14:37:07.632 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [/KMIA_FAMS] startup failed due to previous errors

想请问是什么意思,是不是在编译的时候maven没有编译这个jar包,我要怎么将这个本地jar包引入Maven的本地库?

6 回复
<project><modelVersion>4.0.0</modelVersion><groupId>ssoFilter</groupId><artifactId>ssoFilter</artifactId><version>1.1</version><name>ssoFilter</name><description>zhao lao shi</description></project>

这个是pom.xml 的代码

-Dfile=ssoFilter-1.1.jar

D:\Maven\LocalWarehouse\ssoFilter\ssoFilter\1.1>mvn install:install-file -Dfile=ssoFilter-1.1.jar DgroupId=ssoFilter -DartifactId=ssoFilter -Dversion=1.1 -Dpackaging=jar -DgeneratePom=true
[INFO] Scanning for projects...
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Building ssoFilter 1.1
[INFO] ------------------------------------------------------------------------
[INFO] [INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ ssoFilter ---
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Skipping ssoFilter
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.451 s
[INFO] Finished at: 2017-01-03T16:50:54+08:00
[INFO] Final Memory: 10M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project ssoFilter: The artifact information is incomplete or not valid:
[ERROR] [0] 'groupId' is missing.
[ERROR] -> [Help 1] [ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@wendal 大神,还是报错

@wendal
嗯?大神,我这里写的有什么不对的吗?好想跟你是一样的

添加回复
请先登陆
回到顶部