Hi Mikko,

The assembly plugin by default puts its result in target/ and names it
${finalName}-${version}-${classifier}.${type}, e.g. encc-1.0-bin.zip. I
would write your plugin so it accepts the input jar's filename as a
parameter, which defaults to the same naming scheme (or whatever is
convenient for you). Normally assembly's output is a finished product, so to
speak, but in your case it is an intermediate product; the build isn't
finished with it yet. Right? It is intermediate just like class files before
instrumentation. You control the build, so you can say where assembly puts
the jar and where the other plugins find it. If you were doing this in ant,
your "jar" and "obfuscate" tasks would need to cooperate; it's no different
here.

If you prefer to put the unobfuscated jar somewhere else, I believe you can
set that with the assembly descriptor or perhaps the assembly plugin's
<configuration> section.

Paul


Mikko wrote:
> 
> Thanks, but still its not clicking in my brain ;) I fail to see how my
> plugin will be able to do the preverification and obfuscation if the
> assembly plugin does not attach its result. Basically as far as I can see
> my biggest issue is that my plugin does not know what the assembly plugin
> produced.
> 
> I guess I'm missing something, can you explain perhaps with more detail.
> 
> thanks,
> Mikko
> 
> 
> pjungwir wrote:
>> 
>> I think you have the right approach, but there are two missing bits:
>> 
>>   - make sure the assembly plugin doesn't "attach" its result.
>>   - make sure the last step does attach its result.
>> 
>> An attached file is one that maven considers an artifact and will upload
>> when you run install/deploy/etc. By default, the assembly plugin tells
>> maven that its outputs are attached. Probably if you read the assembly
>> documentation you can turn this off.
>> 
>> The last step of your build should attach the final artifact. I guess
>> preverification doesn't actually produce a new jar, so the final artifact
>> would be the result of obfuscating?
>> 
>> There is no way in the pom to attach an artifact; it requires plugin
>> code. An obfuscator plugin should know how to do this, unless you're just
>> running some command line tool or an ant task.
>> 
>> I've been meaning to write a plugin that just attaches things, but I
>> haven't even started yet. Maybe you'd like to do it? :-) It would be very
>> simple, and I think a lot of people would find it useful. If maven
>> supports it, maybe it should also have an unattach feature.
>> 
>> Paul
>> 
>> 
>> 
>> Mikko wrote:
>>> 
>>> Hi,
>>> 
>>> First the environment: 
>>> 
>>> 1. Multimodule midp2.0 application - must have (OK)
>>> 2. Assembly is required - must have (OK)
>>> 3. Assembled code jar obfuscation - optinal (NOK)
>>> 3. Assembled code jar preverification - must have (NOK)
>>> 
>>> What I'm trying to do is to write a plugin(s) for our MIDP project so
>>> that above steps are accomplished. My problem is that after the assembly
>>> is complete some jar is constructed and once either the obfuscation or
>>> the preverification needs to take place the plugin does not know the
>>> name of the jar that was produced by the maven-assembly-plugin.
>>> 
>>> It might be that I'm approaching this the wrong way, but could someone
>>> point me to the right direction, either by suggesting another approach
>>> or whatever... ;) Basically once the assembly is complete I need to do
>>> the obfuscation and preverification with the result.
>>> 
>>> thanks in advance,
>>> Mikko
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Maven-plugin-interaction-tf2628577s177.html#a7367049
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to