我必须使用Maven for PHP创建一个具有多个模块的应用程序。 maven似乎无法正常工作的情况是这样的:我有一个通用模块和一个客户端模块,具体取决于第一个模块。 在依赖于公共模块的客户端模块上执行“mvn test”时,测试无法看到通用模块的路径。在我的构建中是否有流动,或者这是不可能的?是否可以使用Maven for PHP构建多模块结构?
我附加了我的pom.xml文件。
的pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.sample</groupId>
<artifactId>my-app_package</artifactId>
<packaging>pom</packaging>
<name>Sample PHP Maven multi module project</name>
<version>1.0-SNAPSHOT</version>
<modules>
<module>common-module</module>
<module>client1-module</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.phpmaven</groupId>
<artifactId>maven-php-plugin</artifactId>
<extensions>true</extensions>
<version>1.0</version>
<configuration>
<ignoreValidate>true</ignoreValidate>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.phpunit</groupId>
<artifactId>phpunit5</artifactId>
<version>3.3.9</version>
<scope>test</scope>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>org.phpmaven</groupId>
<artifactId>maven-php-plugin</artifactId>
<version>1.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.4</version>
<reportSets>
<reportSet>
<reports>
<report>report-only</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
</project>
通用模块/ pom.xml的
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.sample</groupId>
<artifactId>my-app</artifactId>
<packaging>php</packaging>
<name>Client1 module</name>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.phpmaven</groupId>
<artifactId>maven-php-plugin</artifactId>
<extensions>true</extensions>
<version>1.0</version>
<configuration>
<ignoreValidate>true</ignoreValidate>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.sample</groupId>
<artifactId>common-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.phpunit</groupId>
<artifactId>phpunit5</artifactId>
<version>3.3.9</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
通用模块/ pom.xml的
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.sample</groupId>
<artifactId>common-module</artifactId>
<packaging>php</packaging>
<name>Common module</name>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.phpmaven</groupId>
<artifactId>maven-php-plugin</artifactId>
<extensions>true</extensions>
<version>1.0</version>
<configuration>
<ignoreValidate>true</ignoreValidate>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.phpunit</groupId>
<artifactId>phpunit5</artifactId>
<version>3.3.9</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
显示POM可能会有帮助。 – khmarbaise 2010-05-04 10:33:50
我修改了问题并添加了pom.xml文件。希望你现在能更好地看待问题。 – Softy 2010-05-05 15:23:26