You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Julian Sedding <js...@apache.org> on 2017/12/13 10:46:57 UTC

Maven Sling Plugin - fsmount

Hi all and Stefan in particular

I am in the process of setting up a maven build for a joint frontend
(HTML, CSS, JS) and backend team (Sling / AEM).

The goals for the frontend team workflow are:

- use Node.js based tooling / frontend build (integrated using
frontend-maven-plugin - works)
- develop HTL templates and sample content (JSON via initial content
and fsmount)
- develop using SCSS and TypeScript, which is compiled to CSS and JS
by the frontend build into target/classes
- use as little maven as possible
- day to day work is done on the FS using Node.js based tooling with a
"watch" job and with live-reload or similar
- development speed is essential, i.e. changes done on FS should be
visible in a browser in < 500ms

Due to the compilation step, which generates CSS and JS in
target/classes, I would like mvn sling:fsmount to set up a FS resource
provider mapping for target/classes rather than
src/main/content/jcr_root (or maybe both, with service.ranking so that
target/classes is preferred). As far as I can see the "fsmount" goal
currently determines which configurations to create from the
filter.xml file (in case of filevault packages), but there is no way
to explicitly configure other mappings.

- Are my above assumptions regarding the state of "fsmount" correct?
- Do you think extending the fsmount config to allow for explicit
mappings would be useful?
- Do you have experiences to share with similar setups?

Regards
Julian

Re: Maven Sling Plugin - fsmount

Posted by Julian Sedding <js...@apache.org>.
I discovered the configuration option "fileVaultJcrRootFile", which
allows me to do most of what I want. Not sure why I missed it before.

Regards
Julian

On Thu, Dec 14, 2017 at 9:53 AM, Julian Sedding <js...@gmail.com> wrote:
> Ok, great! That clarifies things.
>
> You're right of course that my setup depends on copying all
> content-package assets to target/classes. Given that I have a
> pre-compilation step for js and css files (from ts and scss), that
> seems to be not too bad.
>
> However, your questioning just made me wonder if I should only create
> the pre-compiled js and css into target/classes and add a files &
> folders config for target/classes in addition to the filevault_xml
> config for src/main/content/jcr_root.
>
> I'll experiment with these ideas and will come up with a suggestion
> for a change.
>
> Regards
> Julian
>
>
> On Thu, Dec 14, 2017 at 9:40 AM, Stefan Seifert <ss...@pro-vision.de> wrote:
>> if all your jcr content (the copied one and the generated one) resided in target/classes then you proposal would be fine.
>> however it depends on the setup of your filevault xml project if this ist he case - and often it's not.
>>
>> but if you have a build/resources/resource declaration in your project that copies everything to target/classes (which is not required, but is seen often in project setups), then it should work.
>>
>> yes, it would make sense to have an optional configuration property in the maven-sling-plugin to support this use case.
>>
>> stefan
>>
>>>-----Original Message-----
>>>From: Julian Sedding [mailto:jsedding@gmail.com]
>>>Sent: Thursday, December 14, 2017 9:35 AM
>>>To: Sling Developers List
>>>Subject: Re: Maven Sling Plugin - fsmount
>>>
>>>Hi Stefan
>>>
>>>Thanks again for your reply. However, I still don't understand why you
>>>think I need to use "files and folders" mode. I can run sling:fsmount
>>>on my content-package module, which creates a FILEVAULT_XML
>>>configuration, and then manually adjust the configuration to point to
>>>my "target/classes" directory instead of the
>>>"src/main/content/jcr_root" and this (seems?) to work fine in initial
>>>tests.
>>>
>>>What I would like to achieve is that I can (optionally) influence the
>>>configurations that sling:fsmount creates for me. I.e. the automatic
>>>discovery would not be changed, but it would be possible to create
>>>additional configurations or tweak discovered configurations (e.g.
>>>setting "Check Interval" lower can be useful with auto-refresh
>>>scenarios).
>>>
>>>I'll see if I can come up with a PR. Maybe it's easier to discuss it in
>>>code ;)
>>>
>>>Regards
>>>Julian
>>>
>>>
>>>On Wed, Dec 13, 2017 at 5:23 PM, Stefan Seifert <ss...@pro-vision.de>
>>>wrote:
>>>> currently the goal is to provide a "full automatic experience" - when
>>>calling "sling:fsmount" on a maven project it is detected automatically if
>>>it is a Sling-Initial-Content or filevault project and creates the OSGi
>>>mapping accordingly.
>>>>
>>>> you need a custom additional mapping beyond this automatic. this is
>>>already possible by creating a manual mapping in the osgi configuration,
>>>but in your case only for the "files and folder" mode, without interpreting
>>>.content.xml files - not sure if this is enough.
>>>>
>>>> if you need more i suppose it would not be too hard to extend the
>>>existing mapping configuration to support additional folders. perhaps an
>>>new mapping type or a variant of the filevault mapping type which does not
>>>rely on the filter.xml, but allows to specify the source path and the
>>>repository target path manually. this has to be added in the fsresource
>>>implementation; i'm not sure if it makes sense to integrate this special
>>>usecase also in the logic of the sling:fsmount goal.
>>>>
>>>> stefan
>>>>
>>>>
>>>>>-----Original Message-----
>>>>>From: Julian Sedding [mailto:jsedding@gmail.com]
>>>>>Sent: Wednesday, December 13, 2017 2:32 PM
>>>>>To: Sling Developers List
>>>>>Subject: Re: Maven Sling Plugin - fsmount
>>>>>
>>>>>Hi Stefan
>>>>>
>>>>>Thanks for your reply.
>>>>>
>>>>>I was hoping that we could avoid generating build artifacts inside the
>>>>>"src" folder. It just doesn't feel quite right. Also, I would like to
>>>>>locate the respective "*.ts" and "*.scss" files in the location where
>>>>>the compiled "*.js" and "*.css" files end up. I think that makes it
>>>>>easier to understand, especially for frontend devs with only a
>>>>>superficial understanding of Sling/AEM.
>>>>>
>>>>>Is there a big technical obstacle with adding the ability for custom
>>>>>additional mappings with filevault support? If so, can you expalin
>>>>>and/or give me a pointer? I'm happy to invest some time into improving
>>>>>the plugin, so any guidance is appreciated.
>>>>>
>>>>>Thanks
>>>>>Julian
>>>>>
>>>>>
>>>>>
>>>>>On Wed, Dec 13, 2017 at 1:23 PM, Stefan Seifert <ss...@pro-vision.de>
>>>>>wrote:
>>>>>> hello julian.
>>>>>>
>>>>>> yes, i think your assumptions are right. in case of filevault project
>>>>>there is currently no way to add some "custom additional mappings"
>>>>>(although you could of course add an additional mapping with only "files
>>>>>and folders" only for your target dir, when there are no content fragment
>>>>>in xml or json files involved.
>>>>>>
>>>>>> we solve this problem usually this way: configure the frontend tooling
>>>to
>>>>>compile directly in the destination folder (e.g.
>>>>>src/main/content/jcr_root), but exclude this folder from SCM management
>>>by
>>>>>providing a path for the affected subfolder containing compiled code via
>>>>>.gitignore. is this an option for you as well?
>>>>>>
>>>>>> stefan
>>>>>>
>>>>>>>-----Original Message-----
>>>>>>>From: Julian Sedding [mailto:jsedding@apache.org]
>>>>>>>Sent: Wednesday, December 13, 2017 11:47 AM
>>>>>>>To: Sling Developers List
>>>>>>>Subject: Maven Sling Plugin - fsmount
>>>>>>>
>>>>>>>Hi all and Stefan in particular
>>>>>>>
>>>>>>>I am in the process of setting up a maven build for a joint frontend
>>>>>>>(HTML, CSS, JS) and backend team (Sling / AEM).
>>>>>>>
>>>>>>>The goals for the frontend team workflow are:
>>>>>>>
>>>>>>>- use Node.js based tooling / frontend build (integrated using
>>>>>>>frontend-maven-plugin - works)
>>>>>>>- develop HTL templates and sample content (JSON via initial content
>>>>>>>and fsmount)
>>>>>>>- develop using SCSS and TypeScript, which is compiled to CSS and JS
>>>>>>>by the frontend build into target/classes
>>>>>>>- use as little maven as possible
>>>>>>>- day to day work is done on the FS using Node.js based tooling with a
>>>>>>>"watch" job and with live-reload or similar
>>>>>>>- development speed is essential, i.e. changes done on FS should be
>>>>>>>visible in a browser in < 500ms
>>>>>>>
>>>>>>>Due to the compilation step, which generates CSS and JS in
>>>>>>>target/classes, I would like mvn sling:fsmount to set up a FS resource
>>>>>>>provider mapping for target/classes rather than
>>>>>>>src/main/content/jcr_root (or maybe both, with service.ranking so that
>>>>>>>target/classes is preferred). As far as I can see the "fsmount" goal
>>>>>>>currently determines which configurations to create from the
>>>>>>>filter.xml file (in case of filevault packages), but there is no way
>>>>>>>to explicitly configure other mappings.
>>>>>>>
>>>>>>>- Are my above assumptions regarding the state of "fsmount" correct?
>>>>>>>- Do you think extending the fsmount config to allow for explicit
>>>>>>>mappings would be useful?
>>>>>>>- Do you have experiences to share with similar setups?
>>>>>>>
>>>>>>>Regards
>>>>>>>Julian
>>>>>>
>>>>
>>

Re: Maven Sling Plugin - fsmount

Posted by Julian Sedding <js...@gmail.com>.
Ok, great! That clarifies things.

You're right of course that my setup depends on copying all
content-package assets to target/classes. Given that I have a
pre-compilation step for js and css files (from ts and scss), that
seems to be not too bad.

However, your questioning just made me wonder if I should only create
the pre-compiled js and css into target/classes and add a files &
folders config for target/classes in addition to the filevault_xml
config for src/main/content/jcr_root.

I'll experiment with these ideas and will come up with a suggestion
for a change.

Regards
Julian


On Thu, Dec 14, 2017 at 9:40 AM, Stefan Seifert <ss...@pro-vision.de> wrote:
> if all your jcr content (the copied one and the generated one) resided in target/classes then you proposal would be fine.
> however it depends on the setup of your filevault xml project if this ist he case - and often it's not.
>
> but if you have a build/resources/resource declaration in your project that copies everything to target/classes (which is not required, but is seen often in project setups), then it should work.
>
> yes, it would make sense to have an optional configuration property in the maven-sling-plugin to support this use case.
>
> stefan
>
>>-----Original Message-----
>>From: Julian Sedding [mailto:jsedding@gmail.com]
>>Sent: Thursday, December 14, 2017 9:35 AM
>>To: Sling Developers List
>>Subject: Re: Maven Sling Plugin - fsmount
>>
>>Hi Stefan
>>
>>Thanks again for your reply. However, I still don't understand why you
>>think I need to use "files and folders" mode. I can run sling:fsmount
>>on my content-package module, which creates a FILEVAULT_XML
>>configuration, and then manually adjust the configuration to point to
>>my "target/classes" directory instead of the
>>"src/main/content/jcr_root" and this (seems?) to work fine in initial
>>tests.
>>
>>What I would like to achieve is that I can (optionally) influence the
>>configurations that sling:fsmount creates for me. I.e. the automatic
>>discovery would not be changed, but it would be possible to create
>>additional configurations or tweak discovered configurations (e.g.
>>setting "Check Interval" lower can be useful with auto-refresh
>>scenarios).
>>
>>I'll see if I can come up with a PR. Maybe it's easier to discuss it in
>>code ;)
>>
>>Regards
>>Julian
>>
>>
>>On Wed, Dec 13, 2017 at 5:23 PM, Stefan Seifert <ss...@pro-vision.de>
>>wrote:
>>> currently the goal is to provide a "full automatic experience" - when
>>calling "sling:fsmount" on a maven project it is detected automatically if
>>it is a Sling-Initial-Content or filevault project and creates the OSGi
>>mapping accordingly.
>>>
>>> you need a custom additional mapping beyond this automatic. this is
>>already possible by creating a manual mapping in the osgi configuration,
>>but in your case only for the "files and folder" mode, without interpreting
>>.content.xml files - not sure if this is enough.
>>>
>>> if you need more i suppose it would not be too hard to extend the
>>existing mapping configuration to support additional folders. perhaps an
>>new mapping type or a variant of the filevault mapping type which does not
>>rely on the filter.xml, but allows to specify the source path and the
>>repository target path manually. this has to be added in the fsresource
>>implementation; i'm not sure if it makes sense to integrate this special
>>usecase also in the logic of the sling:fsmount goal.
>>>
>>> stefan
>>>
>>>
>>>>-----Original Message-----
>>>>From: Julian Sedding [mailto:jsedding@gmail.com]
>>>>Sent: Wednesday, December 13, 2017 2:32 PM
>>>>To: Sling Developers List
>>>>Subject: Re: Maven Sling Plugin - fsmount
>>>>
>>>>Hi Stefan
>>>>
>>>>Thanks for your reply.
>>>>
>>>>I was hoping that we could avoid generating build artifacts inside the
>>>>"src" folder. It just doesn't feel quite right. Also, I would like to
>>>>locate the respective "*.ts" and "*.scss" files in the location where
>>>>the compiled "*.js" and "*.css" files end up. I think that makes it
>>>>easier to understand, especially for frontend devs with only a
>>>>superficial understanding of Sling/AEM.
>>>>
>>>>Is there a big technical obstacle with adding the ability for custom
>>>>additional mappings with filevault support? If so, can you expalin
>>>>and/or give me a pointer? I'm happy to invest some time into improving
>>>>the plugin, so any guidance is appreciated.
>>>>
>>>>Thanks
>>>>Julian
>>>>
>>>>
>>>>
>>>>On Wed, Dec 13, 2017 at 1:23 PM, Stefan Seifert <ss...@pro-vision.de>
>>>>wrote:
>>>>> hello julian.
>>>>>
>>>>> yes, i think your assumptions are right. in case of filevault project
>>>>there is currently no way to add some "custom additional mappings"
>>>>(although you could of course add an additional mapping with only "files
>>>>and folders" only for your target dir, when there are no content fragment
>>>>in xml or json files involved.
>>>>>
>>>>> we solve this problem usually this way: configure the frontend tooling
>>to
>>>>compile directly in the destination folder (e.g.
>>>>src/main/content/jcr_root), but exclude this folder from SCM management
>>by
>>>>providing a path for the affected subfolder containing compiled code via
>>>>.gitignore. is this an option for you as well?
>>>>>
>>>>> stefan
>>>>>
>>>>>>-----Original Message-----
>>>>>>From: Julian Sedding [mailto:jsedding@apache.org]
>>>>>>Sent: Wednesday, December 13, 2017 11:47 AM
>>>>>>To: Sling Developers List
>>>>>>Subject: Maven Sling Plugin - fsmount
>>>>>>
>>>>>>Hi all and Stefan in particular
>>>>>>
>>>>>>I am in the process of setting up a maven build for a joint frontend
>>>>>>(HTML, CSS, JS) and backend team (Sling / AEM).
>>>>>>
>>>>>>The goals for the frontend team workflow are:
>>>>>>
>>>>>>- use Node.js based tooling / frontend build (integrated using
>>>>>>frontend-maven-plugin - works)
>>>>>>- develop HTL templates and sample content (JSON via initial content
>>>>>>and fsmount)
>>>>>>- develop using SCSS and TypeScript, which is compiled to CSS and JS
>>>>>>by the frontend build into target/classes
>>>>>>- use as little maven as possible
>>>>>>- day to day work is done on the FS using Node.js based tooling with a
>>>>>>"watch" job and with live-reload or similar
>>>>>>- development speed is essential, i.e. changes done on FS should be
>>>>>>visible in a browser in < 500ms
>>>>>>
>>>>>>Due to the compilation step, which generates CSS and JS in
>>>>>>target/classes, I would like mvn sling:fsmount to set up a FS resource
>>>>>>provider mapping for target/classes rather than
>>>>>>src/main/content/jcr_root (or maybe both, with service.ranking so that
>>>>>>target/classes is preferred). As far as I can see the "fsmount" goal
>>>>>>currently determines which configurations to create from the
>>>>>>filter.xml file (in case of filevault packages), but there is no way
>>>>>>to explicitly configure other mappings.
>>>>>>
>>>>>>- Are my above assumptions regarding the state of "fsmount" correct?
>>>>>>- Do you think extending the fsmount config to allow for explicit
>>>>>>mappings would be useful?
>>>>>>- Do you have experiences to share with similar setups?
>>>>>>
>>>>>>Regards
>>>>>>Julian
>>>>>
>>>
>

RE: Maven Sling Plugin - fsmount

Posted by Stefan Seifert <ss...@pro-vision.de>.
if all your jcr content (the copied one and the generated one) resided in target/classes then you proposal would be fine.
however it depends on the setup of your filevault xml project if this ist he case - and often it's not.

but if you have a build/resources/resource declaration in your project that copies everything to target/classes (which is not required, but is seen often in project setups), then it should work.

yes, it would make sense to have an optional configuration property in the maven-sling-plugin to support this use case.

stefan

>-----Original Message-----
>From: Julian Sedding [mailto:jsedding@gmail.com]
>Sent: Thursday, December 14, 2017 9:35 AM
>To: Sling Developers List
>Subject: Re: Maven Sling Plugin - fsmount
>
>Hi Stefan
>
>Thanks again for your reply. However, I still don't understand why you
>think I need to use "files and folders" mode. I can run sling:fsmount
>on my content-package module, which creates a FILEVAULT_XML
>configuration, and then manually adjust the configuration to point to
>my "target/classes" directory instead of the
>"src/main/content/jcr_root" and this (seems?) to work fine in initial
>tests.
>
>What I would like to achieve is that I can (optionally) influence the
>configurations that sling:fsmount creates for me. I.e. the automatic
>discovery would not be changed, but it would be possible to create
>additional configurations or tweak discovered configurations (e.g.
>setting "Check Interval" lower can be useful with auto-refresh
>scenarios).
>
>I'll see if I can come up with a PR. Maybe it's easier to discuss it in
>code ;)
>
>Regards
>Julian
>
>
>On Wed, Dec 13, 2017 at 5:23 PM, Stefan Seifert <ss...@pro-vision.de>
>wrote:
>> currently the goal is to provide a "full automatic experience" - when
>calling "sling:fsmount" on a maven project it is detected automatically if
>it is a Sling-Initial-Content or filevault project and creates the OSGi
>mapping accordingly.
>>
>> you need a custom additional mapping beyond this automatic. this is
>already possible by creating a manual mapping in the osgi configuration,
>but in your case only for the "files and folder" mode, without interpreting
>.content.xml files - not sure if this is enough.
>>
>> if you need more i suppose it would not be too hard to extend the
>existing mapping configuration to support additional folders. perhaps an
>new mapping type or a variant of the filevault mapping type which does not
>rely on the filter.xml, but allows to specify the source path and the
>repository target path manually. this has to be added in the fsresource
>implementation; i'm not sure if it makes sense to integrate this special
>usecase also in the logic of the sling:fsmount goal.
>>
>> stefan
>>
>>
>>>-----Original Message-----
>>>From: Julian Sedding [mailto:jsedding@gmail.com]
>>>Sent: Wednesday, December 13, 2017 2:32 PM
>>>To: Sling Developers List
>>>Subject: Re: Maven Sling Plugin - fsmount
>>>
>>>Hi Stefan
>>>
>>>Thanks for your reply.
>>>
>>>I was hoping that we could avoid generating build artifacts inside the
>>>"src" folder. It just doesn't feel quite right. Also, I would like to
>>>locate the respective "*.ts" and "*.scss" files in the location where
>>>the compiled "*.js" and "*.css" files end up. I think that makes it
>>>easier to understand, especially for frontend devs with only a
>>>superficial understanding of Sling/AEM.
>>>
>>>Is there a big technical obstacle with adding the ability for custom
>>>additional mappings with filevault support? If so, can you expalin
>>>and/or give me a pointer? I'm happy to invest some time into improving
>>>the plugin, so any guidance is appreciated.
>>>
>>>Thanks
>>>Julian
>>>
>>>
>>>
>>>On Wed, Dec 13, 2017 at 1:23 PM, Stefan Seifert <ss...@pro-vision.de>
>>>wrote:
>>>> hello julian.
>>>>
>>>> yes, i think your assumptions are right. in case of filevault project
>>>there is currently no way to add some "custom additional mappings"
>>>(although you could of course add an additional mapping with only "files
>>>and folders" only for your target dir, when there are no content fragment
>>>in xml or json files involved.
>>>>
>>>> we solve this problem usually this way: configure the frontend tooling
>to
>>>compile directly in the destination folder (e.g.
>>>src/main/content/jcr_root), but exclude this folder from SCM management
>by
>>>providing a path for the affected subfolder containing compiled code via
>>>.gitignore. is this an option for you as well?
>>>>
>>>> stefan
>>>>
>>>>>-----Original Message-----
>>>>>From: Julian Sedding [mailto:jsedding@apache.org]
>>>>>Sent: Wednesday, December 13, 2017 11:47 AM
>>>>>To: Sling Developers List
>>>>>Subject: Maven Sling Plugin - fsmount
>>>>>
>>>>>Hi all and Stefan in particular
>>>>>
>>>>>I am in the process of setting up a maven build for a joint frontend
>>>>>(HTML, CSS, JS) and backend team (Sling / AEM).
>>>>>
>>>>>The goals for the frontend team workflow are:
>>>>>
>>>>>- use Node.js based tooling / frontend build (integrated using
>>>>>frontend-maven-plugin - works)
>>>>>- develop HTL templates and sample content (JSON via initial content
>>>>>and fsmount)
>>>>>- develop using SCSS and TypeScript, which is compiled to CSS and JS
>>>>>by the frontend build into target/classes
>>>>>- use as little maven as possible
>>>>>- day to day work is done on the FS using Node.js based tooling with a
>>>>>"watch" job and with live-reload or similar
>>>>>- development speed is essential, i.e. changes done on FS should be
>>>>>visible in a browser in < 500ms
>>>>>
>>>>>Due to the compilation step, which generates CSS and JS in
>>>>>target/classes, I would like mvn sling:fsmount to set up a FS resource
>>>>>provider mapping for target/classes rather than
>>>>>src/main/content/jcr_root (or maybe both, with service.ranking so that
>>>>>target/classes is preferred). As far as I can see the "fsmount" goal
>>>>>currently determines which configurations to create from the
>>>>>filter.xml file (in case of filevault packages), but there is no way
>>>>>to explicitly configure other mappings.
>>>>>
>>>>>- Are my above assumptions regarding the state of "fsmount" correct?
>>>>>- Do you think extending the fsmount config to allow for explicit
>>>>>mappings would be useful?
>>>>>- Do you have experiences to share with similar setups?
>>>>>
>>>>>Regards
>>>>>Julian
>>>>
>>


Re: Maven Sling Plugin - fsmount

Posted by Julian Sedding <js...@gmail.com>.
Hi Stefan

Thanks again for your reply. However, I still don't understand why you
think I need to use "files and folders" mode. I can run sling:fsmount
on my content-package module, which creates a FILEVAULT_XML
configuration, and then manually adjust the configuration to point to
my "target/classes" directory instead of the
"src/main/content/jcr_root" and this (seems?) to work fine in initial
tests.

What I would like to achieve is that I can (optionally) influence the
configurations that sling:fsmount creates for me. I.e. the automatic
discovery would not be changed, but it would be possible to create
additional configurations or tweak discovered configurations (e.g.
setting "Check Interval" lower can be useful with auto-refresh
scenarios).

I'll see if I can come up with a PR. Maybe it's easier to discuss it in code ;)

Regards
Julian


On Wed, Dec 13, 2017 at 5:23 PM, Stefan Seifert <ss...@pro-vision.de> wrote:
> currently the goal is to provide a "full automatic experience" - when calling "sling:fsmount" on a maven project it is detected automatically if it is a Sling-Initial-Content or filevault project and creates the OSGi mapping accordingly.
>
> you need a custom additional mapping beyond this automatic. this is already possible by creating a manual mapping in the osgi configuration, but in your case only for the "files and folder" mode, without interpreting .content.xml files - not sure if this is enough.
>
> if you need more i suppose it would not be too hard to extend the existing mapping configuration to support additional folders. perhaps an new mapping type or a variant of the filevault mapping type which does not rely on the filter.xml, but allows to specify the source path and the repository target path manually. this has to be added in the fsresource implementation; i'm not sure if it makes sense to integrate this special usecase also in the logic of the sling:fsmount goal.
>
> stefan
>
>
>>-----Original Message-----
>>From: Julian Sedding [mailto:jsedding@gmail.com]
>>Sent: Wednesday, December 13, 2017 2:32 PM
>>To: Sling Developers List
>>Subject: Re: Maven Sling Plugin - fsmount
>>
>>Hi Stefan
>>
>>Thanks for your reply.
>>
>>I was hoping that we could avoid generating build artifacts inside the
>>"src" folder. It just doesn't feel quite right. Also, I would like to
>>locate the respective "*.ts" and "*.scss" files in the location where
>>the compiled "*.js" and "*.css" files end up. I think that makes it
>>easier to understand, especially for frontend devs with only a
>>superficial understanding of Sling/AEM.
>>
>>Is there a big technical obstacle with adding the ability for custom
>>additional mappings with filevault support? If so, can you expalin
>>and/or give me a pointer? I'm happy to invest some time into improving
>>the plugin, so any guidance is appreciated.
>>
>>Thanks
>>Julian
>>
>>
>>
>>On Wed, Dec 13, 2017 at 1:23 PM, Stefan Seifert <ss...@pro-vision.de>
>>wrote:
>>> hello julian.
>>>
>>> yes, i think your assumptions are right. in case of filevault project
>>there is currently no way to add some "custom additional mappings"
>>(although you could of course add an additional mapping with only "files
>>and folders" only for your target dir, when there are no content fragment
>>in xml or json files involved.
>>>
>>> we solve this problem usually this way: configure the frontend tooling to
>>compile directly in the destination folder (e.g.
>>src/main/content/jcr_root), but exclude this folder from SCM management by
>>providing a path for the affected subfolder containing compiled code via
>>.gitignore. is this an option for you as well?
>>>
>>> stefan
>>>
>>>>-----Original Message-----
>>>>From: Julian Sedding [mailto:jsedding@apache.org]
>>>>Sent: Wednesday, December 13, 2017 11:47 AM
>>>>To: Sling Developers List
>>>>Subject: Maven Sling Plugin - fsmount
>>>>
>>>>Hi all and Stefan in particular
>>>>
>>>>I am in the process of setting up a maven build for a joint frontend
>>>>(HTML, CSS, JS) and backend team (Sling / AEM).
>>>>
>>>>The goals for the frontend team workflow are:
>>>>
>>>>- use Node.js based tooling / frontend build (integrated using
>>>>frontend-maven-plugin - works)
>>>>- develop HTL templates and sample content (JSON via initial content
>>>>and fsmount)
>>>>- develop using SCSS and TypeScript, which is compiled to CSS and JS
>>>>by the frontend build into target/classes
>>>>- use as little maven as possible
>>>>- day to day work is done on the FS using Node.js based tooling with a
>>>>"watch" job and with live-reload or similar
>>>>- development speed is essential, i.e. changes done on FS should be
>>>>visible in a browser in < 500ms
>>>>
>>>>Due to the compilation step, which generates CSS and JS in
>>>>target/classes, I would like mvn sling:fsmount to set up a FS resource
>>>>provider mapping for target/classes rather than
>>>>src/main/content/jcr_root (or maybe both, with service.ranking so that
>>>>target/classes is preferred). As far as I can see the "fsmount" goal
>>>>currently determines which configurations to create from the
>>>>filter.xml file (in case of filevault packages), but there is no way
>>>>to explicitly configure other mappings.
>>>>
>>>>- Are my above assumptions regarding the state of "fsmount" correct?
>>>>- Do you think extending the fsmount config to allow for explicit
>>>>mappings would be useful?
>>>>- Do you have experiences to share with similar setups?
>>>>
>>>>Regards
>>>>Julian
>>>
>

RE: Maven Sling Plugin - fsmount

Posted by Stefan Seifert <ss...@pro-vision.de>.
currently the goal is to provide a "full automatic experience" - when calling "sling:fsmount" on a maven project it is detected automatically if it is a Sling-Initial-Content or filevault project and creates the OSGi mapping accordingly.

you need a custom additional mapping beyond this automatic. this is already possible by creating a manual mapping in the osgi configuration, but in your case only for the "files and folder" mode, without interpreting .content.xml files - not sure if this is enough.

if you need more i suppose it would not be too hard to extend the existing mapping configuration to support additional folders. perhaps an new mapping type or a variant of the filevault mapping type which does not rely on the filter.xml, but allows to specify the source path and the repository target path manually. this has to be added in the fsresource implementation; i'm not sure if it makes sense to integrate this special usecase also in the logic of the sling:fsmount goal.

stefan


>-----Original Message-----
>From: Julian Sedding [mailto:jsedding@gmail.com]
>Sent: Wednesday, December 13, 2017 2:32 PM
>To: Sling Developers List
>Subject: Re: Maven Sling Plugin - fsmount
>
>Hi Stefan
>
>Thanks for your reply.
>
>I was hoping that we could avoid generating build artifacts inside the
>"src" folder. It just doesn't feel quite right. Also, I would like to
>locate the respective "*.ts" and "*.scss" files in the location where
>the compiled "*.js" and "*.css" files end up. I think that makes it
>easier to understand, especially for frontend devs with only a
>superficial understanding of Sling/AEM.
>
>Is there a big technical obstacle with adding the ability for custom
>additional mappings with filevault support? If so, can you expalin
>and/or give me a pointer? I'm happy to invest some time into improving
>the plugin, so any guidance is appreciated.
>
>Thanks
>Julian
>
>
>
>On Wed, Dec 13, 2017 at 1:23 PM, Stefan Seifert <ss...@pro-vision.de>
>wrote:
>> hello julian.
>>
>> yes, i think your assumptions are right. in case of filevault project
>there is currently no way to add some "custom additional mappings"
>(although you could of course add an additional mapping with only "files
>and folders" only for your target dir, when there are no content fragment
>in xml or json files involved.
>>
>> we solve this problem usually this way: configure the frontend tooling to
>compile directly in the destination folder (e.g.
>src/main/content/jcr_root), but exclude this folder from SCM management by
>providing a path for the affected subfolder containing compiled code via
>.gitignore. is this an option for you as well?
>>
>> stefan
>>
>>>-----Original Message-----
>>>From: Julian Sedding [mailto:jsedding@apache.org]
>>>Sent: Wednesday, December 13, 2017 11:47 AM
>>>To: Sling Developers List
>>>Subject: Maven Sling Plugin - fsmount
>>>
>>>Hi all and Stefan in particular
>>>
>>>I am in the process of setting up a maven build for a joint frontend
>>>(HTML, CSS, JS) and backend team (Sling / AEM).
>>>
>>>The goals for the frontend team workflow are:
>>>
>>>- use Node.js based tooling / frontend build (integrated using
>>>frontend-maven-plugin - works)
>>>- develop HTL templates and sample content (JSON via initial content
>>>and fsmount)
>>>- develop using SCSS and TypeScript, which is compiled to CSS and JS
>>>by the frontend build into target/classes
>>>- use as little maven as possible
>>>- day to day work is done on the FS using Node.js based tooling with a
>>>"watch" job and with live-reload or similar
>>>- development speed is essential, i.e. changes done on FS should be
>>>visible in a browser in < 500ms
>>>
>>>Due to the compilation step, which generates CSS and JS in
>>>target/classes, I would like mvn sling:fsmount to set up a FS resource
>>>provider mapping for target/classes rather than
>>>src/main/content/jcr_root (or maybe both, with service.ranking so that
>>>target/classes is preferred). As far as I can see the "fsmount" goal
>>>currently determines which configurations to create from the
>>>filter.xml file (in case of filevault packages), but there is no way
>>>to explicitly configure other mappings.
>>>
>>>- Are my above assumptions regarding the state of "fsmount" correct?
>>>- Do you think extending the fsmount config to allow for explicit
>>>mappings would be useful?
>>>- Do you have experiences to share with similar setups?
>>>
>>>Regards
>>>Julian
>>


Re: Maven Sling Plugin - fsmount

Posted by Julian Sedding <js...@gmail.com>.
Hi Stefan

Thanks for your reply.

I was hoping that we could avoid generating build artifacts inside the
"src" folder. It just doesn't feel quite right. Also, I would like to
locate the respective "*.ts" and "*.scss" files in the location where
the compiled "*.js" and "*.css" files end up. I think that makes it
easier to understand, especially for frontend devs with only a
superficial understanding of Sling/AEM.

Is there a big technical obstacle with adding the ability for custom
additional mappings with filevault support? If so, can you expalin
and/or give me a pointer? I'm happy to invest some time into improving
the plugin, so any guidance is appreciated.

Thanks
Julian



On Wed, Dec 13, 2017 at 1:23 PM, Stefan Seifert <ss...@pro-vision.de> wrote:
> hello julian.
>
> yes, i think your assumptions are right. in case of filevault project there is currently no way to add some "custom additional mappings" (although you could of course add an additional mapping with only "files and folders" only for your target dir, when there are no content fragment in xml or json files involved.
>
> we solve this problem usually this way: configure the frontend tooling to compile directly in the destination folder (e.g. src/main/content/jcr_root), but exclude this folder from SCM management by providing a path for the affected subfolder containing compiled code via .gitignore. is this an option for you as well?
>
> stefan
>
>>-----Original Message-----
>>From: Julian Sedding [mailto:jsedding@apache.org]
>>Sent: Wednesday, December 13, 2017 11:47 AM
>>To: Sling Developers List
>>Subject: Maven Sling Plugin - fsmount
>>
>>Hi all and Stefan in particular
>>
>>I am in the process of setting up a maven build for a joint frontend
>>(HTML, CSS, JS) and backend team (Sling / AEM).
>>
>>The goals for the frontend team workflow are:
>>
>>- use Node.js based tooling / frontend build (integrated using
>>frontend-maven-plugin - works)
>>- develop HTL templates and sample content (JSON via initial content
>>and fsmount)
>>- develop using SCSS and TypeScript, which is compiled to CSS and JS
>>by the frontend build into target/classes
>>- use as little maven as possible
>>- day to day work is done on the FS using Node.js based tooling with a
>>"watch" job and with live-reload or similar
>>- development speed is essential, i.e. changes done on FS should be
>>visible in a browser in < 500ms
>>
>>Due to the compilation step, which generates CSS and JS in
>>target/classes, I would like mvn sling:fsmount to set up a FS resource
>>provider mapping for target/classes rather than
>>src/main/content/jcr_root (or maybe both, with service.ranking so that
>>target/classes is preferred). As far as I can see the "fsmount" goal
>>currently determines which configurations to create from the
>>filter.xml file (in case of filevault packages), but there is no way
>>to explicitly configure other mappings.
>>
>>- Are my above assumptions regarding the state of "fsmount" correct?
>>- Do you think extending the fsmount config to allow for explicit
>>mappings would be useful?
>>- Do you have experiences to share with similar setups?
>>
>>Regards
>>Julian
>

RE: Maven Sling Plugin - fsmount

Posted by Stefan Seifert <ss...@pro-vision.de>.
hello julian.

yes, i think your assumptions are right. in case of filevault project there is currently no way to add some "custom additional mappings" (although you could of course add an additional mapping with only "files and folders" only for your target dir, when there are no content fragment in xml or json files involved.

we solve this problem usually this way: configure the frontend tooling to compile directly in the destination folder (e.g. src/main/content/jcr_root), but exclude this folder from SCM management by providing a path for the affected subfolder containing compiled code via .gitignore. is this an option for you as well?

stefan

>-----Original Message-----
>From: Julian Sedding [mailto:jsedding@apache.org]
>Sent: Wednesday, December 13, 2017 11:47 AM
>To: Sling Developers List
>Subject: Maven Sling Plugin - fsmount
>
>Hi all and Stefan in particular
>
>I am in the process of setting up a maven build for a joint frontend
>(HTML, CSS, JS) and backend team (Sling / AEM).
>
>The goals for the frontend team workflow are:
>
>- use Node.js based tooling / frontend build (integrated using
>frontend-maven-plugin - works)
>- develop HTL templates and sample content (JSON via initial content
>and fsmount)
>- develop using SCSS and TypeScript, which is compiled to CSS and JS
>by the frontend build into target/classes
>- use as little maven as possible
>- day to day work is done on the FS using Node.js based tooling with a
>"watch" job and with live-reload or similar
>- development speed is essential, i.e. changes done on FS should be
>visible in a browser in < 500ms
>
>Due to the compilation step, which generates CSS and JS in
>target/classes, I would like mvn sling:fsmount to set up a FS resource
>provider mapping for target/classes rather than
>src/main/content/jcr_root (or maybe both, with service.ranking so that
>target/classes is preferred). As far as I can see the "fsmount" goal
>currently determines which configurations to create from the
>filter.xml file (in case of filevault packages), but there is no way
>to explicitly configure other mappings.
>
>- Are my above assumptions regarding the state of "fsmount" correct?
>- Do you think extending the fsmount config to allow for explicit
>mappings would be useful?
>- Do you have experiences to share with similar setups?
>
>Regards
>Julian