You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by is_maximum <mn...@gmail.com> on 2008/10/21 12:58:21 UTC
deploying JAR file using the pom.xml inside the JAR
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?
thanks
-----
--
Regards
Mohammad Norouzi
Help each other to reach the future faster
http://pixelshot.wordpress.com Pixelshot Photoblog
http://brainable.blogspot.com Brainable Blog
--
View this message in context: http://www.nabble.com/deploying-JAR-file-using-the-pom.xml-inside-the-JAR-tp20087846p20087846.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
Re: deploying JAR file using the pom.xml inside the JAR
Posted by Dan Tran <da...@gmail.com>.
truezip-maven-plugin's at mojo sandbox allows you to copy a particular
file out of archive without unpack the whole thing, give it a shot!!
-D
On Tue, Oct 21, 2008 at 12:35 PM, is_maximum <mn...@gmail.com> wrote:
>
>
>
> David Blevins wrote:
>>
>>
>> On Oct 21, 2008, at 5:38 AM, David Blevins wrote:
>>
>>
>> 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: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>
> Thanks David, yes I meant in offline computers. and the approaches you said
> seems to be very great, I'll check it later. but it would be nice if they
> embed this in maven
> anyway, thanks and I will check your solution.
>
> -----
> --
> Regards
>
> Mohammad Norouzi
>
> Help each other to reach the future faster
>
> http://pixelshot.wordpress.com Pixelshot Photoblog
>
> http://brainable.blogspot.com Brainable Blog
>
>
> --
> View this message in context: http://www.nabble.com/deploying-JAR-file-using-the-pom.xml-inside-the-JAR-tp20087846p20097840.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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: deploying JAR file using the pom.xml inside the JAR
Posted by is_maximum <mn...@gmail.com>.
David Blevins wrote:
>
>
> On Oct 21, 2008, at 5:38 AM, David Blevins wrote:
>
>
> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
Thanks David, yes I meant in offline computers. and the approaches you said
seems to be very great, I'll check it later. but it would be nice if they
embed this in maven
anyway, thanks and I will check your solution.
-----
--
Regards
Mohammad Norouzi
Help each other to reach the future faster
http://pixelshot.wordpress.com Pixelshot Photoblog
http://brainable.blogspot.com Brainable Blog
--
View this message in context: http://www.nabble.com/deploying-JAR-file-using-the-pom.xml-inside-the-JAR-tp20087846p20097840.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
Re: deploying JAR file using the pom.xml inside the JAR
Posted by David Blevins <da...@visi.com>.
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: deploying JAR file using the pom.xml inside the JAR
Posted by David Blevins <da...@visi.com>.
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.
Adding this dependency will get you a full ejb container that you can use
for embedded testing or use with a local client. All of our maven2 based
embedded testing examples use this dependency.
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>openejb-core</artifactId>
<version>3.0</version>
</dependency>
Adding this dependency will give you the client/server protocol for remote
client communication.
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>openejb-ejbd</artifactId>
<version>3.0</version>
</dependency>
Adding this dependency will give you JAX-WS support via CXF.
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>openejb-cxf</artifactId>
<version>3.0</version>
</dependency>
If you're curious we use the maven-assembly-plugin to create our zips, tars,
and wars. So if you wanted something like a basic openejb zip but slightly
different you can copy from these:
openejb-3.0.zip :
http://svn.apache.org/repos/asf/openejb/tags/openejb-3.0/assembly/openejb-standalone/pom.xml
openejb.war :
http://svn.apache.org/repos/asf/openejb/tags/openejb-3.0/assembly/openejb-tomcat/openejb-tomcat-webapp/pom.xml
Hope this helps!
-David
--
View this message in context: http://www.nabble.com/deploying-JAR-file-using-the-pom.xml-inside-the-JAR-tp20087846p20089288.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