You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Jean-Philippe Caruana <jp...@target2sell.com> on 2014/03/03 14:16:24 UTC
junit conflict in idea
Hi,
I'm using Buildr 1.4.15 and I have junit conflict in my idea files : I
see two version of junit :
- 4.8.2 (that "ships" with buildr)
- 4.11 (last version I use)
My buildfile looks like this:
JUNIT = 'junit:junit:jar:4.11'
define 'common' do
compile.with LOG4J
test.compile.with JUNIT
package :jar
end
My project iml file looks like this :
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$M2_REPO$/junit/junit/4.8.2/junit-4.8.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root
url="jar://$M2_REPO$/junit/junit/4.8.2/junit-4.8.2-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$M2_REPO$/junit/junit/4.11/junit-4.11.jar!/"
/>
</CLASSES>
<JAVADOC />
<SOURCES>
<root
url="jar://$M2_REPO$/junit/junit/4.11/junit-4.11-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
I have two questions :
- how can I tell buildr to ignore junit 4.8.2 version when I want
another one (hene 4.11) ?
- maybe the 4.11 shound be junit default version ?
Thanks
--
Jean-Philippe Caruana - jp@target2sell.com
http://www.barreverte.fr
Re: junit conflict in idea
Posted by Vincent Tence <vt...@pyxis-tech.com>.
I mean
define 'common' do
compile.with LOG4J
test.with 'org.hamcrest:hamcrest-core:jar:1.3', 'com.github.stefanbirkner:system-rules:jar:1.4.0', 'org.junit.contrib:junit-theories:jar:4.11', QUICKCHECK
package :jar
end
-- Vincent
> I use a build.yaml file with a line:
>
> junit: 4.11
>
> and it works just fine.
>
> I don't think you need to specify the junit dependency in your buildfile (I never do). You can try:
>
> define 'common' do
> compile.with LOG4J
> test.with
> package :jar
> end
>
> Cheers,
> -- Vincent
>
> On 2014-03-03, at 8:49 AM, Jean-Philippe Caruana <jp...@target2sell.com> wrote:
>
>> Le 03/03/2014 14:36, Tammo van Lessen a écrit :
>>> Hi Jean Philippe,
>>>
>>> If I'm not mistaken, adding the following line to the beginning of your
>>> buildfile should help:
>>>
>>> Buildr.settings.build['junit'] = '4.11'
>>>
>>> In order to avoid conflicts, you can reference JUnit.dependencies instead
>>> of your own JUNIT constant.
>>
>> I didn't know that ! Thanks !
>> But I still have the issue, but my buildfile looks like this now :
>>
>> Buildr.settings.build['junit'] = '4.11'
>> JUNIT = JUnit.dependencies, 'org.hamcrest:hamcrest-core:jar:1.3',
>> 'com.github.stefanbirkner:system-rules:jar:1.4.0',
>> 'org.junit.contrib:junit-theories:jar:4.11', QUICKCHECK
>>
>> Please note that in eclipse there is no such issue, so I suspect the
>> idea plugin here.
>>
>> --
>> Jean-Philippe Caruana
>> http://www.barreverte.fr
>
Re: junit conflict in idea
Posted by Vincent Tence <vt...@pyxis-tech.com>.
I use a build.yaml file with a line:
junit: 4.11
and it works just fine.
I don't think you need to specify the junit dependency in your buildfile (I never do). You can try:
define 'common' do
compile.with LOG4J
test.with
package :jar
end
Cheers,
-- Vincent
On 2014-03-03, at 8:49 AM, Jean-Philippe Caruana <jp...@target2sell.com> wrote:
> Le 03/03/2014 14:36, Tammo van Lessen a écrit :
>> Hi Jean Philippe,
>>
>> If I'm not mistaken, adding the following line to the beginning of your
>> buildfile should help:
>>
>> Buildr.settings.build['junit'] = '4.11'
>>
>> In order to avoid conflicts, you can reference JUnit.dependencies instead
>> of your own JUNIT constant.
>
> I didn't know that ! Thanks !
> But I still have the issue, but my buildfile looks like this now :
>
> Buildr.settings.build['junit'] = '4.11'
> JUNIT = JUnit.dependencies, 'org.hamcrest:hamcrest-core:jar:1.3',
> 'com.github.stefanbirkner:system-rules:jar:1.4.0',
> 'org.junit.contrib:junit-theories:jar:4.11', QUICKCHECK
>
> Please note that in eclipse there is no such issue, so I suspect the
> idea plugin here.
>
> --
> Jean-Philippe Caruana
> http://www.barreverte.fr
Re: junit conflict in idea
Posted by Peter Donald <pe...@realityforge.org>.
On Tue, Jul 29, 2014 at 12:54 AM, Jean-Philippe Caruana
<jp...@target2sell.com> wrote:
> What's wrong with my buildfile ? I don't do anything special with these
> 2 projects (a and b) : the difference is they are both webapps... Any idea ?
If you can show me a small example that exhibits this behaviour then I
can probably figure it out. But I am not sure there is enough info to
immediately pick it.
> Wouldn't it be great just to default junit to the 4.11 version in the
> next buildr version ?
Sounds like a plan.
--
Cheers,
Peter Donald
Re: junit conflict in idea
Posted by Jean-Philippe Caruana <jp...@target2sell.com>.
Hi,
I still have junit version issues. Either setting
Buildr.settings.build['junit'] to '4.11' or creating a build.yaml file
doesn't work :
$ find -name "*.iml" -exec grep -H "4\.8\.2" {} \;
./a/a.iml: <root
url="jar://$M2_REPO$/junit/junit/4.8.2/junit-4.8.2.jar!/" />
./b/b.iml: <root
url="jar://$M2_REPO$/junit/junit/4.8.2/junit-4.8.2-sources.jar!/" />
I have the issue on 2 of my 11 modules...
What's wrong with my buildfile ? I don't do anything special with these
2 projects (a and b) : the difference is they are both webapps... Any idea ?
$ buildr --version
Buildr 1.4.19
Wouldn't it be great just to default junit to the 4.11 version in the
next buildr version ?
Thanks !
Le 03/03/2014 14:49, Jean-Philippe Caruana a écrit :
> Le 03/03/2014 14:36, Tammo van Lessen a écrit :
>> Hi Jean Philippe,
>>
>> If I'm not mistaken, adding the following line to the beginning of your
>> buildfile should help:
>>
>> Buildr.settings.build['junit'] = '4.11'
>>
>> In order to avoid conflicts, you can reference JUnit.dependencies instead
>> of your own JUNIT constant.
> I didn't know that ! Thanks !
> But I still have the issue, but my buildfile looks like this now :
>
> Buildr.settings.build['junit'] = '4.11'
> JUNIT = JUnit.dependencies, 'org.hamcrest:hamcrest-core:jar:1.3',
> 'com.github.stefanbirkner:system-rules:jar:1.4.0',
> 'org.junit.contrib:junit-theories:jar:4.11', QUICKCHECK
>
> Please note that in eclipse there is no such issue, so I suspect the
> idea plugin here.
>
--
Jean-Philippe Caruana
http://www.barreverte.fr
Re: junit conflict in idea
Posted by Jean-Philippe Caruana <jp...@target2sell.com>.
Le 03/03/2014 14:36, Tammo van Lessen a écrit :
> Hi Jean Philippe,
>
> If I'm not mistaken, adding the following line to the beginning of your
> buildfile should help:
>
> Buildr.settings.build['junit'] = '4.11'
>
> In order to avoid conflicts, you can reference JUnit.dependencies instead
> of your own JUNIT constant.
I didn't know that ! Thanks !
But I still have the issue, but my buildfile looks like this now :
Buildr.settings.build['junit'] = '4.11'
JUNIT = JUnit.dependencies, 'org.hamcrest:hamcrest-core:jar:1.3',
'com.github.stefanbirkner:system-rules:jar:1.4.0',
'org.junit.contrib:junit-theories:jar:4.11', QUICKCHECK
Please note that in eclipse there is no such issue, so I suspect the
idea plugin here.
--
Jean-Philippe Caruana
http://www.barreverte.fr
Re: junit conflict in idea
Posted by Tammo van Lessen <tv...@gmail.com>.
Hi Jean Philippe,
If I'm not mistaken, adding the following line to the beginning of your
buildfile should help:
Buildr.settings.build['junit'] = '4.11'
In order to avoid conflicts, you can reference JUnit.dependencies instead
of your own JUNIT constant.
HTH,
Tammo
On Mon, Mar 3, 2014 at 2:16 PM, Jean-Philippe Caruana <jp...@target2sell.com>wrote:
> Hi,
>
> I'm using Buildr 1.4.15 and I have junit conflict in my idea files : I
> see two version of junit :
> - 4.8.2 (that "ships" with buildr)
> - 4.11 (last version I use)
>
> My buildfile looks like this:
>
> JUNIT = 'junit:junit:jar:4.11'
> define 'common' do
> compile.with LOG4J
> test.compile.with JUNIT
> package :jar
> end
>
>
> My project iml file looks like this :
> <orderEntry type="module-library" exported="">
> <library>
> <CLASSES>
> <root url="jar://$M2_REPO$/junit/junit/4.8.2/junit-4.8.2.jar!/"
> />
> </CLASSES>
> <JAVADOC />
> <SOURCES>
> <root
> url="jar://$M2_REPO$/junit/junit/4.8.2/junit-4.8.2-sources.jar!/" />
>
>
> </SOURCES>
> </library>
> </orderEntry>
>
> <orderEntry type="module-library" scope="TEST">
> <library>
> <CLASSES>
> <root url="jar://$M2_REPO$/junit/junit/4.11/junit-4.11.jar!/"
> />
>
> </CLASSES>
> <JAVADOC />
> <SOURCES>
> <root
> url="jar://$M2_REPO$/junit/junit/4.11/junit-4.11-sources.jar!/" />
> </SOURCES>
> </library>
> </orderEntry>
>
>
>
> I have two questions :
> - how can I tell buildr to ignore junit 4.8.2 version when I want
> another one (hene 4.11) ?
> - maybe the 4.11 shound be junit default version ?
>
> Thanks
> --
> Jean-Philippe Caruana - jp@target2sell.com
> http://www.barreverte.fr
>
--
Tammo van Lessen - http://www.taval.de
Re: junit conflict in idea
Posted by Jean-Philippe Caruana <jp...@target2sell.com>.
Le 03/03/2014 14:16, Jean-Philippe Caruana a écrit :
> I'm using Buildr 1.4.15 and I have junit conflict in my idea files
> : I see two version of junit : - 4.8.2 (that "ships" with buildr) -
> 4.11 (last version I use)
in eclipse, .classpath is okay : there is only one junit dependancy.
<classpathentry kind="var"
path="M2_REPO/junit/junit/4.11/junit-4.11.jar"
sourcepath="M2_REPO/junit/junit/4.11/junit-4.11-sources.jar"
javadocpath="M2_REPO/junit/junit/4.11/junit-4.11-javadoc.jar"/>
--
Jean-Philippe Caruana
http://www.barreverte.fr