背景交代:在做图片水印时候引入了两个包文件,这两个包是JDK自带的私有包,不能用Maven库里下载,因此笔者手动将rt和jce两个工具jar文件拷贝到本地的Maven库中,如下图
import com.sun.image.codec.jpeg.JPEGCodec;然后在pom配置文件里写上下面的配置
import com.sun.image.codec.jpeg.JPEGImageEncoder;
将jce和rt拷到如下路径(rt类似)
然后项目在其他电脑上用Maven打包时候报错如下:
Failed to execute goal on project : Could not resolve dependencies for project cs2c.nkscloudweb:nkscloudweb3:war:3.0: The following artifacts could not be resolved: maven-plugins:maven-cobertura-plugin:plugin:1.3, maven-plugins:maven-findbugs-plugin:plugin:1.3.1: Could not find artifact maven-plugins:maven-cobertura-plugin:plugin:1.3 in nexus (http://10.1.81.221:8081/nexus/content/groups/public) -> [Help
最后的解决方法是:在他的计算机上配置如下路径:
<dependency>
<groupId>rt</groupId>
<artifactId>rt</artifactId>
<version>1.0</version>
<systemPath>D:\maven\repositories\rt\rt\1.0\rt-1.0.jar</systemPath>
</dependency>