Hi Igor

Thank you very much for your reply! 
I do understand, that tycho/maven is not able to resolve dependency on
moduleA if I run "mvn test" on moduleB. But this, however, does not explain
why I get a NullPointerException running the test on the parent project.
Isn't "mvn org.codehaus.tycho:maven-osgi-test-plugin:test" supposed to
function the same way "mvn test" does, except that the latter is not aware
of OSGI? 

Regards
 Sandro


Igor Fedorenko-4 wrote:
> 
> Sandro,
> 
> This behaviour is not specific to tycho, this is how maven works. 
> Consider the following project
> 
> parent/
>   moduleA/
>   moduleB/ depends on moduleA
> 
> If you run "mvn test" on parent project (this is called "reactor build", 
> if I am not mistaken) maven will resolve inter-module dependency inside 
> the build. If, however, you run "mvn test" on moduleB project, then 
> maven will use local or remote repositories to resolve dependency on 
> moduleA.
> 
> It is possible to run tests independently using profiles, but it 
> requires some configuration. Specifically, you can define "production" 
> and "test" profiles, that only includes production and test projects 
> respectively. Then you can run "mvn install -Pproduction" to build 
> production projects and install build results into local repository. 
> "mvn test -Ptest" will let you just run the tests. And "mvn test 
> -Pproduction,test" will let do build/test in one shot.
> 
> Note that in case of tycho, "test" profile will have to have target 
> platform specification that includes bundles/features produced in 
> "production" profile.
> 
> Hope this helps.
> 
> --
> Regards,
> Igor
> 
> 
> Lupone wrote:
>> Hi
>> 
>> I just found out that when performing mvn install the tests are run
>> successfully! Quite astonishing, isn't it? But I still need to know, how
>> I
>> can run the tests without going through the entire maven lifecycle, since
>> I'd like to trigger the tests independently from the build.
>> 
>> Thanks in adavance.
>> 
>> Regards
>>  Sandro
>> 
>> 
>> 
>> Lupone wrote:
>>> Hi all
>>>
>>> I've got two eclipse-plugin projects: plugin1 and plugin1.test. The
>>> latter
>>> is obviously in charge of testing plugin1. In order to be able to test
>>> plugin1 plugin1.test has been configured to have a dependency on
>>> plugin1.
>>> Both project-folders are in the same parent-directory. Using mvn
>>> org.codehaus.tycho:maven-tycho-plugin:generate-poms in this directory I
>>> had the parent-pom file as well as the pom-file for the two projects
>>> generated. Running a build in this parent directory works smoothly. But
>>> when I try to run the osgi-test using mvn
>>> org.codehaus.tycho:maven-osgi-test-plugin:test the test is not performed
>>> due to a NullPointerException at
>>> org.codehaus.tycho.osgitools.OsgiStateController.getUserProperty(OsgiStateController.java:511)
>>>
>>> Note that I've changed the package-type in the pom-file of the
>>> plugin1.test project from eclipse-plugin to eclipse-test-plugin. I also
>>> made sure that I first built the package and then run the test. If I try
>>> to run the test in the project-folder of plugin1.test it fails claiming
>>> that there is a unresolved bundle-dependency to plugin1, which indeed is
>>> correct.
>>>
>>> You can test it by yourself using the projects found here 
>>> http://svn.sonatype.org/m2eclipse/tycho/trunk/tycho-its/projects/tycho98/
>>> http://svn.sonatype.org/m2eclipse/tycho/trunk/tycho-its/projects/tycho98/
>>> . It is exactly the same structure and results in the same error.
>>>
>>> I tested it using tycho distribution-0.3.0-DEV-1756.
>>>
>>> Am I doing something wrong, or is it a bug?
>>>
>>> Any help is highly appreciated!
>>>
>>> Thank you very much!
>>> Regards
>>>  Sandro
>>>
>>>
>>>
>>>
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Tycho%3A-Unable-to-run-osgi-tests-for-a-group-of-projects-tp20110642p20129960.html
Sent from the Maven Eclipse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to