You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "laudio.info" <la...@gmail.com> on 2013/02/11 21:10:52 UTC

mutiproject and conf resources (SOS)

Hello

i am with this problem several days and i don't solve it and in this
momento i don't know what can i make.

i have one maven multiproject (using maven 3.0) with this structure:
parent
 |-module1Classes
 |-module2EJB
 |-module3BO
 |-module4War

Only the module 1 (module1Classes) has one conf directory (confdir) and
inside there are the conf files (properties and xml files)
 when i install the projects into the EJB project (jar file) or into the
War project doesn't package the conf directory; inside the jar or war
does't appears the conf directory with these files.

 the parent has this pom file:

 .........
 <build>
  <resources>
   <resource>
    <directory>${basedir}</directory>
    <includes>
     <include>confdir/**/*.*</include>
    </includes>
    <filtering>false</filtering>
   </resource>
  </resources>
  <plugins>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
     <source>1.6</source>
     <target>1.6</target>
     <encoding>Cp1252</encoding>
    </configuration>
   </plugin>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-source-plugin</artifactId>
    <executions>
     <execution>
      <goals>
       <goal>jar</goal>
      </goals>
     </execution>
    </executions>
   </plugin>
  </plugins>
 </build>
 <modules>
  <module>../module1Classes</module>
  <module>../module2EJB</module>
  <module>../module3BO</module>
  <module>../module4War</module>
 </modules>
 <dependencies>
 ...........
 </dependencies>
</project>
the rest of the projects (the war for example) have theirs pom file with
this:
.......
 <parent>
  <groupId>com.parent</groupId>
  <artifactId>parent</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <relativePath>../parent/pom.xml</relativePath>
 </parent>
 <properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 </properties>
 <build>
  <plugins>
   <plugin>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.3</version>
    <configuration><!--
     <warSourceDirectory>WebRoot</warSourceDirectory> -->
     <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
     <archive>
               <manifest>
                  <addClasspath>true</addClasspath>
                  <classpathPrefix>lib/</classpathPrefix>
               </manifest>
             </archive>
    </configuration>
   </plugin>
  </plugins>
 </build>
</project>

when, from the parent project, i make one install only the module1Classes
project (jar file) has inside the conffiles.
can you help me for configuring maven for including into the rest of the
modules (war, EJB, BO...) the conf dir and their files?
thnaks

Re: mutiproject and conf resources (SOS)

Posted by "laudio.info" <la...@gmail.com>.
i have copy the confdir file (inside are the conf files) into the
src/main/resources.
i have one install and don't appears the confdir into the war file and
don't appears into the ejb jar file.
mus i chage the pom file?
now into the pomfile there is this:
<resource>
<directory>${basedir}</directory>
<includes>
<include>confdir/**/*.*</include>
</includes>
<filtering>false</filtering>
</resource>
thanks

Re: mutiproject and conf resources (SOS)

Posted by Baptiste MATHUS <ml...@batmat.net>.
Where did you put the confdir directory exactly?

Just put it inside src/main/resources directory (as is the code inside
src/main/java).
Then it should just work.

Cheers


2013/2/11 laudio.info <la...@gmail.com>

> Hello
>
> i am with this problem several days and i don't solve it and in this
> momento i don't know what can i make.
>
> i have one maven multiproject (using maven 3.0) with this structure:
> parent
>  |-module1Classes
>  |-module2EJB
>  |-module3BO
>  |-module4War
>
> Only the module 1 (module1Classes) has one conf directory (confdir) and
> inside there are the conf files (properties and xml files)
>  when i install the projects into the EJB project (jar file) or into the
> War project doesn't package the conf directory; inside the jar or war
> does't appears the conf directory with these files.
>
>  the parent has this pom file:
>
>  .........
>  <build>
>   <resources>
>    <resource>
>     <directory>${basedir}</directory>
>     <includes>
>      <include>confdir/**/*.*</include>
>     </includes>
>     <filtering>false</filtering>
>    </resource>
>   </resources>
>   <plugins>
>    <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <configuration>
>      <source>1.6</source>
>      <target>1.6</target>
>      <encoding>Cp1252</encoding>
>     </configuration>
>    </plugin>
>    <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-source-plugin</artifactId>
>     <executions>
>      <execution>
>       <goals>
>        <goal>jar</goal>
>       </goals>
>      </execution>
>     </executions>
>    </plugin>
>   </plugins>
>  </build>
>  <modules>
>   <module>../module1Classes</module>
>   <module>../module2EJB</module>
>   <module>../module3BO</module>
>   <module>../module4War</module>
>  </modules>
>  <dependencies>
>  ...........
>  </dependencies>
> </project>
> the rest of the projects (the war for example) have theirs pom file with
> this:
> .......
>  <parent>
>   <groupId>com.parent</groupId>
>   <artifactId>parent</artifactId>
>   <version>0.0.1-SNAPSHOT</version>
>   <relativePath>../parent/pom.xml</relativePath>
>  </parent>
>  <properties>
>   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>  </properties>
>  <build>
>   <plugins>
>    <plugin>
>     <artifactId>maven-war-plugin</artifactId>
>     <version>2.3</version>
>     <configuration><!--
>      <warSourceDirectory>WebRoot</warSourceDirectory> -->
>      <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
>      <archive>
>                <manifest>
>                   <addClasspath>true</addClasspath>
>                   <classpathPrefix>lib/</classpathPrefix>
>                </manifest>
>              </archive>
>     </configuration>
>    </plugin>
>   </plugins>
>  </build>
> </project>
>
> when, from the parent project, i make one install only the module1Classes
> project (jar file) has inside the conffiles.
> can you help me for configuring maven for including into the rest of the
> modules (war, EJB, BO...) the conf dir and their files?
> thnaks
>
> --
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor ! nbsp;!

Re: mutiproject and conf resources (SOS)

Posted by Ron Wheeler <rw...@artifact-software.com>.
Does module4War have a dependency declared telling maven that it needs 
Module1Classes?
If not maven has no reason to put the jar into the war.

Ron

On 11/02/2013 4:29 PM, laudio.info wrote:
> i think thar i not have explain  well
> into the module1 there one is one configdir 
> (/src/main/resources/confdir). here there is the configuracion for all 
> the projects (ejb project, war project, BO project, webservice 
> project.....) this is the log4j configuration and other properties 
> configuration for all the projects.
> i want to include this dir into each artifect. Into the war include 
> the configuration, into the ejb (jar file) include the configuration......
> is this posible?
> How
> thanks
>
> parent proyect (pom 0)
>   |-module1Classes
>   |-module2EJB
>   |-module3BO
>   |-module4War
>
> Only the module 1 (module1Classes) has one conf directory (confdir) and
> inside there are the conf files (properties and xml files)
>   when i install the projects into the EJB project (jar file) or into the
> War project doesn't package the conf directory; inside the jar or war
> does't appears the conf directory with these files.
>
>   the parent has this pom file (pom 0):
>
>   .........
>   <build>
>    <resources>
>     <resource>
>      <directory>${basedir}/src/main/resources/</directory>
>      <includes>
>       <include>confdir/**/*.*</include>
>      </includes>
>      <filtering>false</filtering>
>     </resource>
>    </resources>
>    <plugins>
>     <plugin>
>      <groupId>org.apache.maven.plugins</groupId>
>      <artifactId>maven-compiler-plugin</artifactId>
>      <configuration>
>       <source>1.6</source>
>       <target>1.6</target>
>       <encoding>Cp1252</encoding>
>      </configuration>
>     </plugin>
>     <plugin>
>      <groupId>org.apache.maven.plugins</groupId>
>      <artifactId>maven-source-plugin</artifactId>
>      <executions>
>       <execution>
>        <goals>
>         <goal>jar</goal>
>        </goals>
>       </execution>
>      </executions>
>     </plugin>
>    </plugins>
>   </build>
>   <modules>
>    <module>../module1Classes</module>
>    <module>../module2EJB</module>
>    <module>../module3BO</module>
>    <module>../module4War</module>
>   </modules>
>   <dependencies>
>   ...........
>   </dependencies>
> </project>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: mutiproject and conf resources (SOS)

Posted by "laudio.info" <la...@gmail.com>.
i think thar i not have explain  well
into the module1 there one is one configdir (/src/main/resources/confdir).
here there is the configuracion for all the projects (ejb project, war
project, BO project, webservice project.....) this is the log4j
configuration and other properties configuration for all the projects.

i want to include this dir into each artifect. Into the war include the
configuration, into the ejb (jar file) include the configuration......
is this posible?

How

thanks

parent proyect (pom 0)
  |-module1Classes
  |-module2EJB
  |-module3BO
  |-module4War

Only the module 1 (module1Classes) has one conf directory (confdir) and
inside there are the conf files (properties and xml files)
  when i install the projects into the EJB project (jar file) or into the
War project doesn't package the conf directory; inside the jar or war
does't appears the conf directory with these files.

  the parent has this pom file (pom 0):

  .........
  <build>
   <resources>
    <resource>
     <directory>${basedir}/src/main/resources/</**directory>
     <includes>
      <include>confdir/**/*.*</**include>
     </includes>
     <filtering>false</filtering>
    </resource>
   </resources>
   <plugins>
    <plugin>
     <groupId>org.apache.maven.**plugins</groupId>
     <artifactId>maven-compiler-**plugin</artifactId>
     <configuration>
      <source>1.6</source>
      <target>1.6</target>
      <encoding>Cp1252</encoding>
     </configuration>
    </plugin>
    <plugin>
     <groupId>org.apache.maven.**plugins</groupId>
     <artifactId>maven-source-**plugin</artifactId>
     <executions>
      <execution>
       <goals>
        <goal>jar</goal>
       </goals>
      </execution>
     </executions>
    </plugin>
   </plugins>
  </build>
  <modules>
   <module>../module1Classes</**module>
   <module>../module2EJB</module>
   <module>../module3BO</module>
   <module>../module4War</module>
  </modules>
  <dependencies>
  ...........
  </dependencies>
</project>

Re: mutiproject and conf resources (SOS)

Posted by Ron Wheeler <rw...@artifact-software.com>.
If module4War needs to have module1.jar, it needs a dependency on it.

Otherwise maven has no way to guess that there is any relationship 
between the two artifacts aside from being built together.



On 11/02/2013 3:10 PM, laudio.info wrote:
> Hello
>
> i am with this problem several days and i don't solve it and in this
> momento i don't know what can i make.
>
> i have one maven multiproject (using maven 3.0) with this structure:
> parent
>   |-module1Classes
>   |-module2EJB
>   |-module3BO
>   |-module4War
>
> Only the module 1 (module1Classes) has one conf directory (confdir) and
> inside there are the conf files (properties and xml files)
>   when i install the projects into the EJB project (jar file) or into the
> War project doesn't package the conf directory; inside the jar or war
> does't appears the conf directory with these files.
>
>   the parent has this pom file:
>
>   .........
>   <build>
>    <resources>
>     <resource>
>      <directory>${basedir}</directory>
>      <includes>
>       <include>confdir/**/*.*</include>
>      </includes>
>      <filtering>false</filtering>
>     </resource>
>    </resources>
>    <plugins>
>     <plugin>
>      <groupId>org.apache.maven.plugins</groupId>
>      <artifactId>maven-compiler-plugin</artifactId>
>      <configuration>
>       <source>1.6</source>
>       <target>1.6</target>
>       <encoding>Cp1252</encoding>
>      </configuration>
>     </plugin>
>     <plugin>
>      <groupId>org.apache.maven.plugins</groupId>
>      <artifactId>maven-source-plugin</artifactId>
>      <executions>
>       <execution>
>        <goals>
>         <goal>jar</goal>
>        </goals>
>       </execution>
>      </executions>
>     </plugin>
>    </plugins>
>   </build>
>   <modules>
>    <module>../module1Classes</module>
>    <module>../module2EJB</module>
>    <module>../module3BO</module>
>    <module>../module4War</module>
>   </modules>
>   <dependencies>
>   ...........
>   </dependencies>
> </project>
> the rest of the projects (the war for example) have theirs pom file with
> this:
> .......
>   <parent>
>    <groupId>com.parent</groupId>
>    <artifactId>parent</artifactId>
>    <version>0.0.1-SNAPSHOT</version>
>    <relativePath>../parent/pom.xml</relativePath>
>   </parent>
>   <properties>
>    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>   </properties>
>   <build>
>    <plugins>
>     <plugin>
>      <artifactId>maven-war-plugin</artifactId>
>      <version>2.3</version>
>      <configuration><!--
>       <warSourceDirectory>WebRoot</warSourceDirectory> -->
>       <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
>       <archive>
>                 <manifest>
>                    <addClasspath>true</addClasspath>
>                    <classpathPrefix>lib/</classpathPrefix>
>                 </manifest>
>               </archive>
>      </configuration>
>     </plugin>
>    </plugins>
>   </build>
> </project>
>
> when, from the parent project, i make one install only the module1Classes
> project (jar file) has inside the conffiles.
> can you help me for configuring maven for including into the rest of the
> modules (war, EJB, BO...) the conf dir and their files?
> thnaks
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org