You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Arrowx7 <al...@yahoo.com> on 2010/03/21 23:51:44 UTC
Including a local jar in the build
Hello,
I migrated from ant to maven and just wanted to include the jars (for now
before we set up a repo).
<repositories>
<repository>
<id>project</id>
<name>Project Maven Repository</name>
<layout>default</layout>
<url>file://${basedir}/src/main/webapp/WEB-INF/lib</url>
</repository>
</repositories>
Then I write dependencies, such as for apache commons logging
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-logging-1.1.1</artifactId>
<version></version>
</dependency>
It complains because it wants the version, if I give it the version it says
it can't find it. How do I just get this jar in there without setting up
your own repository and installing it to repository, generating version
etc... I just want to simply linclude that file in there. I realize that
it's bad format, but how do I tell it to just grab that file regardless of
version.
Thanks
--
View this message in context: http://old.nabble.com/Including-a-local-jar-in-the-build-tp27977332p27977332.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: Including a local jar in the build
Posted by Eduardo M KALINOWSKI <ed...@kalinowski.com.br>.
Arrowx7 wrote:
> Hello,
> I migrated from ant to maven and just wanted to include the jars (for now
> before we set up a repo).
> <repositories>
> <repository>
> <id>project</id>
> <name>Project Maven Repository</name>
> <layout>default</layout>
> <url>file://${basedir}/src/main/webapp/WEB-INF/lib</url>
> </repository>
> </repositories>
>
> Then I write dependencies, such as for apache commons logging
>
> <dependency>
> <groupId>org.apache.commons</groupId>
> <artifactId>commons-logging-1.1.1</artifactId>
> <version></version>
> </dependency>
>
> It complains because it wants the version, if I give it the version it says
> it can't find it. How do I just get this jar in there without setting up
> your own repository and installing it to repository, generating version
> etc... I just want to simply linclude that file in there. I realize that
> it's bad format, but how do I tell it to just grab that file regardless of
> version.
>
Use the "system" scope for your dependencies.
--
Eduardo M KALINOWSKI
eduardo@kalinowski.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Including a local jar in the build
Posted by Wayne Fay <wa...@gmail.com>.
> Is there a way to just load that file with no questions asked?
Put those files in this directory structure as shown in the error message:
> file:///home/a/src/client_pom/src/main/webapp/WEB-INF/lib/org/apache/commons/commons-logging-1.1.1/1.1.1/commons-logging-1.1.1-1.1.1.pom
> file:///home/a/src/client_pom/src/main/webapp/WEB-INF/lib/org/apache/commons/commons-logging-1.1.1/1.1.1/commons-logging-1.1.1-1.1.1.jar
I do not like the scope system as suggested by Eduardo for several
reasons. Do NOT use system.
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Including a local jar in the build
Posted by Arrowx7 <al...@yahoo.com>.
Hi, thanks for your response.
I migrated from ant, where I had a libs folder. I just wanted to keep using
the libs folder for now as I migrate to using repositories. Is there a way
to direct maven to load libraries from a local folder? I did it like this:
<repositories>
<repository>
<id>project</id>
<name>Project Maven Repository</name>
<layout>default</layout>
<url>file://${basedir}/src/main/webapp/WEB-INF/lib</url>
</repository>
</repositories>
But when I try to load a dependency from that repo:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-logging-1.1.1</artifactId>
<version>1.1.1</version>
</dependency>
I get this:
Downloading:
file:///home/a/src/client_pom/src/main/webapp/WEB-INF/lib/org/apache/commons/commons-logging-1.1.1/1.1.1/commons-logging-1.1.1-1.1.1.pom
Unable to find resource 'org.apache.commons:commons-logging-1.1.1:pom:1.1.1'
in repository project
(file:///home/a/src/client_pom/src/main/webapp/WEB-INF/lib)
Downloading:
http://repo1.maven.org/maven2/org/apache/commons/commons-logging-1.1.1/1.1.1/commons-logging-1.1.1-1.1.1.pom
Unable to find resource 'org.apache.commons:commons-logging-1.1.1:pom:1.1.1'
in repository central (http://repo1.maven.org/maven2)
Downloading:
file:///home/a/src/client_pom/src/main/webapp/WEB-INF/lib/org/apache/commons/commons-logging-1.1.1/1.1.1/commons-logging-1.1.1-1.1.1.jar
Unable to find resource 'org.apache.commons:commons-logging-1.1.1:jar:1.1.1'
in repository project
(file:///home/a/src/client_pom/src/main/webapp/WEB-INF/lib)
Is there a way to just load that file with no questions asked?
Thank you!!
Wendy Smoak-3 wrote:
>
> On Sun, Mar 21, 2010 at 6:51 PM, Arrowx7 <al...@yahoo.com> wrote:
>> Then I write dependencies, such as for apache commons logging
>> <dependency>
>> <groupId>org.apache.commons</groupId>
>> <artifactId>commons-logging-1.1.1</artifactId>
>> <version></version>
>> </dependency>
>>
>> It complains because it wants the version, if I give it the version it
>> says
>> it can't find it. How do I just get this jar in there without setting up
>> your own repository and installing it to repository, generating version
>> etc... I just want to simply linclude that file in there. I realize that
>> it's bad format, but how do I tell it to just grab that file regardless
>> of
>> version.
>
> I think you want:
> http://repo2.maven.org/maven2/commons-logging/commons-logging/1.1.1/
>
> Try this...
> <dependency>
> <groupId>commons-logging</groupId>
> <artifactId>commons-logging<artifactId>
> <version>1.1.1</version>
> </dependency>
>
> (A Maven repository has a specified layout. You can't just point at
> any collection of jars.)
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
--
View this message in context: http://old.nabble.com/Including-a-local-jar-in-the-build-tp27977332p27981665.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: Including a local jar in the build
Posted by Wendy Smoak <ws...@gmail.com>.
On Sun, Mar 21, 2010 at 6:51 PM, Arrowx7 <al...@yahoo.com> wrote:
> Then I write dependencies, such as for apache commons logging
> <dependency>
> <groupId>org.apache.commons</groupId>
> <artifactId>commons-logging-1.1.1</artifactId>
> <version></version>
> </dependency>
>
> It complains because it wants the version, if I give it the version it says
> it can't find it. How do I just get this jar in there without setting up
> your own repository and installing it to repository, generating version
> etc... I just want to simply linclude that file in there. I realize that
> it's bad format, but how do I tell it to just grab that file regardless of
> version.
I think you want:
http://repo2.maven.org/maven2/commons-logging/commons-logging/1.1.1/
Try this...
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging<artifactId>
<version>1.1.1</version>
</dependency>
(A Maven repository has a specified layout. You can't just point at
any collection of jars.)
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org