views:

19

answers:

1

I have an application consisting of many scripts doing some stuff on their own. I want to modify it's structure using Maven for PHP with multiple modules, a common module and a lot of client modules depending on the common one. I use the PHPUnit for testing and I run the tests from maven with "mvn test". So when running the tests maven includes the common module paths and the src/main/php paths. The problem is that I don't know how to run the scripts now, because for testing purposes I have to rely on the fact that Maven includes the needed module paths so I can include files relative to the root of my module src dir.

Is there any way of dealing with this? Should I use a .bat file which includes the paths to all my modules to run the scripts?

A: 

I think the only solutions are: - use a single maven module for all the sources so the resulting jar will have the structure you want. - use a shell script to run your php scripts after you mix all module jars in one folder. The shell should then be something like this: php -d include_path="all the paths to all your src modules" "script_name and arguments". The script name and the arguments will be the ones you will provide when calling the shell script.

Softy