maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 建文 <tom.grade1...@163.com>
Subject Re: Can not build with Junit4.18
Date Wed, 02 Sep 2015 02:01:30 GMT
Junit is added in dependencies,and i can run Junit test in my Eclipse,
but when run mvn clean install -DskipTests=true fail

On 2015/9/1 23:56, Sandra Parsick wrote:
> Hi,
>
> You have to add the junit dependency in your <dependencies> section.
> But I would recommend you to move the tests to src/test/java.
>
> Best regards,
>
> Sandra
>
> Am 30.08.2015 um 15:40 schrieb 建文:
>> I add junit4.8 in my project, and the test java classes are in
>> src/main/java not src/test/java(i know it's not best practice), and
>> i set junit dependency scope to runtime. but when i run mvn clean
>> install -DskipTests=ture,got error,
>>
>> [ERROR] Failed to execute goal
>> org.apache.maven.plugins:maven-compiler-plugin:3.3:compile
>> (default-compile) on project HigoPlatform: Compilation failure:
>> Compilation failure: [ERROR]
>> /mydata/project/HigoPlatform/src/main/java/com/higo/test/TestJunit4.java:[3,24]
>>
>>
> package org.junit does not exist
>> [ERROR]
>> /mydata/project/HigoPlatform/src/main/java/com/higo/test/TestJunit4.java:[5,17]
>>
>>
> package org.junit does not exist
>> [ERROR]
>> /mydata/project/HigoPlatform/src/main/java/com/higo/test/TestJunit4.java:[14,4]
>>
>>
> cannot find symbol
>> [ERROR] symbol:   class Test [ERROR] location: class
>> com.higo.test.TestJunit4 [ERROR]
>> /mydata/project/HigoPlatform/src/main/java/com/higo/test/TestJunit4.java:[16,5]
>>
>>
> cannot find symbol
>> from error,i try to override the junit version in
>> maven-compiler-plugin with: <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-compiler-plugin</artifactId>
>> <version>3.3</version> <configuration> <encoding>UTF-8</encoding>
>> <source>1.7</source> <target>1.7</target> </configuration>
>> <dependencies> <dependency> <groupId>junit</groupId>
>> <artifactId>junit</artifactId> <version>4.12</version>
>> </dependency> </dependencies> </plugin> but not work.any suggest
or
>> resolution tip? thanks
>>
>>
>> ---------------------------------------------------------------------
>>
>>
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message