Hi Jason,

Probably you can't see the injecting, cause while debugging, I found this out 
myself and while trying every option I could think of, that was the first that 
worked :-)

I'm now almost finished. While now my extension works with Maven 3.1.1 up to 
the latest version, now I get some strange classloading issues if I run the 
extension from ".mvn/extensions.xml" but it works if I install the lib to 
"lib/ext" ... hopefully I'll be able to find out why this is soon.

java.lang.LinkageError: loader constraint violation: loader (instance of 
org/codehaus/plexus/classworlds/realm/ClassRealm) previously initiated loading 
for a different type with name 
"org/apache/maven/artifact/repository/ArtifactRepository"

but for now I'll probably simply write the how to install the extension and 
post an "by the way if your using 3.3.1"-document afterwards ;-)

Chris


-----Ursprüngliche Nachricht-----
Von: Jason van Zyl [mailto:[email protected]] 
Gesendet: Sonntag, 19. April 2015 14:29
An: Maven Users List
Betreff: Re: Packaging Maven Core Extensions

Not sure what you mean by "injected" but the code you sent me does not attempt 
to @Inject the session. If you did this is a problem with the spies where you 
can't inject the MavenSession, because the spies are setup in the CLI and you 
can't @Inject the MavenSession until the session scope starts in DefaultMaven. 
So what you're doing is really the only way it can work. We didn't think much 
about spies when creating the session scope. If we moved the setup of the spies 
into DefaultMaven this would likely work as you expected but that's not the way 
it works currently.

On Apr 19, 2015, at 6:09 AM, Christofer Dutz <[email protected]> wrote:

> Ok ... so I invested quite some time in different ways to get the 
> MavenSession injected, till I had a look at the other "events" the EventSpy 
> got and found the ExecutionEvent containing an instance of a MavenSession. So 
> I changed my code to that and now my Extension seems to be working nicely 
> with Maven 3.1.1 and above.
> 
> Chris
> 
> ________________________________________
> Von: Christofer Dutz <[email protected]>
> Gesendet: Samstag, 18. April 2015 22:03
> An: Maven Users List; [email protected]
> Betreff: AW: Packaging Maven Core Extensions
> 
> Hi,
> 
> the code is here:
> https://github.com/apache/flex-utilities/tree/develop/mavenizer/maven-
> extension
> 
> The "provided" scope was the tip that got my fat-jar running in lib/ext for 
> Maven 3.1.1 ...
> Unfortunately it seems to only run in Maven 3.3.1 ... if I try it in 
> 3.2.2 or 3.1.1 I get errors :-(
> 
> Chris
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Karl Heinz Marbaise [mailto:[email protected]]
> Gesendet: Samstag, 18. April 2015 18:51
> An: Maven Users List
> Betreff: Re: Packaging Maven Core Extensions
> 
> Hi,
> 
> are you running from within Jenkins ?
> 
> On 4/18/15 6:26 PM, Christofer Dutz wrote:
>> Hi,
>> 
>> 
>> I have just finished a small maven core extension containing an EventSpy. 
>> It's working nicely if I include it into my build using Maven 3.3.1 and a 
>> ".mvn/extensions.xml", but I couldn't get it working by copying the jar to 
>> the MAVEN_HOME/lib/ext directory (I even tried a shaded jar). All I am 
>> getting are these warnings:
>> 
>> 
>> [WARNING] Failed to notify spy 
>> org.apache.flex.utilities.converter.mavenextension.FlexEventSpy: 
>> java.util.NoSuchElementException
>>       role: org.apache.maven.execution.MavenSession
>>   roleHint:
>> 
>> ?What is the difference between the two options? What do I have to change in 
>> order to have my extension working in older Maven versions (down to 3.1.1) 
>> by installing it into the lib/ext directory?
>> 
>> Chris
>> 
>> 
> 
> Kind regards
> Karl Heinz Marbaise
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
> KCB  [  X  ܚX KK[XZ[
 \ \  ][  X  ܚX PX] [  \X K ܙ B  ܈Y][
> ۘ[  [X[  K[XZ[
 \ \  Z[X] [  \X K ܙ BB KKKKKKKKKKKKKKKKKK
> KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB  [  X  ܚX KK[
> XZ[
 \ \  ][  X  ܚX PX] [  \X K ܙ B  ܈Y][ۘ[  [X[  K[XZ[
 
> \ \  Z[X] [  \X K ܙ B

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder, Takari and Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/takari_io
---------------------------------------------------------

You are never dedicated to something you have complete confidence in.
No one is fanatically shouting that the sun is going to rise tomorrow.
They know it is going to rise tomorrow. When people are fanatically dedicated 
to political or religious faiths or any other kind of dogmas or goals, it's 
always because these dogmas or goals are in doubt.

  -- Robert Pirzig, Zen and the Art of Motorcycle Maintenance













---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to