You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wim Deblauwe <wi...@gmail.com> on 2005/05/23 10:53:22 UTC

dependency on a dll

Hi,

I have this dependency I want to specify on a dll:

<dependency>
   <groupId>nativeAccessJni</groupId>
   <artifactId>nativeAccessJni.dll</artifactId>
   <version>1.0-SNAPSHOT</version>
   <jar>1.0-SNAPSHOT/nativeAccessJni.dll</jar>
   <type>dll</type>
</dependency>

This works fine, but the version number is in there twice. Is it
possible to refer to the version number like this:

<dependency>
   <groupId>nativeAccessJni</groupId>
   <artifactId>nativeAccessJni.dll</artifactId>
   <version>1.0-SNAPSHOT</version>
   <jar>${dependency.version}/nativeAccessJni.dll</jar>
   <type>dll</type>
</dependency>

Additionally, I want this dll in my jar, so I add in the resources:

<resources>
   <resource>
	<directory>${maven.repo.local}/nativeAccessJni/dlls/1.0-SNAPSHOT</directory>
	<targetPath>.</targetPath>
   </resource>
</resources>

Here the version is appearing again!

Any suggestions on how to avoid having to update the version 3 times,
would be very much appreciated.

regards,

Wim

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


Re: [repost] dependency on a dll - ${version} in pom possible?

Posted by Brett Porter <br...@gmail.com>.
On 5/25/05, Wim Deblauwe <wi...@gmail.com> wrote:
> What do you mean? I should put a version in the name of my dll? I
> can't do that. Other programs depend on that dll and I don't have
> control over them to force them to use a version number in the name.
> Which leaves using <jar/> as my only option, right?

Nope. Check out the links I sent. You have to follow Maven's filename
and path rules in the repository, but when you copy the file into your
installation location, or zip it up, you can name it whatever you
want/need.

> very true, I already wrote a script like that for use in a different
> context. Did not think of it here.

This is basically the idea of above. Maven takes care of downloading
and managing the repository, and gives you a filename, which you copy
to whatever place/name you would like.

HTH,
Brett

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


Re: [repost] dependency on a dll - ${version} in pom possible?

Posted by Brett Porter <br...@gmail.com>.
On 5/24/05, Wim Deblauwe <wi...@gmail.com> wrote:
> >
> > <dependency>
> >    <groupId>nativeAccessJni</groupId>
> >    <artifactId>nativeAccessJni.dll</artifactId>
> >    <version>1.0-SNAPSHOT</version>
> >    <jar>1.0-SNAPSHOT/nativeAccessJni.dll</jar>
> >    <type>dll</type>
> > </dependency>

Why do you need to modify the path name here? The <jar/> tag is
deprecated, see: http://maven.apache.org/faq.html#unversioned-jars

When copying out of the repo, you can rename it if you need that filename.

> > <resources>
> >    <resource>
> >         <directory>${maven.repo.local}/nativeAccessJni/dlls/1.0-SNAPSHOT</directory>
> >         <targetPath>.</targetPath>
> >    </resource>
> > </resources>

This isn't what resources are for. You need to write a custom script
that uses getDependencyPath to find the dependency from the local
repo, and copy it to the location you want. No version duplication
necessary :)

- Brett

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


[repost] dependency on a dll - ${version} in pom possible?

Posted by Wim Deblauwe <wi...@gmail.com>.
Nobody?

2005/5/23, Wim Deblauwe <wi...@gmail.com>:
> Hi,
> 
> I have this dependency I want to specify on a dll:
> 
> <dependency>
>    <groupId>nativeAccessJni</groupId>
>    <artifactId>nativeAccessJni.dll</artifactId>
>    <version>1.0-SNAPSHOT</version>
>    <jar>1.0-SNAPSHOT/nativeAccessJni.dll</jar>
>    <type>dll</type>
> </dependency>
> 
> This works fine, but the version number is in there twice. Is it
> possible to refer to the version number like this:
> 
> <dependency>
>    <groupId>nativeAccessJni</groupId>
>    <artifactId>nativeAccessJni.dll</artifactId>
>    <version>1.0-SNAPSHOT</version>
>    <jar>${dependency.version}/nativeAccessJni.dll</jar>
>    <type>dll</type>
> </dependency>
> 
> Additionally, I want this dll in my jar, so I add in the resources:
> 
> <resources>
>    <resource>
>         <directory>${maven.repo.local}/nativeAccessJni/dlls/1.0-SNAPSHOT</directory>
>         <targetPath>.</targetPath>
>    </resource>
> </resources>
> 
> Here the version is appearing again!
> 
> Any suggestions on how to avoid having to update the version 3 times,
> would be very much appreciated.
> 
> regards,
> 
> Wim
>

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