I’m trying to use gradle init on Maven projects to learn about Gradle and see how well the converison works. I am currently seeing two issues: 1) There is a warning during compile about boot classpath, in association with the java compile source version 1.5. Maven doesn’t show this warning - does Maven automatically set this? 2) I have tried gradle init on multiple projects, but so far have not been getting successful test runs. After gradle init, gradle compileJava, gradle test, I usually see errors. One small maven project I found is this one: https://github.com/mttkay/signpost.git Errors look like this:
/home/user/gradle_tests/script_output/signpost_v4/signpost-commonshttp3/src/test/java/oauth/signpost/commonshttp3/CommonsHttpOAuthProviderTest.java:6: error: cannot find symbol
import oauth.signpost.OAuthProviderTest;
^
symbol:
class OAuthProviderTest
location: package oauth.signpost
/home/user/gradle_tests/script_output/signpost_v4/signpost-commonshttp3/src/test/java/oauth/signpost/commonshttp3/CommonsHttpOAuthProviderTest.java:12: error: cannot find symbol
public class CommonsHttpOAuthProviderTest extends OAuthProviderTest {
These errors do not appear in Maven. The cor emodule builds and tests correctly with gradle, this is the commonshttp3 module. The pom.xml:
<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/maven-v4_0_0.xsd">
<parent>
<artifactId>oauth-signpost</artifactId>
<groupId>oauth.signpost</groupId>
<version>1.2.1.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>signpost-commonshttp3</artifactId>
<name>signpost-commonshttp3</name>
<dependencies>
<dependency>
<groupId>oauth.signpost</groupId>
<artifactId>signpost-core</artifactId>
<version>1.2.1.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>oauth.signpost</groupId>
<artifactId>signpost-core</artifactId>
<version>1.2.1.1</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
</dependencies>
</project>
The build.gradle in this module:
description = 'signpost-commonshttp3'
dependencies {
compile project(':signpost-core')
compile group: 'commons-httpclient', name: 'commons-httpclient', version:'3.1'
testCompile project(':signpost-core')
}
task packageTests(type: Jar) {
from sourceSets.test.output
classifier = 'tests'
}
artifacts.archives packageTests