Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to build multi module structure with Maven for PHP?
    primarykey
    data
    text
    <p>I have to build an application using Maven for PHP that has multiple modules. The scenario in which the maven seems to not work is this: I have a common module and a client module depending on the first one. When doing "mvn test" on the client module which depends on the common module, the test fails to see the paths to the common module. Is there a flow in my build or this is just not possible?</p> <p>I attached my pom.xml files.</p> <p>pom.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;org.sample&lt;/groupId&gt; &lt;artifactId&gt;my-app_package&lt;/artifactId&gt; &lt;packaging&gt;pom&lt;/packaging&gt; &lt;name&gt;Sample PHP Maven multi module project&lt;/name&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;modules&gt; &lt;module&gt;common-module&lt;/module&gt; &lt;module&gt;client1-module&lt;/module&gt; &lt;/modules&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.phpmaven&lt;/groupId&gt; &lt;artifactId&gt;maven-php-plugin&lt;/artifactId&gt; &lt;extensions&gt;true&lt;/extensions&gt; &lt;version&gt;1.0&lt;/version&gt; &lt;configuration&gt; &lt;ignoreValidate&gt;true&lt;/ignoreValidate&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.phpunit&lt;/groupId&gt; &lt;artifactId&gt;phpunit5&lt;/artifactId&gt; &lt;version&gt;3.3.9&lt;/version&gt; &lt;scope&gt;test&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;reporting&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.phpmaven&lt;/groupId&gt; &lt;artifactId&gt;maven-php-plugin&lt;/artifactId&gt; &lt;version&gt;1.0&lt;/version&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-surefire-report-plugin&lt;/artifactId&gt; &lt;version&gt;2.4&lt;/version&gt; &lt;reportSets&gt; &lt;reportSet&gt; &lt;reports&gt; &lt;report&gt;report-only&lt;/report&gt; &lt;/reports&gt; &lt;/reportSet&gt; &lt;/reportSets&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/reporting&gt; &lt;/project&gt; </code></pre> <p>common-module/pom.xml</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;org.sample&lt;/groupId&gt; &lt;artifactId&gt;my-app&lt;/artifactId&gt; &lt;packaging&gt;php&lt;/packaging&gt; &lt;name&gt;Client1 module&lt;/name&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.phpmaven&lt;/groupId&gt; &lt;artifactId&gt;maven-php-plugin&lt;/artifactId&gt; &lt;extensions&gt;true&lt;/extensions&gt; &lt;version&gt;1.0&lt;/version&gt; &lt;configuration&gt; &lt;ignoreValidate&gt;true&lt;/ignoreValidate&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.sample&lt;/groupId&gt; &lt;artifactId&gt;common-module&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.phpunit&lt;/groupId&gt; &lt;artifactId&gt;phpunit5&lt;/artifactId&gt; &lt;version&gt;3.3.9&lt;/version&gt; &lt;scope&gt;test&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/project&gt; </code></pre> <p>common-module/pom.xml</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;org.sample&lt;/groupId&gt; &lt;artifactId&gt;common-module&lt;/artifactId&gt; &lt;packaging&gt;php&lt;/packaging&gt; &lt;name&gt;Common module&lt;/name&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.phpmaven&lt;/groupId&gt; &lt;artifactId&gt;maven-php-plugin&lt;/artifactId&gt; &lt;extensions&gt;true&lt;/extensions&gt; &lt;version&gt;1.0&lt;/version&gt; &lt;configuration&gt; &lt;ignoreValidate&gt;true&lt;/ignoreValidate&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.phpunit&lt;/groupId&gt; &lt;artifactId&gt;phpunit5&lt;/artifactId&gt; &lt;version&gt;3.3.9&lt;/version&gt; &lt;scope&gt;test&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/project&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload