Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Test claspath in Eclipse x Maven CLI

>> 
>> I understand what you want to do, but I want to understand why you want
>> to do it. Do you have a real-life example where you'd need to switch
>> between runtime and test scope for a main class?
> 
> To basically debug/rule-out classpath problems with use of eclipse directly instead of via maven.
> 

Thought a bit more about specific usecases and bump into one yesterday.

Arquillian uses profiles to include/exclude the proper dependencies for the different server containers they support.

Now this currently requires users to go into eclipse properties and switch the whole project to use that profile/classpath
but what they want most of the time is just to run the tests with that specific classpath.

Thus you could have a junit test run setup to run with the m2e classpath for profile=glassfish/scope=test and another profile=as7/scope=test,provided

Allowing you to easily run these without waiting for a full compile because I changed the classpath set...

Makes sense?

/max

> /max
> 
>> 
>>> 
>>> -max
>>> 
>>>> 
>>>> I think for tests we have to use test scope to make sure results are
>>>> comparable to command line build. So this leaves application main class
>>>> launches, and I can't think of a scenario when using different scope
>>>> would be required.
>>>> 
>>>> --
>>>> Regards,
>>>> Igor
>>>> 
>>>> On 11-07-12 6:14 PM, Max Rydahl Andersen wrote:
>>>>> On the topic of classpath's in m2e - is there a reason why the maven classpath container does not
>>>>> have an option to select which scope one wants for a specific launch?
>>>>> 
>>>>> /max
>>>>> 
>>>>> On Jul 7, 2011, at 01:25, Igor Fedorenko wrote:
>>>>> 
>>>>>> Expected runtime classpath is documented in [1]. If this does not match
>>>>>> observed behaviour when using clean m2e 1.0 install, please open a
>>>>>> bugreport and provide sample project and steps to reproduce the problem.
>>>>>> 
>>>>>> [1] https://docs.sonatype.org/display/M2ECLIPSE/Runtime+classpath
>>>>>> 
>>>>>> --
>>>>>> Regards,
>>>>>> Igor
>>>>>> 
>>>>>> On 11-07-07 1:17 AM, Daniel Serodio (lists) wrote:
>>>>>>> How can I use the same test classpath both for running JUnit tests from
>>>>>>> within Eclipse and for running "mvn test" from the commandline?
>>>>>>> 
>>>>>>> Currently, when I run JUnit tests from Eclipse it loads resources from
>>>>>>> src/main/resources instead of src/test/resources.
>>>>>>> 
>>>>>>> I'm using Maven 2.2.1, Eclipse 3.6.2 and m2e 0.12
>>>>>>> 
>>>>>>> Thanks in advance,
>>>>>>> Daniel Serodio
>>>>>>> _______________________________________________
>>>>>>> m2e-users mailing list
>>>>>>> m2e-users@xxxxxxxxxxx
>>>>>>> https://dev.eclipse.org/mailman/listinfo/m2e-users
>>>>>> _______________________________________________
>>>>>> m2e-users mailing list
>>>>>> m2e-users@xxxxxxxxxxx
>>>>>> https://dev.eclipse.org/mailman/listinfo/m2e-users
>>>>> 
>>>>> /max
>>>>> http://about.me/maxandersen
>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> m2e-users mailing list
>>>>> m2e-users@xxxxxxxxxxx
>>>>> https://dev.eclipse.org/mailman/listinfo/m2e-users
>>>> _______________________________________________
>>>> m2e-users mailing list
>>>> m2e-users@xxxxxxxxxxx
>>>> https://dev.eclipse.org/mailman/listinfo/m2e-users
>>> 
>>> /max
>>> http://about.me/maxandersen
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> m2e-users mailing list
>>> m2e-users@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/m2e-users
>> _______________________________________________
>> m2e-users mailing list
>> m2e-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/m2e-users
> 
> /max
> http://about.me/maxandersen
> 
> 
> 
> _______________________________________________
> m2e-users mailing list
> m2e-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/m2e-users

/max
http://about.me/maxandersen





Back to the top