OK,

here are the Jira issues, feel free to do what you like:

http://jira.codehaus.org/browse/MAPPASM-209

http://jira.codehaus.org/browse/MAPPASM-210

http://jira.codehaus.org/browse/MAPPASM-211

http://jira.codehaus.org/browse/MAPPASM-212

http://jira.codehaus.org/browse/MAPPASM-213



2013/10/29 Petar Tahchiev <[email protected]>

> Hi guys,
>
> if you really feel the changes are so bad, it makes no sense for me to
> create a Jira issues. And, yes, of course, you can use the antrun to
> achieve what I have done here, because you practically do absolutely
> anything with antrun. Or maybe you can call a bash script with the exec
> plugin. But is that really the point?
> - To use Antrun to copy my provided dependencies (oh, and how does ant
> know which dependencies are provided - I guess you have to manually list
> them!!!)?
> - Is it handy to allow the users to skip generation of repository when
> creating program assemblies
> (<generateRepository>false</generateRepository>), but when dealing with jsw
> daemons - oh no, God forbid this setting doesn't work!!!
> - Is it really convenient to have the program appassembly being able to
> copy the configuration directory
> (<copyConfigurationDirectory>true</copyConfigurationDirectory>), but
> exactly the same setting not working for jsw daemons????
>
> All I did was extract 2 attributes and 1 method in the super Mojo to allow
> the same behaviour for both appassembler:assemble and
> appassembler:generate-daemons<http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/generate-daemons-mojo.html>
>
> I would be glad if you provide me with a way to achieve the above without
> fancy ant setup, or using the exec plugin or any other "hack".
>
> Thank you for your time and keep up the good work.
>
>
>
> 2013/10/29 Dan Tran <[email protected]>
>
>> Fred, perhaps you never have a need to deal with installer for a big
>> project?
>>
>> I ended up using lots of other plugins to help out with the installer.
>> and antrun is handy as needed.
>>
>>
>> -D
>>
>>
>> On Mon, Oct 28, 2013 at 6:05 PM, Fred Cooke <[email protected]> wrote:
>>
>>> I'm unsure if his changes are good or bad, and I'm not going to comment
>>> on them, but I will say this:
>>>
>>> 1) I've never used antrun for anything, ever.
>>> 2) I intend to keep it that way, and likely never will.
>>>
>>> My 2c.
>>>
>>>
>>> On Mon, Oct 28, 2013 at 11:41 PM, Dan Tran <[email protected]> wrote:
>>>
>>>> Also keep in mind that you can use antrun to the pre and post work
>>>> which should cover most of your requirements
>>>>
>>>> -D
>>>>
>>>>
>>>> On Mon, Oct 28, 2013 at 3:39 PM, Dan Tran <[email protected]> wrote:
>>>>
>>>>> Hi Petar
>>>>>
>>>>> Please file a jira for this.
>>>>>
>>>>> Best if you provide separate jira for each changes
>>>>>
>>>>> -D
>>>>>
>>>>>
>>>>> On Mon, Oct 28, 2013 at 10:44 AM, Petar Tahchiev <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi guys,
>>>>>>
>>>>>> my name is Petar Tahchiev and I am a former Maven developer. Recently
>>>>>> I've been playing with the APPASSEMBLY plugin,
>>>>>> and I think I've done some improvements to it (see attached patch).
>>>>>> All I wanted was to creat a daemon for my project, zip it and deploy
>>>>>> it to a remote server. I figured out I need to create
>>>>>> a daemon with the following folder structure:
>>>>>>
>>>>>> +ROOT
>>>>>>  - bin/
>>>>>>  - conf/
>>>>>>  - lib/
>>>>>>  - logs/
>>>>>>  - webapps/ROOT/
>>>>>>
>>>>>> So my first step was to use the maven-war plugin to create the
>>>>>> exploded folder ROOT in the webapps directory. This worked well.
>>>>>> After that the maven appassembly plugin should create the rest of my
>>>>>> folder structure. And it really did, but with
>>>>>> these minor defects:
>>>>>> 1) I have a config folder in src/main/config/tomcat/ which contains
>>>>>> the server.xml and web.xml and a bunch of other
>>>>>> catalina conf files. When I used the
>>>>>>
>>>>>> <copyConfigurationDirectory>true</copyConfigurationDirectory>
>>>>>>
>>>>>> it didn't copy my configuration files. So digging in the code I saw
>>>>>> that this attribute was set on the AssemblyMojo (AM),
>>>>>> which extends AbstractScriptGeneratorMojo (ASGM), and for daemons I
>>>>>> was using the GenerateDaemonsMojo (GM) which extended
>>>>>> the same ASGM, so the structure is pretty much:
>>>>>>
>>>>>>      (AAM)
>>>>>>        ^
>>>>>>        |
>>>>>>      (ASGM)
>>>>>>        ^
>>>>>>        |
>>>>>>       / \
>>>>>>   (GDM) (AM)
>>>>>>
>>>>>> So what I did was to move the copyConfiguration property from (AM) to
>>>>>> (ASGM) so that both (GDM) and (AM) could use it. I had to also
>>>>>> copy the <configurationSourceDirectory> and <configurationDirectory>
>>>>>> attributes, the copyConfigurationDirectory and installDependencies
>>>>>> methods. After this it worked great - my config files were copied.
>>>>>> 2) I didn't want to generate a repository in my lib folder, because I
>>>>>> was generating exploded war file in webapps/ROOT and inside it's
>>>>>> WEB-INF/lib folder were all the jar files that I needed so I didn't
>>>>>> want to have any duplication. Unfortunately the same situation as before 
>>>>>> -
>>>>>> the generateRepository was specified on (AM) and I needed it both on
>>>>>> (AM) and (GDM), so I simply moved it to (ASGM). Now that this problem
>>>>>> was solved, my lib/ repository folder contained only the
>>>>>> tanukisoftware libraries. Perfect!!!
>>>>>> 3) Another problem I faced was, that some of my libraries were with
>>>>>> scope provided (like mysql connectors, and servlet-api and 
>>>>>> tomcat-embedded
>>>>>> jars, etc.). But they weren't copied to the repository lib/ folder.
>>>>>> So I made a small change, after installing the dependencies in the
>>>>>> lib repository I added another method to copy all the dependencies
>>>>>> with scope "provided" in the lib repository. And if you really think 
>>>>>> about
>>>>>> it it's where they belong - if they should be provided and we are
>>>>>> creating a server daemon, they must be provided in the lib folder.
>>>>>> 4) My last change was to add two new attributes <tempDirectory> and
>>>>>> <logsDirectory>. If those are provided, the maven plugin will create the
>>>>>> provided folders just before the end. I had a problem that when
>>>>>> starting the tomcat daemon it was trying to write it's PID file inside 
>>>>>> the
>>>>>> logs
>>>>>> directory, which weren't there so I had to every time call antrun
>>>>>> plugin to create that folder, which seemed a huge overkill. Anyways if 
>>>>>> the
>>>>>> folders are not provided, no folders are created.
>>>>>>
>>>>>> With all those changes I am happily creating my zips, with either
>>>>>> jetty or tomcat (depending on the profile you run maven in), and I really
>>>>>> believe that these changes will help someone else too.
>>>>>>
>>>>>> Please let me know what you think and if the source looks good
>>>>>> enough, apply it in the trunk.
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> P.S. I have also modified one of the tests to test if a null-or-empty
>>>>>> <commandLineArgument> was passed. Before I was getting a Null-pointer
>>>>>> exception so I added a null check in there.
>>>>>>
>>>>>> --
>>>>>> Regards, Petar!
>>>>>> Karlovo, Bulgaria.
>>>>>> ---
>>>>>> Public PGP Key at:
>>>>>> https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611
>>>>>> Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe from this list, please visit:
>>>>>>
>>>>>>     http://xircles.codehaus.org/manage_email
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
>
> --
> Regards, Petar!
> Karlovo, Bulgaria.
> ---
> Public PGP Key at:
> https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611
> Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611
>



-- 
Regards, Petar!
Karlovo, Bulgaria.
---
Public PGP Key at:
https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611

Reply via email to