You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ch...@aami.com.au on 2008/05/29 02:41:05 UTC

Copying Artifacts

Hi All.

        I would like to copy the produced artifact of the package step (in 
this case an ear file) to a remote unix server.

        How do I do this?

        In this case I need to copy the ear file to a remote unix machine 
(under ant I used pscp from the putty suite) for deployment. Note this is 
NOT a deployment into a maven repository, it is simply a copy of the 
artifact to a unix box so that I can then deploy it into WebSphere.

        One final requirement: each artifact uses a different 
userid/password (two ears, two user id's etc).

        Most of what I've found is all written around deploying to various 
maven repositories, which does not apply in this case.

        TIA.

-Chris


**********************************************************************
CAUTION - This message is intended for the addressee named above. It may contain privileged or confidential information. 

If you are not the intended recipient of this message you must: 
- Not use, copy, distribute or disclose it to anyone other than the addressee;
- Notify the sender via return email; and
- Delete the message (and any related attachments) from your computer immediately.

Internet emails are not necessarily secure. Australian Associated Motors Insurers Limited ABN 92 004 791 744 (AAMI), and its related entities, do not accept responsibility for changes made to this message after it was sent.

Unless otherwise stated, views expressed within this email are the author's own and do not represent those of AAMI.
**********************************************************************

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


Re: Copying Artifacts

Posted by ChrisGWarp <Ch...@aami.com.au>.


ChrisGWarp wrote:
> 
> Hi All.
> 
>         I would like to copy the produced artifact of the package step (in 
> this case an ear file) to a remote unix server.
> 
>         How do I do this?
> 
>         In this case I need to copy the ear file to a remote unix machine 
> (under ant I used pscp from the putty suite) for deployment. Note this is 
> NOT a deployment into a maven repository, it is simply a copy of the 
> artifact to a unix box so that I can then deploy it into WebSphere.
> 
>         One final requirement: each artifact uses a different 
> userid/password (two ears, two user id's etc).
> 
>         Most of what I've found is all written around deploying to various 
> maven repositories, which does not apply in this case.
> 
>         TIA.
> 
> -Chris
> 

Given that no body answered, I'll answer itmyself for future users:


	I've finally managed to  answer some of my own questions.

	What I needed to do is to have maven upload the final artifact (in this
case an ear file) as part of the build to our websphere servers for
deployment.

	We can not use the (local server only) maven way of doing a deployment.
Probably would not want to anyway.

	After much frigging around, this is what I've come up with:

	I've added this to my POM file for the ear. I want the ear file uploaded as
part of the package phase.

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-upload-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>upload-ear</id>
                        <phase>package</phase>
                        <goals>
                            <goal>upload</goal>
                        </goals>
                        <configuration>
                            
<resourceSrc>${project.build.directory}/${project.build.finalName}.ear</resourceSrc>
                            <resourceDest></resourceDest>
                            <serverId>inet3</serverId>
                           
<url>sftp://inet3.warpspeed.com.au/was51/gpdb/ears</url>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

	This references a serverId of 'inet3', and it's details need to be defined
in the local user's settings.xml file, as such:

<servers>
    <server>
        <id>inet3</id>
        <username>xxxx</username>
        <password>yyyy</password>
        <filePermissions>664</filePermissions>
        <directoryPermissions>775</directoryPermissions>
    </server>
</servers>

	Now, running mvn clean package, it presents me with this bit:

[INFO] Building jar: C:\Documents and Settings\Chris\My
Documents\IBM\rationalsdp7.0\workspace\GPDBEAR\target\GPDBEAR-1.0.6-SNAPSHOT.ear
[INFO] [upload:upload {execution: upload-ear}]
sftp://inet3.warpspeed.com.au/was51/gpdb/ears - Session: Opened
Uploading: ./GPDBEAR-1.0.6-SNAPSHOT.ear to
sftp://inet3.warpspeed.com.au/was51/gpdb/ears

#...#
Transfer finished. 23114164 bytes copied in 13.25 seconds
sftp://inet3.warpspeed.com.au/was51/gpdb/ears - Session: Disconnecting
sftp://inet3.warpspeed.com.au/was51/gpdb/ears - Session: Disconnected

	It is a lot faster than scp (which took 65+ seconds to do the same job).

	This is also covered in this thread:


http://www.nabble.com/Copy-the-artifact-via-scp-to-our-server-td18775690.html#a18775690

-Chris

-- 
View this message in context: http://www.nabble.com/Copying-Artifacts-tp17525062p19192313.html
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