使用 Gradle 构建可以这样导入整个编译依赖
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar']) // 像是这样
compile('io.socket:socket.io-client:0.7.0') {
exclude group: 'org.json', module: 'json'
}
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
testCompile 'junit:junit:4.12'
}
但是找遍了 Maven 的插件,只有添加单个 jar
<dependencies>
<dependency>
<groupId>org.x</groupId>
<artifactId>my-jar</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/x.jar</systemPath>
</dependency>
</dependencies>
另外使用添加 classpath 的方法也没用,编译的时候还是出错
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<additionalClasspathElements>
<classpathElement>${project.basedir}/src/main/webapp/WEB-INF/lib</classpathElement>
</additionalClasspathElements>
</configuration>
</plugin>
项目原本是 eclipse dynam web project
慕标5832272
相关分类