On Oct 21, 2008, at 5:38 AM, David Blevins wrote:
is_maximum wrote:
Hi
the process of installing libraries in a repository is really time
consuming. consider you are in a company in which internet is
accessible
through a remote desktop connection and you can't connect to maven
repository directly,
you can doanload the OpenEjb with toiling and then you want to add
it to
your repository !!!
OpenEjb has many folders. each library has its own parent folder
and there
are lots of jar files
what is the rapid and best way to do it? I think if maven provides a
command facility to explore the jar file and find its pom.xml and
then
install it using that information
is there any such command? if not, how to ask them to provide such
command?
I'm not sure I know the answer to the maven side of the question,
but on the
OpenEJB side every jar in our distributions is available online in
the maven
repo, so there shouldn't be anything that you have to install
manually.
Just read this email a little closer and realized you are talking
about an offline scenario where all you have is an openejb zip file.
Yea, in that scenario it would be nice if maven had an easy way to put
the files back into the repo for all the jars created via maven. The
install:install-file mojo doesn't seem to have any smarts for when the
jar happens to have been built by maven. It would be nice if it did.
Till then this will get you pretty close. Execute this from the
openejb/lib/ dir.
---------------------
#!/bin/bash
for jar in *.jar; do
pom=$(jar tvf $jar | grep pom.xml | perl -pe 's,.* ,,')
props=$(jar tvf $jar | grep pom.properties | perl -pe 's,.* ,,')
if [ -n "$pom" ]; then
jar xvf $jar $pom $props
source $props
mvn install:install-file -DgroupId=$groupId -DartifactId=$artifactId -
Dversion=$version -Dpackaging=jar -Dfile=$jar
mvn install:install-file -DgroupId=$groupId -DartifactId=$artifactId -
Dversion=$version -Dpackaging=pom -Dfile=$pom
else
echo "must install manually $jar"
fi
done | tee install.log
---------------------
Would be nice if there was a mojo that would look for these files in
the artifact and use the data there, if present. Then all you'd need
to do is this:
---------------------
#!/bin/bash
for jar in *.jar; do
mvn install:install-artifact -Dfile=$jar
done | tee install.log
---------------------
Anyway, hope this helps a bit more.
-David
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]