Hello,

I have a maven project with different profiles, and I would like it to have
several modules.

One "core" module would take care of the Dao and Service layer, while
another "view" module would take care of the Presentation layer.

I have a working set of pom.xml files for the parent project and the one
child "core" module.

Before adding the other "view" module, I would like to know how I can move
some of the content of a profile from the parent pom.xml file into the
pom.xml file of the "core" module.

Here is the parent pom.xml file content (not all of it):

<project xmlns="http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.thalasoft</groupId>
        <artifactId>learnintouch</artifactId>
        <packaging>pom</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>learnintouch</name>
        <url>http://www.thalasoft.com</url>
        <modules>
                <module>core</module>
        </modules>
        <properties>
                <spring.core.version>2.5.6</spring.core.version>
                <hibernate.version>3.6.0.Final</hibernate.version>
                <test.source.dir>src/test/java</test.source.dir>
        </properties>
        <build>
                <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <configuration>
                                        <source>1.6</source>
                                        <target>1.6</target>
                                        <encoding>UTF-8</encoding>
                                </configuration>
                        </plugin>
                  <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>1.0-beta-2</version>
                  </plugin>
                </plugins>
    <testSourceDirectory>
      ${test.source.dir}
    </testSourceDirectory>
        </build>
  <profiles>
    <profile>
      <id>mysql-test</id>
      <properties>
        <test.source.dir>src/integration/java</test.source.dir>
      </properties>
      <build>
        <filters>
          <filter>src/main/filters/data-source.properties</filter>
        </filters>
        <resources>
        <resource>
          <directory>src/integration/resources</directory>
          <filtering>true</filtering>
        </resource>
        </resources>
      </build>
    </profile>
  </profiles>
...
</project>

Here is the pom.xml file of the "core" module:

<project xmlns="http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.thalasoft.learnintouch</groupId>
        <artifactId>learnintouch-core</artifactId>
        <packaging>jar</packaging>
        <name>learnintouch-core</name>
        <parent>
                <groupId>com.thalasoft</groupId>
                <artifactId>learnintouch</artifactId>
                <version>1.0-SNAPSHOT</version>
        </parent>
...
</project>

Now, you can see some Dao specific setup in the parent pom.xml file, like a
data-source.properties file for example.

This should not be present in the other "view" module that will handle the
Presentation.

How to have this setup moved into the existing "core" module ?

Thanks.

Stephane

--
View this message in context: 
http://maven.40175.n5.nabble.com/Multi-modules-and-profiles-tp4732786p4732786.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to