You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Ed Smiley <es...@ebrary.com> on 2010/08/18 19:46:43 UTC

Artifact cunundrum

I have been running into this problem when attempting to download an archive
from a remote repository in a variety of ways as I attempted to work around
it.  I uploaded and verified the installation of an archive on a server that
I set up via sftp.  When I trigger a download, it seems to want to install
the archive in a directory on my machine that mirrors its location on the
remote server, rather than installing it in my local .m2 (maven2)
repository.

Rather than give a long explanation, I coded up a pair of build scripts, one
to create and upload the archive and another to unzip the archive.  I tried
to use code that is very close to documentation example code, so that any
complexities are eliminated.  Here's the details (with security sensitive
details obscured.

1. A simple buildfile for a jar that has a single class in it.
...src/main/java/org/screwloose/repotest/RepoStub.java
  a. the buildfile
VERSION_NUMBER = "1.0.0"
# Group identifier for your projects
GROUP = "repotest"
COPYRIGHT = ""
# Specify Maven 2.0 remote repositories here, like this:
repositories.remote << "http://www.ibiblio.org/maven2/"
# Specify Maven 2.0 remote repository to release to
repositories.release_to = 'sftp://
someuser:somepassword@someserver.somedomain.com/usr/share/maven2/'
desc "The Repotest project"
define "repotest" do
  project.version = VERSION_NUMBER
  project.group = GROUP
  manifest["Implementation-Vendor"] = COPYRIGHT
  package(:jar)
end
  b. running the buildfile
~/somedirectory/research/repotest $ buildr upload
(in /somehomedirs/myusername/somedirectory/research/repotest, development)
Building repotest
Packaging repotest
Running integration tests...
Deploying packages from repotest
Deploying repotest:repotest:pom:1.0.0
Deploying repotest:repotest:jar:1.0.0
Completed in 13.721s

2. Another stub buildfile with a compile, and hence, a build, dependency on
downloading the jar from the remote.
  a. the stub
# Generated by Buildr 1.3.5, change to your liking
# Version number for this release
VERSION_NUMBER = "1.0.0"
# Group identifier for your projects
GROUP = "repotest"
COPYRIGHT = ""
# Specify Maven 2.0 remote repositories here, like this:
repositories.remote << 'sftp://
someuser:somepassword@someserver.somedomain.com/usr/share/maven2/'
repositories.remote << "http://www.ibiblio.org/maven2/"
desc "The Repotest Test Archive project"
define "testarch" do
  project.version = VERSION_NUMBER
  project.group = GROUP
  manifest["Implementation-Vendor"] = COPYRIGHT
  the_jar = artifact('repotest:repotest:jar:1.0.0')
  task :unzip_jar => unzip(_("target/stuff") => the_jar) do
     compile.with Dir[_("target/stuff/WEB-INF/lib") + "/*.jar"]
  end
  task :compile => :unzip_jar
end

  b. running the test script with trace
~/somedirectory/research/repotest $ buildr -f testsarc.rb --trace
(in /somehomedirs/myusername/somedirectory/research/repotest, development)
** Invoke testarch (first_time)
** Execute testarch
Defining task testarch:shell:jirb
Defining task testarch:shell:clj
Defining task testarch:shell:bsh
** Invoke
/somehomedirs/myusername/.m2/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar
(first_time, not_needed)
** Invoke
/somehomedirs/myusername/.m2/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar
(first_time, not_needed)
** Invoke
/somehomedirs/myusername/.m2/repository/org/apache/ant/ant-trax/1.7.1/ant-trax-1.7.1.jar
(first_time, not_needed)
** Invoke /somelibrarydir/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/java
(first_time, not_needed)
Defining task shell based on shell:bsh
** Invoke testarch
** Invoke default (first_time)
** Invoke build (first_time)
** Execute build
Building testarch
** Invoke testarch:build (first_time)
** Invoke
/somehomedirs/myusername/somedirectory/research/repotest/target/classes
(first_time, not_needed)
** Invoke testarch:compile (first_time, not_needed)
** Invoke testarch:resources (first_time)
** Execute testarch:resources
** Invoke testarch:unzip_jar (first_time)
** Invoke
/somehomedirs/myusername/somedirectory/research/repotest/target/stuff
(first_time)
** Invoke
/somehomedirs/myusername/.m2/repository/repotest/repotest/1.0.0/repotest-1.0.0.jar
(first_time)
** Execute
/somehomedirs/myusername/.m2/repository/repotest/repotest/1.0.0/repotest-1.0.0.jar
Downloading repotest:repotest:jar:1.0.0
Downloading repotest:repotest:jar:1.0.0
Connecting to someserver.somedomain.com
connected
Downloading to /usr/share/maven2/repotest/repotest/1.0.0/repotest-1.0.0.jar
[hangs for an hour or more….<===========================]

Re: Artifact cunundrum

Posted by Antoine Toulme <an...@lunar-ocean.com>.
Ed, for now you can rely on creating the gem from trunk, by checking it out
and running:

gem build buildr.gemspec

Then install the resulting gem with:
gem install buildr-1.4.2.gem

1.4.2 is planned for end of this month, but we have been awfully busy as of
late, and we have a few issues remaining that needs to be taken care of.

Thanks,

Antoine

On Thu, Aug 19, 2010 at 10:00, Ed Smiley <es...@ebrary.com> wrote:

> Hi Alex
>
> Great.  Thant's fast work.
>
> The bug gives me an overview of the problem, but I'd like some more
> information.
>
> The obvious question is when this will be contained in a stable release,
> and
> how to patch in the meantime.
> It would certainly work for us to include a monkey patch in our own
> libraries, and then take it out when your fix has completed its release
> cycle.
>
> I am sure that there are people out there who are starting to manage their
> own artifacts, and they may run into the problem. (Especially if their
> software is somewhat proprietary, when they may want better security.)
>
> --Ed
>
> On Thu, Aug 19, 2010 at 8:06 AM, Alex Boisvert <alex.boisvert@gmail.com
> >wrote:
>
> > My suspicion was well-founded.
> >
> > Fixed and updated http://issues.apache.org/jira/browse/BUILDR-491 with
> > details.
> >
> > alex
> >
> >
> > On Wed, Aug 18, 2010 at 9:57 PM, Alex Boisvert <alex.boisvert@gmail.com
> > >wrote:
> >
> > > Hi Ed,
> > >
> > > My suspicion is that using sftp for downloading artifacts doesn't work.
> >  I
> > > don't know if it's ever been tested; sftp support was mostly added for
> > > deploying artifacts.  I'll investigate tomorrow;  too tired now, just
> > flew
> > > back home.
> > >
> > > alex
> > >  with
> > > On Wed, Aug 18, 2010 at 10:46 AM, Ed Smiley <es...@ebrary.com>
> wrote:
> > >
> > >> I have been running into this problem when attempting to download an
> > >> archive
> > >> from a remote repository in a variety of ways as I attempted to work
> > >> around
> > >> it.  I uploaded and verified the installation of an archive on a
> server
> > >> that
> > >> I set up via sftp.  When I trigger a download, it seems to want to
> > install
> > >> the archive in a directory on my machine that mirrors its location on
> > the
> > >> remote server, rather than installing it in my local .m2 (maven2)
> > >> repository.
> > >>
> > >> Rather than give a long explanation, I coded up a pair of build
> scripts,
> > >> one
> > >> to create and upload the archive and another to unzip the archive.  I
> > >> tried
> > >> to use code that is very close to documentation example code, so that
> > any
> > >> complexities are eliminated.  Here's the details (with security
> > sensitive
> > >> details obscured.
> > >>
> > >> 1. A simple buildfile for a jar that has a single class in it.
> > >> ...src/main/java/org/screwloose/repotest/RepoStub.java
> > >>  a. the buildfile
> > >> VERSION_NUMBER = "1.0.0"
> > >> # Group identifier for your projects
> > >> GROUP = "repotest"
> > >> COPYRIGHT = ""
> > >> # Specify Maven 2.0 remote repositories here, like this:
> > >> repositories.remote << "http://www.ibiblio.org/maven2/"
> > >> # Specify Maven 2.0 remote repository to release to
> > >> repositories.release_to = 'sftp://
> > >> someuser:somepassword@someserver.somedomain.com/usr/share/maven2/'
> > >> desc "The Repotest project"
> > >> define "repotest" do
> > >>  project.version = VERSION_NUMBER
> > >>  project.group = GROUP
> > >>  manifest["Implementation-Vendor"] = COPYRIGHT
> > >>  package(:jar)
> > >> end
> > >>  b. running the buildfile
> > >> ~/somedirectory/research/repotest $ buildr upload
> > >> (in /somehomedirs/myusername/somedirectory/research/repotest,
> > development)
> > >> Building repotest
> > >> Packaging repotest
> > >> Running integration tests...
> > >> Deploying packages from repotest
> > >> Deploying repotest:repotest:pom:1.0.0
> > >> Deploying repotest:repotest:jar:1.0.0
> > >> Completed in 13.721s
> > >>
> > >> 2. Another stub buildfile with a compile, and hence, a build,
> dependency
> > >> on
> > >> downloading the jar from the remote.
> > >>  a. the stub
> > >> # Generated by Buildr 1.3.5, change to your liking
> > >> # Version number for this release
> > >> VERSION_NUMBER = "1.0.0"
> > >> # Group identifier for your projects
> > >> GROUP = "repotest"
> > >> COPYRIGHT = ""
> > >> # Specify Maven 2.0 remote repositories here, like this:
> > >> repositories.remote << 'sftp://
> > >> someuser:somepassword@someserver.somedomain.com/usr/share/maven2/'
> > >> repositories.remote << "http://www.ibiblio.org/maven2/"
> > >> desc "The Repotest Test Archive project"
> > >> define "testarch" do
> > >>  project.version = VERSION_NUMBER
> > >>  project.group = GROUP
> > >>  manifest["Implementation-Vendor"] = COPYRIGHT
> > >>  the_jar = artifact('repotest:repotest:jar:1.0.0')
> > >>  task :unzip_jar => unzip(_("target/stuff") => the_jar) do
> > >>     compile.with Dir[_("target/stuff/WEB-INF/lib") + "/*.jar"]
> > >>  end
> > >>  task :compile => :unzip_jar
> > >> end
> > >>
> > >>  b. running the test script with trace
> > >> ~/somedirectory/research/repotest $ buildr -f testsarc.rb --trace
> > >> (in /somehomedirs/myusername/somedirectory/research/repotest,
> > development)
> > >> ** Invoke testarch (first_time)
> > >> ** Execute testarch
> > >> Defining task testarch:shell:jirb
> > >> Defining task testarch:shell:clj
> > >> Defining task testarch:shell:bsh
> > >> ** Invoke
> > >>
> > >>
> >
> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar
> > >> (first_time, not_needed)
> > >> ** Invoke
> > >>
> > >>
> >
> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar
> > >> (first_time, not_needed)
> > >> ** Invoke
> > >>
> > >>
> >
> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant-trax/1.7.1/ant-trax-1.7.1.jar
> > >> (first_time, not_needed)
> > >> ** Invoke
> > /somelibrarydir/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/java
> > >> (first_time, not_needed)
> > >> Defining task shell based on shell:bsh
> > >> ** Invoke testarch
> > >> ** Invoke default (first_time)
> > >> ** Invoke build (first_time)
> > >> ** Execute build
> > >> Building testarch
> > >> ** Invoke testarch:build (first_time)
> > >> ** Invoke
> > >>
> /somehomedirs/myusername/somedirectory/research/repotest/target/classes
> > >> (first_time, not_needed)
> > >> ** Invoke testarch:compile (first_time, not_needed)
> > >> ** Invoke testarch:resources (first_time)
> > >> ** Execute testarch:resources
> > >> ** Invoke testarch:unzip_jar (first_time)
> > >> ** Invoke
> > >> /somehomedirs/myusername/somedirectory/research/repotest/target/stuff
> > >> (first_time)
> > >> ** Invoke
> > >>
> > >>
> >
> /somehomedirs/myusername/.m2/repository/repotest/repotest/1.0.0/repotest-1.0.0.jar
> > >> (first_time)
> > >> ** Execute
> > >>
> > >>
> >
> /somehomedirs/myusername/.m2/repository/repotest/repotest/1.0.0/repotest-1.0.0.jar
> > >> Downloading repotest:repotest:jar:1.0.0
> > >> Downloading repotest:repotest:jar:1.0.0
> > >> Connecting to someserver.somedomain.com
> > >> connected
> > >> Downloading to
> > >> /usr/share/maven2/repotest/repotest/1.0.0/repotest-1.0.0.jar
> > >> [hangs for an hour or more….<===========================]
> > >>
> > >
> > >
> >
>

Re: Artifact cunundrum

Posted by Ed Smiley <es...@ebrary.com>.
Hi Alex

Great.  Thant's fast work.

The bug gives me an overview of the problem, but I'd like some more
information.

The obvious question is when this will be contained in a stable release, and
how to patch in the meantime.
It would certainly work for us to include a monkey patch in our own
libraries, and then take it out when your fix has completed its release
cycle.

I am sure that there are people out there who are starting to manage their
own artifacts, and they may run into the problem. (Especially if their
software is somewhat proprietary, when they may want better security.)

--Ed

On Thu, Aug 19, 2010 at 8:06 AM, Alex Boisvert <al...@gmail.com>wrote:

> My suspicion was well-founded.
>
> Fixed and updated http://issues.apache.org/jira/browse/BUILDR-491 with
> details.
>
> alex
>
>
> On Wed, Aug 18, 2010 at 9:57 PM, Alex Boisvert <alex.boisvert@gmail.com
> >wrote:
>
> > Hi Ed,
> >
> > My suspicion is that using sftp for downloading artifacts doesn't work.
>  I
> > don't know if it's ever been tested; sftp support was mostly added for
> > deploying artifacts.  I'll investigate tomorrow;  too tired now, just
> flew
> > back home.
> >
> > alex
> >  with
> > On Wed, Aug 18, 2010 at 10:46 AM, Ed Smiley <es...@ebrary.com> wrote:
> >
> >> I have been running into this problem when attempting to download an
> >> archive
> >> from a remote repository in a variety of ways as I attempted to work
> >> around
> >> it.  I uploaded and verified the installation of an archive on a server
> >> that
> >> I set up via sftp.  When I trigger a download, it seems to want to
> install
> >> the archive in a directory on my machine that mirrors its location on
> the
> >> remote server, rather than installing it in my local .m2 (maven2)
> >> repository.
> >>
> >> Rather than give a long explanation, I coded up a pair of build scripts,
> >> one
> >> to create and upload the archive and another to unzip the archive.  I
> >> tried
> >> to use code that is very close to documentation example code, so that
> any
> >> complexities are eliminated.  Here's the details (with security
> sensitive
> >> details obscured.
> >>
> >> 1. A simple buildfile for a jar that has a single class in it.
> >> ...src/main/java/org/screwloose/repotest/RepoStub.java
> >>  a. the buildfile
> >> VERSION_NUMBER = "1.0.0"
> >> # Group identifier for your projects
> >> GROUP = "repotest"
> >> COPYRIGHT = ""
> >> # Specify Maven 2.0 remote repositories here, like this:
> >> repositories.remote << "http://www.ibiblio.org/maven2/"
> >> # Specify Maven 2.0 remote repository to release to
> >> repositories.release_to = 'sftp://
> >> someuser:somepassword@someserver.somedomain.com/usr/share/maven2/'
> >> desc "The Repotest project"
> >> define "repotest" do
> >>  project.version = VERSION_NUMBER
> >>  project.group = GROUP
> >>  manifest["Implementation-Vendor"] = COPYRIGHT
> >>  package(:jar)
> >> end
> >>  b. running the buildfile
> >> ~/somedirectory/research/repotest $ buildr upload
> >> (in /somehomedirs/myusername/somedirectory/research/repotest,
> development)
> >> Building repotest
> >> Packaging repotest
> >> Running integration tests...
> >> Deploying packages from repotest
> >> Deploying repotest:repotest:pom:1.0.0
> >> Deploying repotest:repotest:jar:1.0.0
> >> Completed in 13.721s
> >>
> >> 2. Another stub buildfile with a compile, and hence, a build, dependency
> >> on
> >> downloading the jar from the remote.
> >>  a. the stub
> >> # Generated by Buildr 1.3.5, change to your liking
> >> # Version number for this release
> >> VERSION_NUMBER = "1.0.0"
> >> # Group identifier for your projects
> >> GROUP = "repotest"
> >> COPYRIGHT = ""
> >> # Specify Maven 2.0 remote repositories here, like this:
> >> repositories.remote << 'sftp://
> >> someuser:somepassword@someserver.somedomain.com/usr/share/maven2/'
> >> repositories.remote << "http://www.ibiblio.org/maven2/"
> >> desc "The Repotest Test Archive project"
> >> define "testarch" do
> >>  project.version = VERSION_NUMBER
> >>  project.group = GROUP
> >>  manifest["Implementation-Vendor"] = COPYRIGHT
> >>  the_jar = artifact('repotest:repotest:jar:1.0.0')
> >>  task :unzip_jar => unzip(_("target/stuff") => the_jar) do
> >>     compile.with Dir[_("target/stuff/WEB-INF/lib") + "/*.jar"]
> >>  end
> >>  task :compile => :unzip_jar
> >> end
> >>
> >>  b. running the test script with trace
> >> ~/somedirectory/research/repotest $ buildr -f testsarc.rb --trace
> >> (in /somehomedirs/myusername/somedirectory/research/repotest,
> development)
> >> ** Invoke testarch (first_time)
> >> ** Execute testarch
> >> Defining task testarch:shell:jirb
> >> Defining task testarch:shell:clj
> >> Defining task testarch:shell:bsh
> >> ** Invoke
> >>
> >>
> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar
> >> (first_time, not_needed)
> >> ** Invoke
> >>
> >>
> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar
> >> (first_time, not_needed)
> >> ** Invoke
> >>
> >>
> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant-trax/1.7.1/ant-trax-1.7.1.jar
> >> (first_time, not_needed)
> >> ** Invoke
> /somelibrarydir/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/java
> >> (first_time, not_needed)
> >> Defining task shell based on shell:bsh
> >> ** Invoke testarch
> >> ** Invoke default (first_time)
> >> ** Invoke build (first_time)
> >> ** Execute build
> >> Building testarch
> >> ** Invoke testarch:build (first_time)
> >> ** Invoke
> >> /somehomedirs/myusername/somedirectory/research/repotest/target/classes
> >> (first_time, not_needed)
> >> ** Invoke testarch:compile (first_time, not_needed)
> >> ** Invoke testarch:resources (first_time)
> >> ** Execute testarch:resources
> >> ** Invoke testarch:unzip_jar (first_time)
> >> ** Invoke
> >> /somehomedirs/myusername/somedirectory/research/repotest/target/stuff
> >> (first_time)
> >> ** Invoke
> >>
> >>
> /somehomedirs/myusername/.m2/repository/repotest/repotest/1.0.0/repotest-1.0.0.jar
> >> (first_time)
> >> ** Execute
> >>
> >>
> /somehomedirs/myusername/.m2/repository/repotest/repotest/1.0.0/repotest-1.0.0.jar
> >> Downloading repotest:repotest:jar:1.0.0
> >> Downloading repotest:repotest:jar:1.0.0
> >> Connecting to someserver.somedomain.com
> >> connected
> >> Downloading to
> >> /usr/share/maven2/repotest/repotest/1.0.0/repotest-1.0.0.jar
> >> [hangs for an hour or more….<===========================]
> >>
> >
> >
>

Re: Artifact cunundrum

Posted by Alex Boisvert <al...@gmail.com>.
My suspicion was well-founded.

Fixed and updated http://issues.apache.org/jira/browse/BUILDR-491 with
details.

alex


On Wed, Aug 18, 2010 at 9:57 PM, Alex Boisvert <al...@gmail.com>wrote:

> Hi Ed,
>
> My suspicion is that using sftp for downloading artifacts doesn't work.  I
> don't know if it's ever been tested; sftp support was mostly added for
> deploying artifacts.  I'll investigate tomorrow;  too tired now, just flew
> back home.
>
> alex
>  with
> On Wed, Aug 18, 2010 at 10:46 AM, Ed Smiley <es...@ebrary.com> wrote:
>
>> I have been running into this problem when attempting to download an
>> archive
>> from a remote repository in a variety of ways as I attempted to work
>> around
>> it.  I uploaded and verified the installation of an archive on a server
>> that
>> I set up via sftp.  When I trigger a download, it seems to want to install
>> the archive in a directory on my machine that mirrors its location on the
>> remote server, rather than installing it in my local .m2 (maven2)
>> repository.
>>
>> Rather than give a long explanation, I coded up a pair of build scripts,
>> one
>> to create and upload the archive and another to unzip the archive.  I
>> tried
>> to use code that is very close to documentation example code, so that any
>> complexities are eliminated.  Here's the details (with security sensitive
>> details obscured.
>>
>> 1. A simple buildfile for a jar that has a single class in it.
>> ...src/main/java/org/screwloose/repotest/RepoStub.java
>>  a. the buildfile
>> VERSION_NUMBER = "1.0.0"
>> # Group identifier for your projects
>> GROUP = "repotest"
>> COPYRIGHT = ""
>> # Specify Maven 2.0 remote repositories here, like this:
>> repositories.remote << "http://www.ibiblio.org/maven2/"
>> # Specify Maven 2.0 remote repository to release to
>> repositories.release_to = 'sftp://
>> someuser:somepassword@someserver.somedomain.com/usr/share/maven2/'
>> desc "The Repotest project"
>> define "repotest" do
>>  project.version = VERSION_NUMBER
>>  project.group = GROUP
>>  manifest["Implementation-Vendor"] = COPYRIGHT
>>  package(:jar)
>> end
>>  b. running the buildfile
>> ~/somedirectory/research/repotest $ buildr upload
>> (in /somehomedirs/myusername/somedirectory/research/repotest, development)
>> Building repotest
>> Packaging repotest
>> Running integration tests...
>> Deploying packages from repotest
>> Deploying repotest:repotest:pom:1.0.0
>> Deploying repotest:repotest:jar:1.0.0
>> Completed in 13.721s
>>
>> 2. Another stub buildfile with a compile, and hence, a build, dependency
>> on
>> downloading the jar from the remote.
>>  a. the stub
>> # Generated by Buildr 1.3.5, change to your liking
>> # Version number for this release
>> VERSION_NUMBER = "1.0.0"
>> # Group identifier for your projects
>> GROUP = "repotest"
>> COPYRIGHT = ""
>> # Specify Maven 2.0 remote repositories here, like this:
>> repositories.remote << 'sftp://
>> someuser:somepassword@someserver.somedomain.com/usr/share/maven2/'
>> repositories.remote << "http://www.ibiblio.org/maven2/"
>> desc "The Repotest Test Archive project"
>> define "testarch" do
>>  project.version = VERSION_NUMBER
>>  project.group = GROUP
>>  manifest["Implementation-Vendor"] = COPYRIGHT
>>  the_jar = artifact('repotest:repotest:jar:1.0.0')
>>  task :unzip_jar => unzip(_("target/stuff") => the_jar) do
>>     compile.with Dir[_("target/stuff/WEB-INF/lib") + "/*.jar"]
>>  end
>>  task :compile => :unzip_jar
>> end
>>
>>  b. running the test script with trace
>> ~/somedirectory/research/repotest $ buildr -f testsarc.rb --trace
>> (in /somehomedirs/myusername/somedirectory/research/repotest, development)
>> ** Invoke testarch (first_time)
>> ** Execute testarch
>> Defining task testarch:shell:jirb
>> Defining task testarch:shell:clj
>> Defining task testarch:shell:bsh
>> ** Invoke
>>
>> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar
>> (first_time, not_needed)
>> ** Invoke
>>
>> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar
>> (first_time, not_needed)
>> ** Invoke
>>
>> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant-trax/1.7.1/ant-trax-1.7.1.jar
>> (first_time, not_needed)
>> ** Invoke /somelibrarydir/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/java
>> (first_time, not_needed)
>> Defining task shell based on shell:bsh
>> ** Invoke testarch
>> ** Invoke default (first_time)
>> ** Invoke build (first_time)
>> ** Execute build
>> Building testarch
>> ** Invoke testarch:build (first_time)
>> ** Invoke
>> /somehomedirs/myusername/somedirectory/research/repotest/target/classes
>> (first_time, not_needed)
>> ** Invoke testarch:compile (first_time, not_needed)
>> ** Invoke testarch:resources (first_time)
>> ** Execute testarch:resources
>> ** Invoke testarch:unzip_jar (first_time)
>> ** Invoke
>> /somehomedirs/myusername/somedirectory/research/repotest/target/stuff
>> (first_time)
>> ** Invoke
>>
>> /somehomedirs/myusername/.m2/repository/repotest/repotest/1.0.0/repotest-1.0.0.jar
>> (first_time)
>> ** Execute
>>
>> /somehomedirs/myusername/.m2/repository/repotest/repotest/1.0.0/repotest-1.0.0.jar
>> Downloading repotest:repotest:jar:1.0.0
>> Downloading repotest:repotest:jar:1.0.0
>> Connecting to someserver.somedomain.com
>> connected
>> Downloading to
>> /usr/share/maven2/repotest/repotest/1.0.0/repotest-1.0.0.jar
>> [hangs for an hour or more….<===========================]
>>
>
>

Re: Artifact cunundrum

Posted by Alex Boisvert <al...@gmail.com>.
Hi Ed,

My suspicion is that using sftp for downloading artifacts doesn't work.  I
don't know if it's ever been tested; sftp support was mostly added for
deploying artifacts.  I'll investigate tomorrow;  too tired now, just flew
back home.

alex

On Wed, Aug 18, 2010 at 10:46 AM, Ed Smiley <es...@ebrary.com> wrote:

> I have been running into this problem when attempting to download an
> archive
> from a remote repository in a variety of ways as I attempted to work around
> it.  I uploaded and verified the installation of an archive on a server
> that
> I set up via sftp.  When I trigger a download, it seems to want to install
> the archive in a directory on my machine that mirrors its location on the
> remote server, rather than installing it in my local .m2 (maven2)
> repository.
>
> Rather than give a long explanation, I coded up a pair of build scripts,
> one
> to create and upload the archive and another to unzip the archive.  I tried
> to use code that is very close to documentation example code, so that any
> complexities are eliminated.  Here's the details (with security sensitive
> details obscured.
>
> 1. A simple buildfile for a jar that has a single class in it.
> ...src/main/java/org/screwloose/repotest/RepoStub.java
>  a. the buildfile
> VERSION_NUMBER = "1.0.0"
> # Group identifier for your projects
> GROUP = "repotest"
> COPYRIGHT = ""
> # Specify Maven 2.0 remote repositories here, like this:
> repositories.remote << "http://www.ibiblio.org/maven2/"
> # Specify Maven 2.0 remote repository to release to
> repositories.release_to = 'sftp://
> someuser:somepassword@someserver.somedomain.com/usr/share/maven2/'
> desc "The Repotest project"
> define "repotest" do
>  project.version = VERSION_NUMBER
>  project.group = GROUP
>  manifest["Implementation-Vendor"] = COPYRIGHT
>  package(:jar)
> end
>  b. running the buildfile
> ~/somedirectory/research/repotest $ buildr upload
> (in /somehomedirs/myusername/somedirectory/research/repotest, development)
> Building repotest
> Packaging repotest
> Running integration tests...
> Deploying packages from repotest
> Deploying repotest:repotest:pom:1.0.0
> Deploying repotest:repotest:jar:1.0.0
> Completed in 13.721s
>
> 2. Another stub buildfile with a compile, and hence, a build, dependency on
> downloading the jar from the remote.
>  a. the stub
> # Generated by Buildr 1.3.5, change to your liking
> # Version number for this release
> VERSION_NUMBER = "1.0.0"
> # Group identifier for your projects
> GROUP = "repotest"
> COPYRIGHT = ""
> # Specify Maven 2.0 remote repositories here, like this:
> repositories.remote << 'sftp://
> someuser:somepassword@someserver.somedomain.com/usr/share/maven2/'
> repositories.remote << "http://www.ibiblio.org/maven2/"
> desc "The Repotest Test Archive project"
> define "testarch" do
>  project.version = VERSION_NUMBER
>  project.group = GROUP
>  manifest["Implementation-Vendor"] = COPYRIGHT
>  the_jar = artifact('repotest:repotest:jar:1.0.0')
>  task :unzip_jar => unzip(_("target/stuff") => the_jar) do
>     compile.with Dir[_("target/stuff/WEB-INF/lib") + "/*.jar"]
>  end
>  task :compile => :unzip_jar
> end
>
>  b. running the test script with trace
> ~/somedirectory/research/repotest $ buildr -f testsarc.rb --trace
> (in /somehomedirs/myusername/somedirectory/research/repotest, development)
> ** Invoke testarch (first_time)
> ** Execute testarch
> Defining task testarch:shell:jirb
> Defining task testarch:shell:clj
> Defining task testarch:shell:bsh
> ** Invoke
>
> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar
> (first_time, not_needed)
> ** Invoke
>
> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar
> (first_time, not_needed)
> ** Invoke
>
> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant-trax/1.7.1/ant-trax-1.7.1.jar
> (first_time, not_needed)
> ** Invoke /somelibrarydir/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/java
> (first_time, not_needed)
> Defining task shell based on shell:bsh
> ** Invoke testarch
> ** Invoke default (first_time)
> ** Invoke build (first_time)
> ** Execute build
> Building testarch
> ** Invoke testarch:build (first_time)
> ** Invoke
> /somehomedirs/myusername/somedirectory/research/repotest/target/classes
> (first_time, not_needed)
> ** Invoke testarch:compile (first_time, not_needed)
> ** Invoke testarch:resources (first_time)
> ** Execute testarch:resources
> ** Invoke testarch:unzip_jar (first_time)
> ** Invoke
> /somehomedirs/myusername/somedirectory/research/repotest/target/stuff
> (first_time)
> ** Invoke
>
> /somehomedirs/myusername/.m2/repository/repotest/repotest/1.0.0/repotest-1.0.0.jar
> (first_time)
> ** Execute
>
> /somehomedirs/myusername/.m2/repository/repotest/repotest/1.0.0/repotest-1.0.0.jar
> Downloading repotest:repotest:jar:1.0.0
> Downloading repotest:repotest:jar:1.0.0
> Connecting to someserver.somedomain.com
> connected
> Downloading to /usr/share/maven2/repotest/repotest/1.0.0/repotest-1.0.0.jar
> [hangs for an hour or more….<===========================]
>

Re: Artifact cunundrum

Posted by Antoine Toulme <an...@lunar-ocean.com>.
Well, it's not installing it because you didn't ask for it imo - and that
might be an intended behavior.

Instead, try to modify this line:
task :unzip_jar => the_jar, unzip(_("target/stuff") => the_jar) do

By depending on it, the artifact will be evaluated as a task and invoked. It
might not work, let me know what it gives ?

Thanks,

Antoine

On Wed, Aug 18, 2010 at 10:46, Ed Smiley <es...@ebrary.com> wrote:

> I have been running into this problem when attempting to download an
> archive
> from a remote repository in a variety of ways as I attempted to work around
> it.  I uploaded and verified the installation of an archive on a server
> that
> I set up via sftp.  When I trigger a download, it seems to want to install
> the archive in a directory on my machine that mirrors its location on the
> remote server, rather than installing it in my local .m2 (maven2)
> repository.
>
> Rather than give a long explanation, I coded up a pair of build scripts,
> one
> to create and upload the archive and another to unzip the archive.  I tried
> to use code that is very close to documentation example code, so that any
> complexities are eliminated.  Here's the details (with security sensitive
> details obscured.
>
> 1. A simple buildfile for a jar that has a single class in it.
> ...src/main/java/org/screwloose/repotest/RepoStub.java
>  a. the buildfile
> VERSION_NUMBER = "1.0.0"
> # Group identifier for your projects
> GROUP = "repotest"
> COPYRIGHT = ""
> # Specify Maven 2.0 remote repositories here, like this:
> repositories.remote << "http://www.ibiblio.org/maven2/"
> # Specify Maven 2.0 remote repository to release to
> repositories.release_to = 'sftp://
> someuser:somepassword@someserver.somedomain.com/usr/share/maven2/'
> desc "The Repotest project"
> define "repotest" do
>  project.version = VERSION_NUMBER
>  project.group = GROUP
>  manifest["Implementation-Vendor"] = COPYRIGHT
>  package(:jar)
> end
>  b. running the buildfile
> ~/somedirectory/research/repotest $ buildr upload
> (in /somehomedirs/myusername/somedirectory/research/repotest, development)
> Building repotest
> Packaging repotest
> Running integration tests...
> Deploying packages from repotest
> Deploying repotest:repotest:pom:1.0.0
> Deploying repotest:repotest:jar:1.0.0
> Completed in 13.721s
>
> 2. Another stub buildfile with a compile, and hence, a build, dependency on
> downloading the jar from the remote.
>  a. the stub
> # Generated by Buildr 1.3.5, change to your liking
> # Version number for this release
> VERSION_NUMBER = "1.0.0"
> # Group identifier for your projects
> GROUP = "repotest"
> COPYRIGHT = ""
> # Specify Maven 2.0 remote repositories here, like this:
> repositories.remote << 'sftp://
> someuser:somepassword@someserver.somedomain.com/usr/share/maven2/'
> repositories.remote << "http://www.ibiblio.org/maven2/"
> desc "The Repotest Test Archive project"
> define "testarch" do
>  project.version = VERSION_NUMBER
>  project.group = GROUP
>  manifest["Implementation-Vendor"] = COPYRIGHT
>  the_jar = artifact('repotest:repotest:jar:1.0.0')
>  task :unzip_jar => unzip(_("target/stuff") => the_jar) do
>     compile.with Dir[_("target/stuff/WEB-INF/lib") + "/*.jar"]
>  end
>  task :compile => :unzip_jar
> end
>
>  b. running the test script with trace
> ~/somedirectory/research/repotest $ buildr -f testsarc.rb --trace
> (in /somehomedirs/myusername/somedirectory/research/repotest, development)
> ** Invoke testarch (first_time)
> ** Execute testarch
> Defining task testarch:shell:jirb
> Defining task testarch:shell:clj
> Defining task testarch:shell:bsh
> ** Invoke
>
> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar
> (first_time, not_needed)
> ** Invoke
>
> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar
> (first_time, not_needed)
> ** Invoke
>
> /somehomedirs/myusername/.m2/repository/org/apache/ant/ant-trax/1.7.1/ant-trax-1.7.1.jar
> (first_time, not_needed)
> ** Invoke /somelibrarydir/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/java
> (first_time, not_needed)
> Defining task shell based on shell:bsh
> ** Invoke testarch
> ** Invoke default (first_time)
> ** Invoke build (first_time)
> ** Execute build
> Building testarch
> ** Invoke testarch:build (first_time)
> ** Invoke
> /somehomedirs/myusername/somedirectory/research/repotest/target/classes
> (first_time, not_needed)
> ** Invoke testarch:compile (first_time, not_needed)
> ** Invoke testarch:resources (first_time)
> ** Execute testarch:resources
> ** Invoke testarch:unzip_jar (first_time)
> ** Invoke
> /somehomedirs/myusername/somedirectory/research/repotest/target/stuff
> (first_time)
> ** Invoke
>
> /somehomedirs/myusername/.m2/repository/repotest/repotest/1.0.0/repotest-1.0.0.jar
> (first_time)
> ** Execute
>
> /somehomedirs/myusername/.m2/repository/repotest/repotest/1.0.0/repotest-1.0.0.jar
> Downloading repotest:repotest:jar:1.0.0
> Downloading repotest:repotest:jar:1.0.0
> Connecting to someserver.somedomain.com
> connected
> Downloading to /usr/share/maven2/repotest/repotest/1.0.0/repotest-1.0.0.jar
> [hangs for an hour or more….<===========================]
>

Re: Artifact cunundrum

Posted by Antoine Toulme <an...@lunar-ocean.com>.
I'll look into it. If you could create a spec showing the problem, that'd be
great.

On Wed, Aug 18, 2010 at 12:53, Ed Smiley <es...@ebrary.com> wrote:

> Antoine
> I tried some suggestions, as well as having spent about a day previous
> trying to tweak install, upload and dependencies.
> As per suggestion, I have entered a bug,
> https://issues.apache.org/jira/browse/BUILDR-491.
> --Ed
>
>
> On Wed, Aug 18, 2010 at 10:46 AM, Ed Smiley <es...@ebrary.com> wrote:
>
>> I have been running into this problem when attempting to download an
>> archive from a remote repository in a variety of ways
>
>
> ...
>
>

Re: Artifact cunundrum

Posted by Ed Smiley <es...@ebrary.com>.
Antoine
I tried some suggestions, as well as having spent about a day previous
trying to tweak install, upload and dependencies.
As per suggestion, I have entered a bug,
https://issues.apache.org/jira/browse/BUILDR-491.
--Ed


On Wed, Aug 18, 2010 at 10:46 AM, Ed Smiley <es...@ebrary.com> wrote:

> I have been running into this problem when attempting to download an
> archive from a remote repository in a variety of ways


...