Hello Tilman,

I am not an Maven expert. But I think I could help.

First at all, there is another way you may consider:
At my company we are using James 2.3.2, and we are just building own Mailets as 
a complete standalone project. 
It is just an "addon" to James.
After building our projects, we just put the "jar-files" into the james-lib 
directory and added it to the config.xml.
So we used to keep our deployment completely independent from James, and put 
our libs into a running James distribution.
So we do not need to use whatever build process is used inside James.

We currently did not switch to james3, so I do not know how we would act there, 
and even if it is possible.
If you try, please report how to do that.
So maybe you do not need the maven build process, just build and copy your 
jar-files.

Anyway, if you would like to make a "whole distribution" of James including 
your own part, you could do that.
But: your pom.xml will not match the pom.xml delivered by James, cause you need 
to add your modules.
When you do an update or replace of this file, your changes may be lost.
I would like to offer an example (but maybe there are other ways).

First: I wrote a paper on how to build James3 inside Eclipse using Maven.
This is the part where I am starting now, you could read it here:
http://blog.bonnydoonmedia.com/post.cfm/walkthrough-tutorials-compiling-apache-james-v3-with-eclipse
(Robert Munn has kindly offered it inside his blog).
But I think you already managed that part.

Next:
1. Create a "Maven Module" inside Eclipse.
2. Add it to the "james-server/pom.xml" as module and dependency. So your 
project will be compiled (not needed if you use the wizard), but not deployed.
3. Add it to the "james-server/app/pom.xml" as dependency. So your project will 
be deployed (bundled ,copied) to the lib dir.
4. Do an "Maven -> Update projects" to all projects.
5. Do an "Maven clean"
6. Do an "Maven install"
7. Refresh the james-server project
8. check james-server/app/target/james-server-app-3.0.0-beta5-SNAPSHOT-app.zip
The zip-file should contain your jar-file 
(intarsys-module-mailets-3.0.0-beta5-SNAPSHOT.jar) in the lib folder.

More details::
1. Create a project using the Eclipse "New Project Wizard":
New -> Maven Module: 
Name: intarsys-module-mailets
GroupID: org.apache.james
Version: 3.0.0-beta5-SNAPSHOT
Package: de.intarsys.module.mailets
(The wizards adds the project to the james-server/pom.xml)

3. Open the "james-server/app/pom.xml" and add a dependency.
Under "Dependenices -> Dependencies (left side).

Ok, there may be better ways.

-----Ursprüngliche Nachricht-----
Von: Tilman Ginzel [mailto:[email protected]] 
Gesendet: Donnerstag, 15. Januar 2015 20:16
An: [email protected]
Betreff: How to reference customized projects in pom.xml files?

Hey guys,

I am a computer science student from Germany and I am working with James for a 
couple of weeks now for a project.

My goal is to implement some code at the point where a user selects a 
mail-folder via any IMAP mail-client.
With some logging I was able to find all relevant subprojects and classes I 
need to work with (at least I think so).
I found out that these two classes are quiet important for that (among others):
- org.apache.james.imap.processor.AbstractSelectionProcessor;
- org.apache.james.mailbox.store.StoreMailboxManager;

I checked out the following projects from the apache james repos:
james-server
james-protocols
james-mailbox

I imported the maven projects into Eclipse and I am able to build all projects 
separately.
Now my problem: I am not able to correctly manipulate the dependencies in the 
pom.xml files to reference my local customized projects.
I found 58 pom.xml files in these three projects (with all
subprojects) and it is not really useful to simply trial and error tutorials I 
found on the web.

It would be great if I simply could build james-server and it would 
automatically build my custom james-protocols and james-mailbox projects. 
Unfortunatetly maven is quiet new for me and James is a fairly huge project 
with many dependencies.

I hope my question is understandable and it would be great if you could give me 
some hints.
If you need more information, I will try to explain the problem with more 
details.

Thanks in advance!
Tilman

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

Reply via email to