Re: Property that indicates a snapshot or release build?

2014-01-19 Thread Baptiste Mathus
+1.
At least I agree I don't think there's already a property for that.
Le 19 janv. 2014 22:20, "Dan Tran"  a écrit :

> Sounds like a candidate enhancement for build-helper-maven-plugin
>
> -D
>
>
> On Sunday, January 19, 2014, Graham Leggett  wrote:
>
> > On 19 Jan 2014, at 6:20 PM, Anders Hammar  >
> > wrote:
> >
> > > Don't understand. You need to, through code, get hold of the artifact
> > > objects.
> >
> > I am trying to get access to this from a property.
> >
> > What I need is a property that I can embed in a path inside the pom. If
> > the artefact is a release, the property is one value, while if the
> artefact
> > is a snapshot, the property is another. The project.version property
> comes
> > achingly close, but won't work for me because it will change on every
> > release.
> >
> > Regards,
> > Graham
> > --
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> 
> >
> >
>


Re: Property that indicates a snapshot or release build?

2014-01-19 Thread Dan Tran
Sounds like a candidate enhancement for build-helper-maven-plugin

-D


On Sunday, January 19, 2014, Graham Leggett  wrote:

> On 19 Jan 2014, at 6:20 PM, Anders Hammar >
> wrote:
>
> > Don't understand. You need to, through code, get hold of the artifact
> > objects.
>
> I am trying to get access to this from a property.
>
> What I need is a property that I can embed in a path inside the pom. If
> the artefact is a release, the property is one value, while if the artefact
> is a snapshot, the property is another. The project.version property comes
> achingly close, but won't work for me because it will change on every
> release.
>
> Regards,
> Graham
> --
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org 
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Adding a classpath element within a Mojo

2014-01-19 Thread William Ferguson
Hi Ron, appreciate the references, but I am not attempting to build an
Android project, I am working on the android-maven-plugin which builds
Android projects. The AAR consumption within android-maven-plugin is
currently incomplete.

Ie I need to know how to add a compile time dependency within the Mojo that
consumes AAR artifacts. Not looking for a way to use Gradle to build.

William


On Mon, Jan 20, 2014 at 9:56 AM, Ron Wheeler  wrote:

> I don't do any Android development but since no one had responded, I
> thought that I wight try to get you started (or unblocked).
>
> Perhaps some of these references will help.
> http://www.vandalsoftware.com/post/52468430435/publishing-
> an-android-library-aar-to-a-maven
> http://stackoverflow.com/questions/15173923/external-
> android-library-projects-with-gradle
> http://blog.glassdiary.com/post/67134169807/how-to-share-
> android-archive-library-aar-across
>
> You might want to do some Googling to find exactly what you need.
>
> Ron
>
>
> On 19/01/2014 4:47 PM, William Ferguson wrote:
>
>> OK, let me clarify.
>>
>> Project has dependencies on artifacts of type AAR (Android archive - an
>> archive that contains several sub-artifacts including a classes jar).
>>
>> My Mojo unpacks the AAR artifacts and makes the sub-artifacts available to
>> other build components.
>>
>> One of those build components is the maven-compiler-plugin. We want to add
>> the classes contained in the AAR dependencies to the compile classpath so
>> that the maven-compiler-plugin can compile our classes against the classes
>> from the AARs.
>>
>> How do we do that?
>>
>> William
>>
>>
>>
>> On Mon, Jan 20, 2014 at 1:14 AM, Anders Hammar  wrote:
>>
>>  Do you want to change the classpath of the project or of other mojos?
>>>
>>> Don't think either is possible. And if it was, I don't think it's wise.
>>> The
>>> dependencies of the project should be declared and not magically added.
>>>
>>> /Anders
>>>
>>>
>>>
>>> On Sun, Jan 19, 2014 at 1:18 PM, William Ferguson <
>>> william.fergu...@xandar.com.au> wrote:
>>>
>>>  I have a Mojo which needs to add an element to the compile time
 classpath
 for future Mojos.

 I'm struggling to find any doco that points in the right direction.

 Is it possible?
 If so, how should I go about it?


 William


>
> --
> Ron Wheeler
> President
> Artifact Software Inc
> email: rwhee...@artifact-software.com
> skype: ronaldmwheeler
> phone: 866-970-2435, ext 102
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Adding a classpath element within a Mojo

2014-01-19 Thread Ron Wheeler
I don't do any Android development but since no one had responded, I 
thought that I wight try to get you started (or unblocked).


Perhaps some of these references will help.
http://www.vandalsoftware.com/post/52468430435/publishing-an-android-library-aar-to-a-maven
http://stackoverflow.com/questions/15173923/external-android-library-projects-with-gradle
http://blog.glassdiary.com/post/67134169807/how-to-share-android-archive-library-aar-across

You might want to do some Googling to find exactly what you need.

Ron

On 19/01/2014 4:47 PM, William Ferguson wrote:

OK, let me clarify.

Project has dependencies on artifacts of type AAR (Android archive - an
archive that contains several sub-artifacts including a classes jar).

My Mojo unpacks the AAR artifacts and makes the sub-artifacts available to
other build components.

One of those build components is the maven-compiler-plugin. We want to add
the classes contained in the AAR dependencies to the compile classpath so
that the maven-compiler-plugin can compile our classes against the classes
from the AARs.

How do we do that?

William



On Mon, Jan 20, 2014 at 1:14 AM, Anders Hammar  wrote:


Do you want to change the classpath of the project or of other mojos?

Don't think either is possible. And if it was, I don't think it's wise. The
dependencies of the project should be declared and not magically added.

/Anders



On Sun, Jan 19, 2014 at 1:18 PM, William Ferguson <
william.fergu...@xandar.com.au> wrote:


I have a Mojo which needs to add an element to the compile time classpath
for future Mojos.

I'm struggling to find any doco that points in the right direction.

Is it possible?
If so, how should I go about it?


William




--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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



Re: Adding a classpath element within a Mojo

2014-01-19 Thread William Ferguson
OK, let me clarify.

Project has dependencies on artifacts of type AAR (Android archive - an
archive that contains several sub-artifacts including a classes jar).

My Mojo unpacks the AAR artifacts and makes the sub-artifacts available to
other build components.

One of those build components is the maven-compiler-plugin. We want to add
the classes contained in the AAR dependencies to the compile classpath so
that the maven-compiler-plugin can compile our classes against the classes
from the AARs.

How do we do that?

William



On Mon, Jan 20, 2014 at 1:14 AM, Anders Hammar  wrote:

> Do you want to change the classpath of the project or of other mojos?
>
> Don't think either is possible. And if it was, I don't think it's wise. The
> dependencies of the project should be declared and not magically added.
>
> /Anders
>
>
>
> On Sun, Jan 19, 2014 at 1:18 PM, William Ferguson <
> william.fergu...@xandar.com.au> wrote:
>
> > I have a Mojo which needs to add an element to the compile time classpath
> > for future Mojos.
> >
> > I'm struggling to find any doco that points in the right direction.
> >
> > Is it possible?
> > If so, how should I go about it?
> >
> >
> > William
> >
>


Re: Property that indicates a snapshot or release build?

2014-01-19 Thread Dan Tran
Sounds like a candidate enhancement for build-helper-maven-plugin

-D


On Sunday, January 19, 2014, Graham Leggett  wrote:

> On 19 Jan 2014, at 6:20 PM, Anders Hammar >
> wrote:
>
> > Don't understand. You need to, through code, get hold of the artifact
> > objects.
>
> I am trying to get access to this from a property.
>
> What I need is a property that I can embed in a path inside the pom. If
> the artefact is a release, the property is one value, while if the artefact
> is a snapshot, the property is another. The project.version property comes
> achingly close, but won't work for me because it will change on every
> release.
>
> Regards,
> Graham
> --
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org 
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Property that indicates a snapshot or release build?

2014-01-19 Thread Anders Hammar
OK, then I don't know. Don't think there is a property.

/Anders


On Sun, Jan 19, 2014 at 5:24 PM, Graham Leggett  wrote:

> On 19 Jan 2014, at 6:20 PM, Anders Hammar  wrote:
>
> > Don't understand. You need to, through code, get hold of the artifact
> > objects.
>
> I am trying to get access to this from a property.
>
> What I need is a property that I can embed in a path inside the pom. If
> the artefact is a release, the property is one value, while if the artefact
> is a snapshot, the property is another. The project.version property comes
> achingly close, but won't work for me because it will change on every
> release.
>
> Regards,
> Graham
> --
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Property that indicates a snapshot or release build?

2014-01-19 Thread Graham Leggett
On 19 Jan 2014, at 6:20 PM, Anders Hammar  wrote:

> Don't understand. You need to, through code, get hold of the artifact
> objects.

I am trying to get access to this from a property.

What I need is a property that I can embed in a path inside the pom. If the 
artefact is a release, the property is one value, while if the artefact is a 
snapshot, the property is another. The project.version property comes achingly 
close, but won't work for me because it will change on every release.

Regards,
Graham
--


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



Re: Property that indicates a snapshot or release build?

2014-01-19 Thread Anders Hammar
Don't understand. You need to, through code, get hold of the artifact
objects.

/Anders


On Sun, Jan 19, 2014 at 5:17 PM, Graham Leggett  wrote:

> On 19 Jan 2014, at 5:59 PM, Anders Hammar  wrote:
>
> > Yes, there is methods isSnapshot() and isRelease() if you get the
> Artifact
> > object. See [1].
> >
> > /Anders
> >
> > [1] http://maven.apache.org/ref/3.1.1/maven-artifact/apidocs/index.html
>
> Is there a practical example anywhere of how this could be referred to
> from a maven variable?
>
> Regards,
> Graham
> --
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Property that indicates a snapshot or release build?

2014-01-19 Thread Graham Leggett
On 19 Jan 2014, at 5:59 PM, Anders Hammar  wrote:

> Yes, there is methods isSnapshot() and isRelease() if you get the Artifact
> object. See [1].
> 
> /Anders
> 
> [1] http://maven.apache.org/ref/3.1.1/maven-artifact/apidocs/index.html

Is there a practical example anywhere of how this could be referred to from a 
maven variable?

Regards,
Graham
--


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



Re: Property that indicates a snapshot or release build?

2014-01-19 Thread Anders Hammar
Yes, there is methods isSnapshot() and isRelease() if you get the Artifact
object. See [1].

/Anders

[1] http://maven.apache.org/ref/3.1.1/maven-artifact/apidocs/index.html


On Sun, Jan 19, 2014 at 4:43 PM, Graham Leggett  wrote:

> Hi all,
>
> Does there exist a property in maven that will indicate in some fashion
> whether the build is a snapshot build or a release build?
>
> I am aware that "-SNAPSHOT" appears in the version number, but that won't
> do. I'm after a variable that has one of two discrete values, one
> predictable value if it is a snapshot and another predictable value when it
> is a release. Does anything like this exist?
>
> Regards,
> Graham
> --
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Property that indicates a snapshot or release build?

2014-01-19 Thread Graham Leggett
Hi all,

Does there exist a property in maven that will indicate in some fashion whether 
the build is a snapshot build or a release build?

I am aware that "-SNAPSHOT" appears in the version number, but that won't do. 
I'm after a variable that has one of two discrete values, one predictable value 
if it is a snapshot and another predictable value when it is a release. Does 
anything like this exist?

Regards,
Graham
--


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



Re: Adding a classpath element within a Mojo

2014-01-19 Thread Anders Hammar
Do you want to change the classpath of the project or of other mojos?

Don't think either is possible. And if it was, I don't think it's wise. The
dependencies of the project should be declared and not magically added.

/Anders



On Sun, Jan 19, 2014 at 1:18 PM, William Ferguson <
william.fergu...@xandar.com.au> wrote:

> I have a Mojo which needs to add an element to the compile time classpath
> for future Mojos.
>
> I'm struggling to find any doco that points in the right direction.
>
> Is it possible?
> If so, how should I go about it?
>
>
> William
>


Re: dependencies needed by plugin

2014-01-19 Thread Anders Hammar
> I have created a mvn plugin called "foo" that needs a jar file say
> "xyz.jar"
> in order to compile and run.  in the pom file of plugin project foo I have
> provided xyz.jar with "provided" scope in the dependencies section.


That is most likely not correct. If your plugin requires the xyz artifact
it should be declared with compile scope for the plugin.


> I do not want to package the xyz.jar file in the plugin.


You wouldn't package it with your plugin. It would be a dependency of your
plugin, in the same manner as you have dependencies of any Maven project.
It will be retrieved in normal Maven style, i.e. from the declared Maven
repos.


> The plugin "foo"  will be
> triggered by another project say "bar" in its install phase.


How you get that artifact into the (local) repo doesn't matter out of the
plugin's perspective. Don't think about this for solving this question of
yours.


> so I added the
> plugin foo in the ...
> section of the project bar. project bar has the dependency of "xyz.jar"  in
> its  section.  when I run install goal the classes present in
> the xyz.jar and which are refered by the plugin foo throw
> ClassNotFoundException at Runtime.
>

Right. When the plugin executes it will get its own classpath, which does
not include the dependencies of the project but only the ones of the
plugin. So just change the declared scope of the xyz artifact dependency in
your plugin's pom to compile and everything should just work!

/Anders


>
> Please let me know how to resolve this.
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/dependencies-needed-by-plugin-tp5781651.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: dependencies needed by plugin

2014-01-19 Thread Ron Wheeler
Plug-ins are not part of your code and stuff in the dependency section 
has no affect on plug-ins.


If foo is "provided", you probably have to put it in the Java library 
folder or the Maven folder.


You need to go back to the plug-in documentation and see how to include 
libraries in plug-ins.


I don't write plug-ins so this is about as far as I can help.

Ron

On 18/01/2014 2:35 PM, tanuj...@gmail.com wrote:

Hello Rusty WRight

I have created a mvn plugin called "foo" that needs a jar file say "xyz.jar"
in order to compile and run.  in the pom file of plugin project foo I have
provided xyz.jar with "provided" scope in the dependencies section. I do not
want to package the xyz.jar file in the plugin. The plugin "foo"  will be
triggered by another project say "bar" in its install phase. so I added the
plugin foo in the ...
section of the project bar. project bar has the dependency of "xyz.jar"  in
its  section.  when I run install goal the classes present in
the xyz.jar and which are refered by the plugin foo throw
ClassNotFoundException at Runtime.

Please let me know how to resolve this.



--
View this message in context: 
http://maven.40175.n5.nabble.com/dependencies-needed-by-plugin-tp5781651.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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





--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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



Adding a classpath element within a Mojo

2014-01-19 Thread William Ferguson
I have a Mojo which needs to add an element to the compile time classpath
for future Mojos.

I'm struggling to find any doco that points in the right direction.

Is it possible?
If so, how should I go about it?


William