maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Hammar <and...@hammar.net>
Subject Re: How to add a dependency programmatically for the compile phase?
Date Thu, 19 Dec 2013 07:12:41 GMT
I don't have the code at hands on how to do what you're asking, but I
wanted to stress that changing the dependency list in a plugin will only
affect that list during the build where your plugin is executed. Any
consumers of your artifact (from the repo) will not get this dependency, as
the plugin is then not executed! Maybe you can solve this with a custom
packaging type and a special ArtifactHandler, but I'm not sure.

/Anders



On Thu, Dec 19, 2013 at 5:25 AM, William Ferguson <
william.ferguson@xandar.com.au> wrote:

> Hi,
>
> I would like to know how to add a dependency (such as a jar) into the
> project's list of compile time dependencies programmatically within a Mojo.
> Benoit should probably have posted this in Maven Users rather than
> Maven Dev, so I'm reposting here.
>
> We are developing a Mojo that needs to add some dependencies into the
> project list of compile time dependencies programmatically. I was sure
> that I've seen code that did this, but I can't find it now. Can anyone
> point us in the right direction?
>
> William
>
> ---------------------- Benoit's original post ----------------------
>
> I require to do this programmatically because the user set a dependency of
> type "aar"(1) which itself contains a jar.
> This jar needs to be known by the compile phase (in order to succeed)
> Note: the compile phase knows about the aar dependency.
>
> (1) Aar format:
> http://tools.android.com/tech-docs/new-build-system/aar-format
>
> Other conversations:
> About AAR & the included
> JAR:
> https://groups.google.com/forum/#!topic/maven-android-developers/bPK3EnbKH2M
>
> Programmatically adding dependencies to a MavenProject: (this conversation
> led to a hacky solution)
> http://maven.40175.n5.nabble.com/Programmatically-adding-dependencies-to-a-MavenProject-td215077i20.html#a5773302
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message