You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Santonian <re...@guidecom.de> on 2007/04/16 17:06:49 UTC

Core Module - Customer spcific Module. How to set up in Maven2?

Hello there,

I am working with maven some time now but have not the most experince with
the configuartion of it. 
I have the following problem to solve and I dont know exactly how to do it.
I read about project inheritance, but I am not sure if thats the right thing
for me.

This is what I am trying to achive:

We have an application that mainly uses Spring MVC and Freemarker. Rigth now
for each customer we have a seperate project because the requirements of
each customer are quite diffrent.

Now we want to refactor our application, so that we can have a core module
and an individual module for each customer. The individual modules must be
able to inherith classes of the core module. Changed made to the core module
should be reflected by all customer specific modules.

How can I do that? Is Project Inheritance the right thing for me? Can I have
the core part and the customer parts all in the same project or do I have to
have a seperate project for all customers?

Any tips and links are greatly apreciated.

cheers 
Santo
-- 
View this message in context: http://www.nabble.com/Core-Module---Customer-spcific-Module.-How-to-set-up-in-Maven2--tf3585040s177.html#a10017987
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Core Module - Customer spcific Module. How to set up in Maven2?

Posted by Maria Odea Ching <oc...@exist.com>.
Hmm.. I think you can include them in the jar file, but you might have 
to unpack the jar file if you're going to use or access these resources 
from
the projects that depend on the core module.

You might want to take a look at maven-dependency plugin, it has a goal 
for unpacking a project's dependency.

- Deng

Santonian wrote:
> Yes that idea crossed my mind too. But I didnt tried it yet. The core module
> will have a lot of template files, images, javascript and all that kind of
> files. Don't I have to build a jar out of it? I was under the impression
> that I can not store resources such as freemarker template files inside a
> jar. 
> I hope this is not a very dumb question... and somebody, or you Maria, can
> enlighten me a little more. 
>
> Thx so far, I'll try to check it out. But any more input is greatly
> apreciated.
>
> Santo.
>
>
> Maria Odea Ching-2 wrote:
>   
>> Hi Santonian,
>>
>> I don't think using project inheritance for the core module and the 
>> customer specific modules is the right way.
>> What I suggest is you can have the core module as a separate project and 
>> have each of the customer-specific modules as separate projects as well. 
>> Then just set the core module as a dependency of these customer-specific 
>> projects.
>>
>> Hope this helps! :-)
>>
>> Thanks,
>> Deng
>>
>> Santonian wrote:
>>     
>>> Hello there,
>>>
>>> I am working with maven some time now but have not the most experince
>>> with
>>> the configuartion of it. 
>>> I have the following problem to solve and I dont know exactly how to do
>>> it.
>>> I read about project inheritance, but I am not sure if thats the right
>>> thing
>>> for me.
>>>
>>> This is what I am trying to achive:
>>>
>>> We have an application that mainly uses Spring MVC and Freemarker. Rigth
>>> now
>>> for each customer we have a seperate project because the requirements of
>>> each customer are quite diffrent.
>>>
>>> Now we want to refactor our application, so that we can have a core
>>> module
>>> and an individual module for each customer. The individual modules must
>>> be
>>> able to inherith classes of the core module. Changed made to the core
>>> module
>>> should be reflected by all customer specific modules.
>>>
>>> How can I do that? Is Project Inheritance the right thing for me? Can I
>>> have
>>> the core part and the customer parts all in the same project or do I have
>>> to
>>> have a seperate project for all customers?
>>>
>>> Any tips and links are greatly apreciated.
>>>
>>> cheers 
>>> Santo
>>>   
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>>     
>
>   


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


Re: Core Module - Customer spcific Module. How to set up in Maven2?

Posted by Santonian <re...@guidecom.de>.
Hello,

ist tested the plugin you mentioned but I have some futher quetiones about
it that you might be able to answer. I tried to find documentation about the
plugin but I could not find anything except the page you linked in your last
post. 
Anyway, this is my setup right now, maybe you (or anyone else who knows that
plugin) can take a look at it.

I have a Core Project where I included the plugin in the pom like this:

      <plugin>      
        <artifactId>maven-remote-resources-plugin</artifactId>        
        <configuration>
		   <resourcesDirectory>src/main/webapp</resourcesDirectory>
	       <includes>
	          <include>**/*</include>
	        </includes>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>bundle</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

I included the whole wepapp directory because I have several files that are
equal for all customer project files. (Freemarker Templates, Gifs, Jpes, css
files, etc.) When I build the project with the „JAR“ goal I get a
remote-resources.xml file that looks like this:

  <?xml version="1.0" encoding="UTF-8" ?> 
- <remoteResourcesBundle>
- <remoteResources>
  <remoteResource>css/style.css</remoteResource> 
  <remoteResource>img/buttons/absenden.gif</remoteResource>

….

I think this is correct so far. Now I have an other project, the customer
specific project wich includes the jar of my core project. It also has this
plugin setup inside the pom.xml

      <plugin>
        <artifactId>maven-remote-resources-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>process</goal>
            </goals>
            <configuration>
              <resourceBundles>
<!--                
<resourceBundle>org.apache:apache-jar-resource-bundle:1.0</resourceBundle>
-->
               
<resourceBundle>MyCompany:MyCoreProject:0.0.1</resourceBundle>
              </resourceBundles>
		        <outputDirectory>src/main/webapp/</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

I am not sure if I understood it corectly. First I tried without the ouput
directory configuration. But the resulting war archive has my files in the
/WEB-INF/classes directory. I know the documentation said that they will be
in the classes directory, but thats not where I need them. I need the files
in the Root directory. Thats why I experimented with the output directory.
That will put my files in the src/main/webapp direcotry (which is my root
after I created my war archive) Additionally I  have my files in the
/WEB-INF/classes directory. 
That seems not quite right to me. 
Did I misunterstand something, or maybee all?

Hopefully you, or someone, can help me with this issue.

Cheers
Santo.


franz see wrote:
> 
> Good day,
> 
> You may want to use maven-remote-resources-plugin. You use the bundle goal
> on the project that contains those files to generate a manifest file (
> META-INF/maven/remote-resources.xml ) which would contain the list of
> files in your jar that are "extractable". Then you use the process goal on
> the project using your "bundled" project to "extract" the files ( see [1]
> for more info )
> 
> Cheers,
> Franz
> 
> [1] http://maven.apache.org/plugins/maven-remote-resources-plugin
> 
> 
> Santonian wrote:
>> 
>> Yes that idea crossed my mind too. But I didnt tried it yet. The core
>> module will have a lot of template files, images, javascript and all that
>> kind of files. Don't I have to build a jar out of it? I was under the
>> impression that I can not store resources such as freemarker template
>> files inside a jar. 
>> I hope this is not a very dumb question... and somebody, or you Maria,
>> can enlighten me a little more. 
>> 
>> Thx so far, I'll try to check it out. But any more input is greatly
>> apreciated.
>> 
>> Santo.
>> 
>> 
>> Maria Odea Ching-2 wrote:
>>> 
>>> Hi Santonian,
>>> 
>>> I don't think using project inheritance for the core module and the 
>>> customer specific modules is the right way.
>>> What I suggest is you can have the core module as a separate project and 
>>> have each of the customer-specific modules as separate projects as well. 
>>> Then just set the core module as a dependency of these customer-specific 
>>> projects.
>>> 
>>> Hope this helps! :-)
>>> 
>>> Thanks,
>>> Deng
>>> 
>>> Santonian wrote:
>>>> Hello there,
>>>>
>>>> I am working with maven some time now but have not the most experince
>>>> with
>>>> the configuartion of it. 
>>>> I have the following problem to solve and I dont know exactly how to do
>>>> it.
>>>> I read about project inheritance, but I am not sure if thats the right
>>>> thing
>>>> for me.
>>>>
>>>> This is what I am trying to achive:
>>>>
>>>> We have an application that mainly uses Spring MVC and Freemarker.
>>>> Rigth now
>>>> for each customer we have a seperate project because the requirements
>>>> of
>>>> each customer are quite diffrent.
>>>>
>>>> Now we want to refactor our application, so that we can have a core
>>>> module
>>>> and an individual module for each customer. The individual modules must
>>>> be
>>>> able to inherith classes of the core module. Changed made to the core
>>>> module
>>>> should be reflected by all customer specific modules.
>>>>
>>>> How can I do that? Is Project Inheritance the right thing for me? Can I
>>>> have
>>>> the core part and the customer parts all in the same project or do I
>>>> have to
>>>> have a seperate project for all customers?
>>>>
>>>> Any tips and links are greatly apreciated.
>>>>
>>>> cheers 
>>>> Santo
>>>>   
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Core-Module---Customer-spcific-Module.-How-to-set-up-in-Maven2--tf3585040s177.html#a10287289
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Core Module - Customer spcific Module. How to set up in Maven2?

Posted by franz see <fr...@gmail.com>.
Good day,

You may want to use maven-remote-resources-plugin. You use the bundle goal
on the project that contains those files to generate a manifest file (
META-INF/maven/remote-resources.xml ) which would contain the list of files
in your jar that are "extractable". Then you use the process goal on the
project using your "bundled" project to "extract" the files ( see [1] for
more info )

Cheers,
Franz

[1] http://maven.apache.org/plugins/maven-remote-resources-plugin


Santonian wrote:
> 
> Yes that idea crossed my mind too. But I didnt tried it yet. The core
> module will have a lot of template files, images, javascript and all that
> kind of files. Don't I have to build a jar out of it? I was under the
> impression that I can not store resources such as freemarker template
> files inside a jar. 
> I hope this is not a very dumb question... and somebody, or you Maria, can
> enlighten me a little more. 
> 
> Thx so far, I'll try to check it out. But any more input is greatly
> apreciated.
> 
> Santo.
> 
> 
> Maria Odea Ching-2 wrote:
>> 
>> Hi Santonian,
>> 
>> I don't think using project inheritance for the core module and the 
>> customer specific modules is the right way.
>> What I suggest is you can have the core module as a separate project and 
>> have each of the customer-specific modules as separate projects as well. 
>> Then just set the core module as a dependency of these customer-specific 
>> projects.
>> 
>> Hope this helps! :-)
>> 
>> Thanks,
>> Deng
>> 
>> Santonian wrote:
>>> Hello there,
>>>
>>> I am working with maven some time now but have not the most experince
>>> with
>>> the configuartion of it. 
>>> I have the following problem to solve and I dont know exactly how to do
>>> it.
>>> I read about project inheritance, but I am not sure if thats the right
>>> thing
>>> for me.
>>>
>>> This is what I am trying to achive:
>>>
>>> We have an application that mainly uses Spring MVC and Freemarker. Rigth
>>> now
>>> for each customer we have a seperate project because the requirements of
>>> each customer are quite diffrent.
>>>
>>> Now we want to refactor our application, so that we can have a core
>>> module
>>> and an individual module for each customer. The individual modules must
>>> be
>>> able to inherith classes of the core module. Changed made to the core
>>> module
>>> should be reflected by all customer specific modules.
>>>
>>> How can I do that? Is Project Inheritance the right thing for me? Can I
>>> have
>>> the core part and the customer parts all in the same project or do I
>>> have to
>>> have a seperate project for all customers?
>>>
>>> Any tips and links are greatly apreciated.
>>>
>>> cheers 
>>> Santo
>>>   
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Core-Module---Customer-spcific-Module.-How-to-set-up-in-Maven2--tf3585040s177.html#a10033136
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Core Module - Customer spcific Module. How to set up in Maven2?

Posted by Santonian <re...@guidecom.de>.
Yes that idea crossed my mind too. But I didnt tried it yet. The core module
will have a lot of template files, images, javascript and all that kind of
files. Don't I have to build a jar out of it? I was under the impression
that I can not store resources such as freemarker template files inside a
jar. 
I hope this is not a very dumb question... and somebody, or you Maria, can
enlighten me a little more. 

Thx so far, I'll try to check it out. But any more input is greatly
apreciated.

Santo.


Maria Odea Ching-2 wrote:
> 
> Hi Santonian,
> 
> I don't think using project inheritance for the core module and the 
> customer specific modules is the right way.
> What I suggest is you can have the core module as a separate project and 
> have each of the customer-specific modules as separate projects as well. 
> Then just set the core module as a dependency of these customer-specific 
> projects.
> 
> Hope this helps! :-)
> 
> Thanks,
> Deng
> 
> Santonian wrote:
>> Hello there,
>>
>> I am working with maven some time now but have not the most experince
>> with
>> the configuartion of it. 
>> I have the following problem to solve and I dont know exactly how to do
>> it.
>> I read about project inheritance, but I am not sure if thats the right
>> thing
>> for me.
>>
>> This is what I am trying to achive:
>>
>> We have an application that mainly uses Spring MVC and Freemarker. Rigth
>> now
>> for each customer we have a seperate project because the requirements of
>> each customer are quite diffrent.
>>
>> Now we want to refactor our application, so that we can have a core
>> module
>> and an individual module for each customer. The individual modules must
>> be
>> able to inherith classes of the core module. Changed made to the core
>> module
>> should be reflected by all customer specific modules.
>>
>> How can I do that? Is Project Inheritance the right thing for me? Can I
>> have
>> the core part and the customer parts all in the same project or do I have
>> to
>> have a seperate project for all customers?
>>
>> Any tips and links are greatly apreciated.
>>
>> cheers 
>> Santo
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Core-Module---Customer-spcific-Module.-How-to-set-up-in-Maven2--tf3585040s177.html#a10031435
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Core Module - Customer spcific Module. How to set up in Maven2?

Posted by Maria Odea Ching <oc...@exist.com>.
Hi Santonian,

I don't think using project inheritance for the core module and the 
customer specific modules is the right way.
What I suggest is you can have the core module as a separate project and 
have each of the customer-specific modules as separate projects as well. 
Then just set the core module as a dependency of these customer-specific 
projects.

Hope this helps! :-)

Thanks,
Deng

Santonian wrote:
> Hello there,
>
> I am working with maven some time now but have not the most experince with
> the configuartion of it. 
> I have the following problem to solve and I dont know exactly how to do it.
> I read about project inheritance, but I am not sure if thats the right thing
> for me.
>
> This is what I am trying to achive:
>
> We have an application that mainly uses Spring MVC and Freemarker. Rigth now
> for each customer we have a seperate project because the requirements of
> each customer are quite diffrent.
>
> Now we want to refactor our application, so that we can have a core module
> and an individual module for each customer. The individual modules must be
> able to inherith classes of the core module. Changed made to the core module
> should be reflected by all customer specific modules.
>
> How can I do that? Is Project Inheritance the right thing for me? Can I have
> the core part and the customer parts all in the same project or do I have to
> have a seperate project for all customers?
>
> Any tips and links are greatly apreciated.
>
> cheers 
> Santo
>   


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