You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Igor A. Deruga" <in...@hotbox.ru> on 2005/05/26 22:11:40 UTC

Re: [m1][Newbie][GoodPractice] From Ant-RMI-Mulitproject to Maven

Hello, Christian!

I'm not really good at maven, so your question is really useful for me. 
I'll tell you the way me and my fellows did it. I'd like to know 
wheather it's right or wrong.

I did all the copy operations manually. Here's an example:

//----------------sample----------------
    <j:set var="jar.path" 
value="${maven.repo.local}/${reactorProject.artifactDirectory}/jars/${reactorProject.artifactId}-${reactorProject.currentVersion}.jar"/>
           <copy file="${jar.path}" todir="${tomcat.dir}/common/lib"/>
//----------------sample end----------------
(I think, you can do it in one line. It's just a sample from my maven.xml)

Here's how dependencies are being copied:

//----------------sample----------------
            <j:forEach var="dep" items="${pom.dependencies}">
                    <copy file="${pom.getDependencyPath(dep.getId())}"
                        todir="${tomcat.dir}/common/lib"/>
            </j:forEach>
//----------------sample end----------------

The way to do it all is to define <postGoal name="jar:install"> or 
something like that.

Hope this helps a little, but I'd like to hear the "official" answer too ;)

Sincerely
Igor

P.S.: I think that maven is really what you need... :)


Christian wrote:

>Hello 
>
>thanks for Maven. :-) I have always waited for something like this.
>
>As newbie, I have already installed a lokal repository and I am able to
>execute Maven from the comandline, e.g. andromeda examples work fine. I
>can build jars and execute them with "java -jar .....". I am mainly
>working alone, so in fact there is no need for me at the moment to do
>anything remotely. I know how to insert dependencies into project.xml. I
>have almost no experience with team-development. I used to work with cvs
>one day. So far. 
>
>#
>
>I have a ant-based project I am going to convert to Maven. I suffer
>heavy problems and I am getting a bit frustrated, as I don't know what
>is covered by the existing plugins, goals, properties and what actions
>have to be injected as ant-tasks manually into the goals.
>
>My old ant-script does the following via several tasks sequentially:
>
>Part I: Server
>a.) It compiles a selfmade (RMI-)applicationserver
>b.) It compiles stubs for the applicationserver.
>c.) It jars the Applicationserver into a buildServer directory
>d.) Start-scipts for (Windows/Linux) are copied  to the buildServer
>directory.
>
>Part II: Swing Client
>a.) Stubs and DataTransferObject.classes (of the AppServer) are copied
>to a directory branch of the client-build-directory.
>b.) The Client is compiled into another branch of the
>client-build-directory.
>c.) The client-build-directory is jared into client-deploy-directory
>d.) All external libraries are copied to "client-deploy-directory/lib"
>e.) Start-scripts (Windows/Linux) are copied to the
>client-deploy-directory
>
>After all this I can start the appServer and the client via commandline.
>The server does not have any dependencies except for junit but junit is
>not required during running.
>
>#
>
>Problems:
>
>Am I right, that I have to do all copy-actions for the Startscripts and
>the rmi-stub generation manually, i.e. do I have to create
>jelly-ant-scripts to be injected somewhere, as described in the
>maven-docoumentation? Is there an easier possibility to copy files to
>the right place in the target folders, i.e. just adding a copy-source
>and copy-destination property?
>
>If I run "maven dist -o" on the root of the client directory the goal
>says "build successful". Afterwards, my target directory is full of
>documentation but I miss my dependency-jar-files which are required to
>run the client. First, I would like to switch off the
>documentation-generation temporily. It's very nice but confuses me at
>the moment. Second, my depedendencies (i.e. the jar-file of the
>swing-framework I use) is not copied to anywhere. --- How can I copy the
>required dependency-jar-Files from the local repository to the target
>directory of the client? The distribution-plugin properties do not offer
>any possibilities to "include" dependencies. Shoud I write an
>Jelly-Ant-copy-script to copy the jar-files from the local repository to
>the target directory?  --- "maven dist-o" triggers "site:generate". Is
>there an easy way to tempoarily switch it off, i.e. a property setting.?
>
>
>At the moment I am very insecure, whether I use maven the right way. Do
>you have the impression I missunderstood the purpose of Maven?  Any
>recommendation how you would proced on my project are appreciated.
>
>Thanks for your response in advance.
>
>Christian
>
>
>
>
>
>
>
> 
>
>
>
>---------------------------------------------------------------------
>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


AW: [m1][Newbie][GoodPractice] From Ant-RMI-Mulitproject to Maven

Posted by Christian <ko...@gmx.de>.
Igor A. Deruga wrote:

| 
| Here's how dependencies are being copied:
| 
| //----------------sample----------------
|             <j:forEach var="dep" items="${pom.dependencies}">
|                     <copy file="${pom.getDependencyPath(dep.getId())}"
|                         todir="${tomcat.dir}/common/lib"/>
|             </j:forEach>
| //----------------sample end----------------
| 

The above works fine for me :-) Thank you very much Igor.

I am now copying the dependencies to a /lib subfolder in my target
directory. I do not know whether it is good practice or not but it is
what I want at the moment and I can start the application.

Note for people in the same situatio: The maven-jar-plugin-property
"maven.jar.manifest.classpath.add" did not add anything to the manifest
of my client-application, so I could not address any of the copied
jar-Files. - A bug? - I am now using an external manifest including the
classpath-reference to the libs (Class-Path: lib/XXX.jar). It works fine
and the path to the manifest can be definded by the property
"maven.jar.manifest".

Regards
Christian 


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