You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by HRH <hr...@yahoo.com.INVALID> on 2020/09/17 12:11:00 UTC

Resource sub-folder for Maven based JavaFX

Hi,
The "Simple JavaFX Maven Archetype (Gluon)" template from the "New Projects->Java with Maven" does not create a resource sub-folder under the src subtree, so the developer can store required artifacts (i.e. jpg images,etc.) for the project in that folder. If the artifacts placed in the src directory with the main and the controller source code, the maven does not copy them to the target->classes, hence the developer needs to manually copy these artifacts src->main to the "target->classes" after each build, to avoid runtime errors.

In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template always creates "Other Sources/src/main/resources/${project.package}" tree structure for the artifacts (i.e. fxml, css, images, etc.) and the maven copies them to the "target->classes->${package}" sub-folder.

If possible, it would be great if these two templates create a consistent tree structure.

Re: Resource sub-folder for Maven based JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
 Thank you Gj, that's a good answer.

    On Monday, October 12, 2020, 12:11:49 PM GMT+3:30, Geertjan Wielenga <ge...@apache.org> wrote:  
 
 
And the reason is that those two templates are simply the Gluon Maven archetypes over which NetBeans has no control and the archetype in question does not have that resources folder because, in contrast to the other archetype, it has no resources and empty folders are not created by Maven atchetypes. 
Gj
On Mon, 12 Oct 2020 at 10:32, HRH <hr...@yahoo.com.invalid> wrote:

 
I stumbled on the solution for this conundrum rather fortuitously.It turns out that one cannot just drop any resource file into the “src->main->resources”folder and hope for maven to copy them to the target directory structure wherethe .class files reside (i.e. “target->classes->org.me.foo”). As I statedpreviously on this thread, maven will copy those resource files to the “target->classes”.However, if one creates a directory structure corresponding to the modulepackage name under the “src->main->resources” (i.e.src->main->resources->org.me.foo) and place the resource files in thisdirectory then they will get copies to the “target->classes.org.me.foo”.

This is why the “FXML JavaFX Maven…” project type finds itsresources (i.e. fxml, gifs, xml file, etc.) at runtime and the “Simple JavaFxMaven…” project type can’t alas ends up with NullPointerException, unless the usermanually creates the folder structure under the src->main->resources(i.e. src->main-resources-org.me.foo).

In summary, the inconsistency stems from the fact that the IDEcreates a proper directory structure for resources under the “FXML JavaFX Maven…”projects but it doesn’t do so for the “Simple JavaFx Maven…” projects. A bug (Ileave it to the judicious mind)?

    On Friday, October 2, 2020, 7:11:55 AM GMT+3:30, HRH <hr...@yahoo.com.invalid> wrote:  
 
  You asked for the directory structure and that's what I sent in my response to show the tree (without the contents). That doesn't imply those directories are empty. For instance, the "resources" sub-folder in the "src" contains "cappuccino.jpeg" and this file gets copied over during the project build to the "target->classes->org->openjfx->mavenfxmlwebview" folder where the "*.class" files reside for the FXML JavaFX project type. In Simple JavaFx project type, the"cappuccino.jpeg" file under the "src->main->resources" gets copied over to the "target->classes" instead of "target->classes->org->openjfx->mavenfxsliderbar" and that's the crux. This inconsistent behavior leads to a null pointer exception at the run time, because loading resources API is seeking to load the resource file from the current directory where .class files reside.
Reproducing this problem is a cinch. One needs to create two very simple projects. One project should be of type FXML JavaFX application and the other of type Simple JavaFX application. The application should try to do a simple loading of an icon file from the src-main-resources folder to the main window.

Thanks.

    On Friday, October 2, 2020, 12:18:53 AM GMT+3:30, Ernie Rael <er...@raelity.com> wrote:  
 
 In an earlier msg you said
> FXML ... creates "Other Sources/src/main/resources/${project.package}" 
> tree structure

But that is not what you are showing, you show nothing under resources.

Seems Gj is correct. I'm sure you can find somewhere to help with you're 
maven problem.

-ernie

On 10/1/2020 12:40 PM, HRH wrote:
> The directory structure for the FXML JavaFX project:
> |->src
> |        |->main
> |        | |->java
> |        |            |          |->org
> |        |            |                   |->openjfx
> |        |            |                                  
> |->mavenfxmlwebview
> |        | |->resources
> |        |->test
> target
>          |->classes
> |->org
> |->openjfx
> |->mavenfxmlwebview
>
> The directory structure for the Simple JavaFX project:
> |->src
> |        |->main
> |        | |->java
> |        |            |          |->org
> |        |            |                   |->openjfx
> |        |            |                                  
> |->mavenfxsliderbar
> |        | |->resources
> |        |->test
> target
>          |->classes
> |->org
> |->openjfx
> |->mavenfxsliderbar
>
> Hope the bars are still lining up properly after I submit this email.
>
> Thanks
>
>
>
>
> On Thursday, October 1, 2020, 10:45:19 PM GMT+3:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> @HRH,
>
> Could you provide the directory structure under src/main/resources for
> both the working project and the failing project.
>
> -ernie
>
> On 10/1/2020 11:17 AM, HRH wrote:
> > No, the folder contains an image file (.jpeg)
> >
> > On Tuesday, September 29, 2020, 9:21:41 PM GMT+3:30, Geertjan Wielenga
> > <geertjan@apache.org <ma...@apache.org>> wrote:
> >
> >
> > Because the folder is empty?
> >
> > Gj
> >
> > On Tue, 29 Sep 2020 at 19:45, HRH <hrh747@yahoo.com.invalid 
> <ma...@yahoo.com.invalid>> wrote:
> >
> >
> >
> >
> >    Well, I looked into the IDE generated POMs for both project types
> >    assiduously and there are no major differences, that would lead
> >    one to believe Maven is the culprit here. In summary, during the
> >    project build, the resource sub-folder (within the Maven compliant
> >    folder structure) is copied from the "src" sub-tree to the
> >    "target" sub-tree, by the IDE for the "FXML JavaFX Maven
> >    Archetype" projects but this step is completely elided for the
> >    "Simple JavaFX Maven Archetype) projects.
> >
> >    Thanks
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    On Thursday, September 17, 2020, 11:21:48 PM GMT+4:30, HRH
> >    <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>> wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    That's precisely what I was doing, by looking into the Maven docs,
> >    and trying to find a way to copy this file to the right
> >    destination folder. The generated pom.xml files for both templates
> >    seem identical with the exception of the main class name and the
> >    project name, so there must be a reason why they behave differently.
> >
> >    Thanks
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael
> >    <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    On 9/17/2020 11:33 AM, HRH wrote:
> >    > Ok, I need to be more specific vis-a-vis my last reply. Initially,
> >    > when I created the src/main/resources sub-folder and put my
> >    image.jpg
> >    > in that directory, Maven copied it the .jpg file to the
> >    > "target/classes" directory instead of
> >    > "target/classes/org/openjfx/${package} where all the class files
> >    > reside. In contrast, for the "FXML JavaFX Archetype (Gluon)"
> >    template,
> >    > Maven copies the content of the "src/main/resources" to
> >    > "target/classes/org/openjfx/${package} and the runtime can load
> >    the file.
> >
> >    It's up to you to figure out what/if maven is doing differently
> >    for one
> >    project and not the other. It's not a NetBeans issue. Take a look
> >    at the
> >    structure under resources
> >
> >    -ernie
> >
> >    >
> >    > I hope this clarifies the ambiguity in the last reply.
> >    >
> >    > On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH
> >    > <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid> 
> <mailto:hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>>> 
> wrote:
> >    >
> >    >
> >    > Ernie
> >    >
> >    > I have done that (making a "resources" sub-folder under the
> >    src/main)
> >    > but Maven does not copy its content to the "target" subtree. Not
> >    sure why?
> >    >
> >    > On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael
> >    > <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
> >    >
> >    >
> >    > On 9/17/2020 9:58 AM, HRH wrote:
> >    > >
> >    > > Hi Ernie,
> >    > >
> >    > > I hear what you're saying about the empty directory. I kept the
> >    > > artifact in the src/main and manually copied it to the
> >    target/classes
> >    > > tree after the build. However, "Run Main Project" tends to
> >    rebuild and
> >    > > wipe the "target" sub-tree (because I am missing the nb-javac
> >    plugin),
> >    > > which then leads to a runtime error due to missing artifact.
> >    > > Currently, I going through Maven documentation to figure out a
> >    way (I
> >    > > recall seeing a Maven plugin somewhere) to copy this file from
> >    > > "main/src" to "target/classes" as the last step in the build 
> and I
> >    > > believe this will circumvent my issue.
> >    >
> >    > I'm confused. Why don't you create the resources directory,
> >    > .../src/main/resources/ and move the files to there and be done
> >    with the
> >    > problem?
> >    >
> >    > You do not seem to have a maven compliant file layout. Why not
> >    make it
> >    > compliant and be done with this whole issue of manually copying
> >    files
> >    > around?
> >    >
> >    > -ernie
> >    >
> >    > >
> >    > > Thanks as always for your insight
> >    > > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> >    > > <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>
> >    <mailto:errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>>> wrote:
> >    > >
> >    > >
> >    > > On 9/17/2020 5:11 AM, HRH wrote:
> >    > > > Hi,
> >    > > >
> >    > > > The "Simple JavaFX Maven Archetype (Gluon)" template from
> >    the "New
> >    > > > Projects->Java with Maven" does not create a resource
> >    sub-folder under
> >    > > > the src subtree, so the developer can store required
> >    artifacts (i.e.
> >    > > > jpg images,etc.) for the project in that folder. If the
> >    artifacts
> >    > > > placed in the src directory with the main and the controller
> >    source
> >    > > > code, the maven does not copy them to the target->classes,
> >    hence the
> >    > > > developer needs to manually copy
> >    > > The developer can put the resources where they belong for the
> >    maven
> >    > > build system when the developer initially adds them.
> >    > >
> >    > > > these artifacts src->main to the "target->classes" after
> >    each build,
> >    > > > to avoid runtime errors.
> >    > > >
> >    > > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)"
> >    template always
> >    > > > creates "Other
> >    Sources/src/main/resources/${project.package}" tree
> >    > > > structure for the artifacts (i.e. fxml, css, images, etc.)
> >    and the
> >    > > > maven copies them to the "target->classes->${package}"
> >    sub-folder.
> >    > > >
> >    > > > If possible, it would be great if these two templates create a
> >    > > > consistent tree structure.
> >    > >
> >    > >
> >    > > The FXML project has resources, so it creates the directory
> >    and puts the
> >    > > resources there; the other project type does not does not have
> >    resources
> >    > > and so does not create the directory. You're suggesting
> >    creating empty
> >    > > directories, which SCM will get rid of.
> >    > >
> >    > > Just create the directory when you need it. (I kind of agree
> >    with you,
> >    > > but there are so many valid directory structures for a
> >    project... The
> >    > > SCM issue is the clincher, empty directories do not stay
> >    around) If you
> >    > > don't know where the resources are supposed to go, then having
> >    some
> >    > > directory hanging around won't help anyway.
> >    > >
> >    > > -ernie
> >    > >
> >    > >
> >    > >
> > ---------------------------------------------------------------------
> >    > > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    > > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>>
> >    > > For additional commands, e-mail:
> > users-help@netbeans.apache.org <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    > > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>>
> >    > >
> >    > > For further information about the NetBeans mailing lists, visit:
> >    > >
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> >
> >    >
> >    > >
> >    > >
> >    >
> >    >
> >    >
> > ---------------------------------------------------------------------
> >    > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    > For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    >
> >    > For further information about the NetBeans mailing lists, visit:
> >    > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >    >
> >
> >
> > ---------------------------------------------------------------------
> >    To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >
> >    For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

    
  

Re: Resource sub-folder for Maven based JavaFX

Posted by Geertjan Wielenga <ge...@apache.org>.
And the reason is that those two templates are simply the Gluon Maven
archetypes over which NetBeans has no control and the archetype in question
does not have that resources folder because, in contrast to the other
archetype, it has no resources and empty folders are not created by Maven
atchetypes.

Gj

On Mon, 12 Oct 2020 at 10:32, HRH <hr...@yahoo.com.invalid> wrote:

> I stumbled on the solution for this conundrum rather fortuitously. It
> turns out that one cannot just drop any resource file into the
> “src->main->resources” folder and hope for maven to copy them to the target
> directory structure where the .class files reside (i.e.
> “target->classes->org.me.foo”). As I stated previously on this thread,
> maven will copy those resource files to the “target->classes”. However, if
> one creates a directory structure corresponding to the module package name
> under the “src->main->resources” (i.e. src->main->resources->org.me.foo)
> and place the resource files in this directory then they will get copies to
> the “target->classes.org.me.foo”.
>
> This is why the “FXML JavaFX Maven…” project type finds its resources
> (i.e. fxml, gifs, xml file, etc.) at runtime and the “Simple JavaFx Maven…”
> project type can’t alas ends up with NullPointerException, unless the user
> manually creates the folder structure under the src->main->resources (i.e.
> src->main-resources-org.me.foo).
>
> In summary, the inconsistency stems from the fact that the IDE creates a
> proper directory structure for resources under the “FXML JavaFX Maven…”
> projects but it doesn’t do so for the “Simple JavaFx Maven…” projects. A
> bug (I leave it to the judicious mind)?
>
> On Friday, October 2, 2020, 7:11:55 AM GMT+3:30, HRH
> <hr...@yahoo.com.invalid> wrote:
>
>
> You asked for the directory structure and that's what I sent in my
> response to show the tree (without the contents). That doesn't imply those
> directories are empty. For instance, the "resources" sub-folder in the
> "src" contains "cappuccino.jpeg" and this file gets copied over during
> the project build to the "target->classes->org->openjfx->mavenfxmlwebview"
> folder where the "*.class" files reside for the FXML JavaFX project type.
> In Simple JavaFx project type, the"cappuccino.jpeg" file under the
> "src->main->resources" gets copied over to the "target->classes" instead of
> "target->classes->org->openjfx->mavenfxsliderbar" and that's the crux. This
> inconsistent behavior leads to a null pointer exception at the run time,
> because loading resources API is seeking to load the resource file from the
> current directory where .class files reside.
>
> Reproducing this problem is a cinch. One needs to create two very simple
> projects. One project should be of type FXML JavaFX application and the
> other of type Simple JavaFX application. The application should try to do a
> simple loading of an icon file from the src-main-resources folder to the
> main window.
>
> Thanks.
>
> On Friday, October 2, 2020, 12:18:53 AM GMT+3:30, Ernie Rael <
> errael@raelity.com> wrote:
>
>
> In an earlier msg you said
> > FXML ... creates "Other Sources/src/main/resources/${project.package}"
> > tree structure
>
> But that is not what you are showing, you show nothing under resources.
>
> Seems Gj is correct. I'm sure you can find somewhere to help with you're
> maven problem.
>
> -ernie
>
> On 10/1/2020 12:40 PM, HRH wrote:
> > The directory structure for the FXML JavaFX project:
> > |->src
> > |        |->main
> > |        | |->java
> > |        |            |          |->org
> > |        |            |                   |->openjfx
> > |        |            |
> > |->mavenfxmlwebview
> > |        | |->resources
> > |        |->test
> > target
> >          |->classes
> > |->org
> > |->openjfx
> > |->mavenfxmlwebview
> >
> > The directory structure for the Simple JavaFX project:
> > |->src
> > |        |->main
> > |        | |->java
> > |        |            |          |->org
> > |        |            |                   |->openjfx
> > |        |            |
> > |->mavenfxsliderbar
> > |        | |->resources
> > |        |->test
> > target
> >          |->classes
> > |->org
> > |->openjfx
> > |->mavenfxsliderbar
> >
> > Hope the bars are still lining up properly after I submit this email.
> >
> > Thanks
> >
> >
> >
> >
> > On Thursday, October 1, 2020, 10:45:19 PM GMT+3:30, Ernie Rael
> > <er...@raelity.com> wrote:
> >
> >
> > @HRH,
> >
> > Could you provide the directory structure under src/main/resources for
> > both the working project and the failing project.
> >
> > -ernie
> >
> > On 10/1/2020 11:17 AM, HRH wrote:
> > > No, the folder contains an image file (.jpeg)
> > >
> > > On Tuesday, September 29, 2020, 9:21:41 PM GMT+3:30, Geertjan Wielenga
> > > <geertjan@apache.org <ma...@apache.org>> wrote:
> > >
> > >
> > > Because the folder is empty?
> > >
> > > Gj
> > >
> > > On Tue, 29 Sep 2020 at 19:45, HRH <hrh747@yahoo.com.invalid
> > <ma...@yahoo.com.invalid>> wrote:
> > >
> > >
> > >
> > >
> > >    Well, I looked into the IDE generated POMs for both project types
> > >    assiduously and there are no major differences, that would lead
> > >    one to believe Maven is the culprit here. In summary, during the
> > >    project build, the resource sub-folder (within the Maven compliant
> > >    folder structure) is copied from the "src" sub-tree to the
> > >    "target" sub-tree, by the IDE for the "FXML JavaFX Maven
> > >    Archetype" projects but this step is completely elided for the
> > >    "Simple JavaFX Maven Archetype) projects.
> > >
> > >    Thanks
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >    On Thursday, September 17, 2020, 11:21:48 PM GMT+4:30, HRH
> > >    <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>> wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >    That's precisely what I was doing, by looking into the Maven docs,
> > >    and trying to find a way to copy this file to the right
> > >    destination folder. The generated pom.xml files for both templates
> > >    seem identical with the exception of the main class name and the
> > >    project name, so there must be a reason why they behave differently.
> > >
> > >    Thanks
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >    On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael
> > >    <errael@raelity.com <ma...@raelity.com>
> > <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >    On 9/17/2020 11:33 AM, HRH wrote:
> > >    > Ok, I need to be more specific vis-a-vis my last reply. Initially,
> > >    > when I created the src/main/resources sub-folder and put my
> > >    image.jpg
> > >    > in that directory, Maven copied it the .jpg file to the
> > >    > "target/classes" directory instead of
> > >    > "target/classes/org/openjfx/${package} where all the class files
> > >    > reside. In contrast, for the "FXML JavaFX Archetype (Gluon)"
> > >    template,
> > >    > Maven copies the content of the "src/main/resources" to
> > >    > "target/classes/org/openjfx/${package} and the runtime can load
> > >    the file.
> > >
> > >    It's up to you to figure out what/if maven is doing differently
> > >    for one
> > >    project and not the other. It's not a NetBeans issue. Take a look
> > >    at the
> > >    structure under resources
> > >
> > >    -ernie
> > >
> > >    >
> > >    > I hope this clarifies the ambiguity in the last reply.
> > >    >
> > >    > On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH
> > >    > <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>
> > <mailto:hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>>>
> > wrote:
> > >    >
> > >    >
> > >    > Ernie
> > >    >
> > >    > I have done that (making a "resources" sub-folder under the
> > >    src/main)
> > >    > but Maven does not copy its content to the "target" subtree. Not
> > >    sure why?
> > >    >
> > >    > On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael
> > >    > <errael@raelity.com <ma...@raelity.com>
> > <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
> > >    >
> > >    >
> > >    > On 9/17/2020 9:58 AM, HRH wrote:
> > >    > >
> > >    > > Hi Ernie,
> > >    > >
> > >    > > I hear what you're saying about the empty directory. I kept the
> > >    > > artifact in the src/main and manually copied it to the
> > >    target/classes
> > >    > > tree after the build. However, "Run Main Project" tends to
> > >    rebuild and
> > >    > > wipe the "target" sub-tree (because I am missing the nb-javac
> > >    plugin),
> > >    > > which then leads to a runtime error due to missing artifact.
> > >    > > Currently, I going through Maven documentation to figure out a
> > >    way (I
> > >    > > recall seeing a Maven plugin somewhere) to copy this file from
> > >    > > "main/src" to "target/classes" as the last step in the build
> > and I
> > >    > > believe this will circumvent my issue.
> > >    >
> > >    > I'm confused. Why don't you create the resources directory,
> > >    > .../src/main/resources/ and move the files to there and be done
> > >    with the
> > >    > problem?
> > >    >
> > >    > You do not seem to have a maven compliant file layout. Why not
> > >    make it
> > >    > compliant and be done with this whole issue of manually copying
> > >    files
> > >    > around?
> > >    >
> > >    > -ernie
> > >    >
> > >    > >
> > >    > > Thanks as always for your insight
> > >    > > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> > >    > > <errael@raelity.com <ma...@raelity.com>
> > <mailto:errael@raelity.com <ma...@raelity.com>>
> > >    <mailto:errael@raelity.com <ma...@raelity.com>
> > <mailto:errael@raelity.com <ma...@raelity.com>>>> wrote:
> > >    > >
> > >    > >
> > >    > > On 9/17/2020 5:11 AM, HRH wrote:
> > >    > > > Hi,
> > >    > > >
> > >    > > > The "Simple JavaFX Maven Archetype (Gluon)" template from
> > >    the "New
> > >    > > > Projects->Java with Maven" does not create a resource
> > >    sub-folder under
> > >    > > > the src subtree, so the developer can store required
> > >    artifacts (i.e.
> > >    > > > jpg images,etc.) for the project in that folder. If the
> > >    artifacts
> > >    > > > placed in the src directory with the main and the controller
> > >    source
> > >    > > > code, the maven does not copy them to the target->classes,
> > >    hence the
> > >    > > > developer needs to manually copy
> > >    > > The developer can put the resources where they belong for the
> > >    maven
> > >    > > build system when the developer initially adds them.
> > >    > >
> > >    > > > these artifacts src->main to the "target->classes" after
> > >    each build,
> > >    > > > to avoid runtime errors.
> > >    > > >
> > >    > > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)"
> > >    template always
> > >    > > > creates "Other
> > >    Sources/src/main/resources/${project.package}" tree
> > >    > > > structure for the artifacts (i.e. fxml, css, images, etc.)
> > >    and the
> > >    > > > maven copies them to the "target->classes->${package}"
> > >    sub-folder.
> > >    > > >
> > >    > > > If possible, it would be great if these two templates create a
> > >    > > > consistent tree structure.
> > >    > >
> > >    > >
> > >    > > The FXML project has resources, so it creates the directory
> > >    and puts the
> > >    > > resources there; the other project type does not does not have
> > >    resources
> > >    > > and so does not create the directory. You're suggesting
> > >    creating empty
> > >    > > directories, which SCM will get rid of.
> > >    > >
> > >    > > Just create the directory when you need it. (I kind of agree
> > >    with you,
> > >    > > but there are so many valid directory structures for a
> > >    project... The
> > >    > > SCM issue is the clincher, empty directories do not stay
> > >    around) If you
> > >    > > don't know where the resources are supposed to go, then having
> > >    some
> > >    > > directory hanging around won't help anyway.
> > >    > >
> > >    > > -ernie
> > >    > >
> > >    > >
> > >    > >
> > > ---------------------------------------------------------------------
> > >    > > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > >    <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > >    > <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > >    <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>>>
> > >    > > <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > >    <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > >    > <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > >    <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>>>>
> > >    > > For additional commands, e-mail:
> > > users-help@netbeans.apache.org <ma...@netbeans.apache.org>
> > >    <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > >    > <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > >    <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>>>
> > >    > > <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > >    <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > >    > <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > >    <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>>>>
> > >    > >
> > >    > > For further information about the NetBeans mailing lists, visit:
> > >    > >
> > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> > >
> > >    >
> > >    > >
> > >    > >
> > >    >
> > >    >
> > >    >
> > > ---------------------------------------------------------------------
> > >    > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > >    <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > >    > <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > >    <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>>>
> > >    > For additional commands, e-mail: users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > >    <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > >    > <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > >    <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>>>
> > >    >
> > >    > For further information about the NetBeans mailing lists, visit:
> > >    >
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> > >    >
> > >
> > >
> > > ---------------------------------------------------------------------
> > >    To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > >    <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > >    For additional commands, e-mail: users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > >    <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > >
> > >    For further information about the NetBeans mailing lists, visit:
> > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > For additional commands, e-mail: users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>

Re: Resource sub-folder for Maven based JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
 
I stumbled on the solution for this conundrum rather fortuitously.It turns out that one cannot just drop any resource file into the “src->main->resources”folder and hope for maven to copy them to the target directory structure wherethe .class files reside (i.e. “target->classes->org.me.foo”). As I statedpreviously on this thread, maven will copy those resource files to the “target->classes”.However, if one creates a directory structure corresponding to the modulepackage name under the “src->main->resources” (i.e.src->main->resources->org.me.foo) and place the resource files in thisdirectory then they will get copies to the “target->classes.org.me.foo”.

This is why the “FXML JavaFX Maven…” project type finds itsresources (i.e. fxml, gifs, xml file, etc.) at runtime and the “Simple JavaFxMaven…” project type can’t alas ends up with NullPointerException, unless the usermanually creates the folder structure under the src->main->resources(i.e. src->main-resources-org.me.foo).

In summary, the inconsistency stems from the fact that the IDEcreates a proper directory structure for resources under the “FXML JavaFX Maven…”projects but it doesn’t do so for the “Simple JavaFx Maven…” projects. A bug (Ileave it to the judicious mind)?

    On Friday, October 2, 2020, 7:11:55 AM GMT+3:30, HRH <hr...@yahoo.com.invalid> wrote:  
 
  You asked for the directory structure and that's what I sent in my response to show the tree (without the contents). That doesn't imply those directories are empty. For instance, the "resources" sub-folder in the "src" contains "cappuccino.jpeg" and this file gets copied over during the project build to the "target->classes->org->openjfx->mavenfxmlwebview" folder where the "*.class" files reside for the FXML JavaFX project type. In Simple JavaFx project type, the"cappuccino.jpeg" file under the "src->main->resources" gets copied over to the "target->classes" instead of "target->classes->org->openjfx->mavenfxsliderbar" and that's the crux. This inconsistent behavior leads to a null pointer exception at the run time, because loading resources API is seeking to load the resource file from the current directory where .class files reside.
Reproducing this problem is a cinch. One needs to create two very simple projects. One project should be of type FXML JavaFX application and the other of type Simple JavaFX application. The application should try to do a simple loading of an icon file from the src-main-resources folder to the main window.

Thanks.

    On Friday, October 2, 2020, 12:18:53 AM GMT+3:30, Ernie Rael <er...@raelity.com> wrote:  
 
 In an earlier msg you said
> FXML ... creates "Other Sources/src/main/resources/${project.package}" 
> tree structure

But that is not what you are showing, you show nothing under resources.

Seems Gj is correct. I'm sure you can find somewhere to help with you're 
maven problem.

-ernie

On 10/1/2020 12:40 PM, HRH wrote:
> The directory structure for the FXML JavaFX project:
> |->src
> |        |->main
> |        | |->java
> |        |            |          |->org
> |        |            |                   |->openjfx
> |        |            |                                  
> |->mavenfxmlwebview
> |        | |->resources
> |        |->test
> target
>          |->classes
> |->org
> |->openjfx
> |->mavenfxmlwebview
>
> The directory structure for the Simple JavaFX project:
> |->src
> |        |->main
> |        | |->java
> |        |            |          |->org
> |        |            |                   |->openjfx
> |        |            |                                  
> |->mavenfxsliderbar
> |        | |->resources
> |        |->test
> target
>          |->classes
> |->org
> |->openjfx
> |->mavenfxsliderbar
>
> Hope the bars are still lining up properly after I submit this email.
>
> Thanks
>
>
>
>
> On Thursday, October 1, 2020, 10:45:19 PM GMT+3:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> @HRH,
>
> Could you provide the directory structure under src/main/resources for
> both the working project and the failing project.
>
> -ernie
>
> On 10/1/2020 11:17 AM, HRH wrote:
> > No, the folder contains an image file (.jpeg)
> >
> > On Tuesday, September 29, 2020, 9:21:41 PM GMT+3:30, Geertjan Wielenga
> > <geertjan@apache.org <ma...@apache.org>> wrote:
> >
> >
> > Because the folder is empty?
> >
> > Gj
> >
> > On Tue, 29 Sep 2020 at 19:45, HRH <hrh747@yahoo.com.invalid 
> <ma...@yahoo.com.invalid>> wrote:
> >
> >
> >
> >
> >    Well, I looked into the IDE generated POMs for both project types
> >    assiduously and there are no major differences, that would lead
> >    one to believe Maven is the culprit here. In summary, during the
> >    project build, the resource sub-folder (within the Maven compliant
> >    folder structure) is copied from the "src" sub-tree to the
> >    "target" sub-tree, by the IDE for the "FXML JavaFX Maven
> >    Archetype" projects but this step is completely elided for the
> >    "Simple JavaFX Maven Archetype) projects.
> >
> >    Thanks
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    On Thursday, September 17, 2020, 11:21:48 PM GMT+4:30, HRH
> >    <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>> wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    That's precisely what I was doing, by looking into the Maven docs,
> >    and trying to find a way to copy this file to the right
> >    destination folder. The generated pom.xml files for both templates
> >    seem identical with the exception of the main class name and the
> >    project name, so there must be a reason why they behave differently.
> >
> >    Thanks
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael
> >    <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    On 9/17/2020 11:33 AM, HRH wrote:
> >    > Ok, I need to be more specific vis-a-vis my last reply. Initially,
> >    > when I created the src/main/resources sub-folder and put my
> >    image.jpg
> >    > in that directory, Maven copied it the .jpg file to the
> >    > "target/classes" directory instead of
> >    > "target/classes/org/openjfx/${package} where all the class files
> >    > reside. In contrast, for the "FXML JavaFX Archetype (Gluon)"
> >    template,
> >    > Maven copies the content of the "src/main/resources" to
> >    > "target/classes/org/openjfx/${package} and the runtime can load
> >    the file.
> >
> >    It's up to you to figure out what/if maven is doing differently
> >    for one
> >    project and not the other. It's not a NetBeans issue. Take a look
> >    at the
> >    structure under resources
> >
> >    -ernie
> >
> >    >
> >    > I hope this clarifies the ambiguity in the last reply.
> >    >
> >    > On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH
> >    > <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid> 
> <mailto:hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>>> 
> wrote:
> >    >
> >    >
> >    > Ernie
> >    >
> >    > I have done that (making a "resources" sub-folder under the
> >    src/main)
> >    > but Maven does not copy its content to the "target" subtree. Not
> >    sure why?
> >    >
> >    > On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael
> >    > <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
> >    >
> >    >
> >    > On 9/17/2020 9:58 AM, HRH wrote:
> >    > >
> >    > > Hi Ernie,
> >    > >
> >    > > I hear what you're saying about the empty directory. I kept the
> >    > > artifact in the src/main and manually copied it to the
> >    target/classes
> >    > > tree after the build. However, "Run Main Project" tends to
> >    rebuild and
> >    > > wipe the "target" sub-tree (because I am missing the nb-javac
> >    plugin),
> >    > > which then leads to a runtime error due to missing artifact.
> >    > > Currently, I going through Maven documentation to figure out a
> >    way (I
> >    > > recall seeing a Maven plugin somewhere) to copy this file from
> >    > > "main/src" to "target/classes" as the last step in the build 
> and I
> >    > > believe this will circumvent my issue.
> >    >
> >    > I'm confused. Why don't you create the resources directory,
> >    > .../src/main/resources/ and move the files to there and be done
> >    with the
> >    > problem?
> >    >
> >    > You do not seem to have a maven compliant file layout. Why not
> >    make it
> >    > compliant and be done with this whole issue of manually copying
> >    files
> >    > around?
> >    >
> >    > -ernie
> >    >
> >    > >
> >    > > Thanks as always for your insight
> >    > > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> >    > > <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>
> >    <mailto:errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>>> wrote:
> >    > >
> >    > >
> >    > > On 9/17/2020 5:11 AM, HRH wrote:
> >    > > > Hi,
> >    > > >
> >    > > > The "Simple JavaFX Maven Archetype (Gluon)" template from
> >    the "New
> >    > > > Projects->Java with Maven" does not create a resource
> >    sub-folder under
> >    > > > the src subtree, so the developer can store required
> >    artifacts (i.e.
> >    > > > jpg images,etc.) for the project in that folder. If the
> >    artifacts
> >    > > > placed in the src directory with the main and the controller
> >    source
> >    > > > code, the maven does not copy them to the target->classes,
> >    hence the
> >    > > > developer needs to manually copy
> >    > > The developer can put the resources where they belong for the
> >    maven
> >    > > build system when the developer initially adds them.
> >    > >
> >    > > > these artifacts src->main to the "target->classes" after
> >    each build,
> >    > > > to avoid runtime errors.
> >    > > >
> >    > > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)"
> >    template always
> >    > > > creates "Other
> >    Sources/src/main/resources/${project.package}" tree
> >    > > > structure for the artifacts (i.e. fxml, css, images, etc.)
> >    and the
> >    > > > maven copies them to the "target->classes->${package}"
> >    sub-folder.
> >    > > >
> >    > > > If possible, it would be great if these two templates create a
> >    > > > consistent tree structure.
> >    > >
> >    > >
> >    > > The FXML project has resources, so it creates the directory
> >    and puts the
> >    > > resources there; the other project type does not does not have
> >    resources
> >    > > and so does not create the directory. You're suggesting
> >    creating empty
> >    > > directories, which SCM will get rid of.
> >    > >
> >    > > Just create the directory when you need it. (I kind of agree
> >    with you,
> >    > > but there are so many valid directory structures for a
> >    project... The
> >    > > SCM issue is the clincher, empty directories do not stay
> >    around) If you
> >    > > don't know where the resources are supposed to go, then having
> >    some
> >    > > directory hanging around won't help anyway.
> >    > >
> >    > > -ernie
> >    > >
> >    > >
> >    > >
> > ---------------------------------------------------------------------
> >    > > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    > > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>>
> >    > > For additional commands, e-mail:
> > users-help@netbeans.apache.org <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    > > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>>
> >    > >
> >    > > For further information about the NetBeans mailing lists, visit:
> >    > >
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> >
> >    >
> >    > >
> >    > >
> >    >
> >    >
> >    >
> > ---------------------------------------------------------------------
> >    > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    > For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    >
> >    > For further information about the NetBeans mailing lists, visit:
> >    > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >    >
> >
> >
> > ---------------------------------------------------------------------
> >    To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >
> >    For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

    

Re: Resource sub-folder for Maven based JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
 You asked for the directory structure and that's what I sent in my response to show the tree (without the contents). That doesn't imply those directories are empty. For instance, the "resources" sub-folder in the "src" contains "cappuccino.jpeg" and this file gets copied over during the project build to the "target->classes->org->openjfx->mavenfxmlwebview" folder where the "*.class" files reside for the FXML JavaFX project type. In Simple JavaFx project type, the"cappuccino.jpeg" file under the "src->main->resources" gets copied over to the "target->classes" instead of "target->classes->org->openjfx->mavenfxsliderbar" and that's the crux. This inconsistent behavior leads to a null pointer exception at the run time, because loading resources API is seeking to load the resource file from the current directory where .class files reside.
Reproducing this problem is a cinch. One needs to create two very simple projects. One project should be of type FXML JavaFX application and the other of type Simple JavaFX application. The application should try to do a simple loading of an icon file from the src-main-resources folder to the main window.

Thanks.

    On Friday, October 2, 2020, 12:18:53 AM GMT+3:30, Ernie Rael <er...@raelity.com> wrote:  
 
 In an earlier msg you said
> FXML ... creates "Other Sources/src/main/resources/${project.package}" 
> tree structure

But that is not what you are showing, you show nothing under resources.

Seems Gj is correct. I'm sure you can find somewhere to help with you're 
maven problem.

-ernie

On 10/1/2020 12:40 PM, HRH wrote:
> The directory structure for the FXML JavaFX project:
> |->src
> |        |->main
> |        | |->java
> |        |            |          |->org
> |        |            |                   |->openjfx
> |        |            |                                  
> |->mavenfxmlwebview
> |        | |->resources
> |        |->test
> target
>          |->classes
> |->org
> |->openjfx
> |->mavenfxmlwebview
>
> The directory structure for the Simple JavaFX project:
> |->src
> |        |->main
> |        | |->java
> |        |            |          |->org
> |        |            |                   |->openjfx
> |        |            |                                  
> |->mavenfxsliderbar
> |        | |->resources
> |        |->test
> target
>          |->classes
> |->org
> |->openjfx
> |->mavenfxsliderbar
>
> Hope the bars are still lining up properly after I submit this email.
>
> Thanks
>
>
>
>
> On Thursday, October 1, 2020, 10:45:19 PM GMT+3:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> @HRH,
>
> Could you provide the directory structure under src/main/resources for
> both the working project and the failing project.
>
> -ernie
>
> On 10/1/2020 11:17 AM, HRH wrote:
> > No, the folder contains an image file (.jpeg)
> >
> > On Tuesday, September 29, 2020, 9:21:41 PM GMT+3:30, Geertjan Wielenga
> > <geertjan@apache.org <ma...@apache.org>> wrote:
> >
> >
> > Because the folder is empty?
> >
> > Gj
> >
> > On Tue, 29 Sep 2020 at 19:45, HRH <hrh747@yahoo.com.invalid 
> <ma...@yahoo.com.invalid>> wrote:
> >
> >
> >
> >
> >    Well, I looked into the IDE generated POMs for both project types
> >    assiduously and there are no major differences, that would lead
> >    one to believe Maven is the culprit here. In summary, during the
> >    project build, the resource sub-folder (within the Maven compliant
> >    folder structure) is copied from the "src" sub-tree to the
> >    "target" sub-tree, by the IDE for the "FXML JavaFX Maven
> >    Archetype" projects but this step is completely elided for the
> >    "Simple JavaFX Maven Archetype) projects.
> >
> >    Thanks
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    On Thursday, September 17, 2020, 11:21:48 PM GMT+4:30, HRH
> >    <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>> wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    That's precisely what I was doing, by looking into the Maven docs,
> >    and trying to find a way to copy this file to the right
> >    destination folder. The generated pom.xml files for both templates
> >    seem identical with the exception of the main class name and the
> >    project name, so there must be a reason why they behave differently.
> >
> >    Thanks
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael
> >    <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    On 9/17/2020 11:33 AM, HRH wrote:
> >    > Ok, I need to be more specific vis-a-vis my last reply. Initially,
> >    > when I created the src/main/resources sub-folder and put my
> >    image.jpg
> >    > in that directory, Maven copied it the .jpg file to the
> >    > "target/classes" directory instead of
> >    > "target/classes/org/openjfx/${package} where all the class files
> >    > reside. In contrast, for the "FXML JavaFX Archetype (Gluon)"
> >    template,
> >    > Maven copies the content of the "src/main/resources" to
> >    > "target/classes/org/openjfx/${package} and the runtime can load
> >    the file.
> >
> >    It's up to you to figure out what/if maven is doing differently
> >    for one
> >    project and not the other. It's not a NetBeans issue. Take a look
> >    at the
> >    structure under resources
> >
> >    -ernie
> >
> >    >
> >    > I hope this clarifies the ambiguity in the last reply.
> >    >
> >    > On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH
> >    > <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid> 
> <mailto:hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>>> 
> wrote:
> >    >
> >    >
> >    > Ernie
> >    >
> >    > I have done that (making a "resources" sub-folder under the
> >    src/main)
> >    > but Maven does not copy its content to the "target" subtree. Not
> >    sure why?
> >    >
> >    > On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael
> >    > <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
> >    >
> >    >
> >    > On 9/17/2020 9:58 AM, HRH wrote:
> >    > >
> >    > > Hi Ernie,
> >    > >
> >    > > I hear what you're saying about the empty directory. I kept the
> >    > > artifact in the src/main and manually copied it to the
> >    target/classes
> >    > > tree after the build. However, "Run Main Project" tends to
> >    rebuild and
> >    > > wipe the "target" sub-tree (because I am missing the nb-javac
> >    plugin),
> >    > > which then leads to a runtime error due to missing artifact.
> >    > > Currently, I going through Maven documentation to figure out a
> >    way (I
> >    > > recall seeing a Maven plugin somewhere) to copy this file from
> >    > > "main/src" to "target/classes" as the last step in the build 
> and I
> >    > > believe this will circumvent my issue.
> >    >
> >    > I'm confused. Why don't you create the resources directory,
> >    > .../src/main/resources/ and move the files to there and be done
> >    with the
> >    > problem?
> >    >
> >    > You do not seem to have a maven compliant file layout. Why not
> >    make it
> >    > compliant and be done with this whole issue of manually copying
> >    files
> >    > around?
> >    >
> >    > -ernie
> >    >
> >    > >
> >    > > Thanks as always for your insight
> >    > > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> >    > > <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>
> >    <mailto:errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>>> wrote:
> >    > >
> >    > >
> >    > > On 9/17/2020 5:11 AM, HRH wrote:
> >    > > > Hi,
> >    > > >
> >    > > > The "Simple JavaFX Maven Archetype (Gluon)" template from
> >    the "New
> >    > > > Projects->Java with Maven" does not create a resource
> >    sub-folder under
> >    > > > the src subtree, so the developer can store required
> >    artifacts (i.e.
> >    > > > jpg images,etc.) for the project in that folder. If the
> >    artifacts
> >    > > > placed in the src directory with the main and the controller
> >    source
> >    > > > code, the maven does not copy them to the target->classes,
> >    hence the
> >    > > > developer needs to manually copy
> >    > > The developer can put the resources where they belong for the
> >    maven
> >    > > build system when the developer initially adds them.
> >    > >
> >    > > > these artifacts src->main to the "target->classes" after
> >    each build,
> >    > > > to avoid runtime errors.
> >    > > >
> >    > > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)"
> >    template always
> >    > > > creates "Other
> >    Sources/src/main/resources/${project.package}" tree
> >    > > > structure for the artifacts (i.e. fxml, css, images, etc.)
> >    and the
> >    > > > maven copies them to the "target->classes->${package}"
> >    sub-folder.
> >    > > >
> >    > > > If possible, it would be great if these two templates create a
> >    > > > consistent tree structure.
> >    > >
> >    > >
> >    > > The FXML project has resources, so it creates the directory
> >    and puts the
> >    > > resources there; the other project type does not does not have
> >    resources
> >    > > and so does not create the directory. You're suggesting
> >    creating empty
> >    > > directories, which SCM will get rid of.
> >    > >
> >    > > Just create the directory when you need it. (I kind of agree
> >    with you,
> >    > > but there are so many valid directory structures for a
> >    project... The
> >    > > SCM issue is the clincher, empty directories do not stay
> >    around) If you
> >    > > don't know where the resources are supposed to go, then having
> >    some
> >    > > directory hanging around won't help anyway.
> >    > >
> >    > > -ernie
> >    > >
> >    > >
> >    > >
> > ---------------------------------------------------------------------
> >    > > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    > > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>>
> >    > > For additional commands, e-mail:
> > users-help@netbeans.apache.org <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    > > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>>
> >    > >
> >    > > For further information about the NetBeans mailing lists, visit:
> >    > >
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> >
> >    >
> >    > >
> >    > >
> >    >
> >    >
> >    >
> > ---------------------------------------------------------------------
> >    > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    > For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    >
> >    > For further information about the NetBeans mailing lists, visit:
> >    > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >    >
> >
> >
> > ---------------------------------------------------------------------
> >    To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >
> >    For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

  

Re: Resource sub-folder for Maven based JavaFX

Posted by Ernie Rael <er...@raelity.com>.
In an earlier msg you said
> FXML ... creates "Other Sources/src/main/resources/${project.package}" 
> tree structure

But that is not what you are showing, you show nothing under resources.

Seems Gj is correct. I'm sure you can find somewhere to help with you're 
maven problem.

-ernie

On 10/1/2020 12:40 PM, HRH wrote:
> The directory structure for the FXML JavaFX project:
> |->src
> |        |->main
> |        | |->java
> |        |            |          |->org
> |        |            |                   |->openjfx
> |        |            |                                  
> |->mavenfxmlwebview
> |        | |->resources
> |        |->test
> target
>          |->classes
> |->org
> |->openjfx
> |->mavenfxmlwebview
>
> The directory structure for the Simple JavaFX project:
> |->src
> |        |->main
> |        | |->java
> |        |            |          |->org
> |        |            |                   |->openjfx
> |        |            |                                  
> |->mavenfxsliderbar
> |        | |->resources
> |        |->test
> target
>          |->classes
> |->org
> |->openjfx
> |->mavenfxsliderbar
>
> Hope the bars are still lining up properly after I submit this email.
>
> Thanks
>
>
>
>
> On Thursday, October 1, 2020, 10:45:19 PM GMT+3:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> @HRH,
>
> Could you provide the directory structure under src/main/resources for
> both the working project and the failing project.
>
> -ernie
>
> On 10/1/2020 11:17 AM, HRH wrote:
> > No, the folder contains an image file (.jpeg)
> >
> > On Tuesday, September 29, 2020, 9:21:41 PM GMT+3:30, Geertjan Wielenga
> > <geertjan@apache.org <ma...@apache.org>> wrote:
> >
> >
> > Because the folder is empty?
> >
> > Gj
> >
> > On Tue, 29 Sep 2020 at 19:45, HRH <hrh747@yahoo.com.invalid 
> <ma...@yahoo.com.invalid>> wrote:
> >
> >
> >
> >
> >    Well, I looked into the IDE generated POMs for both project types
> >    assiduously and there are no major differences, that would lead
> >    one to believe Maven is the culprit here. In summary, during the
> >    project build, the resource sub-folder (within the Maven compliant
> >    folder structure) is copied from the "src" sub-tree to the
> >    "target" sub-tree, by the IDE for the "FXML JavaFX Maven
> >    Archetype" projects but this step is completely elided for the
> >    "Simple JavaFX Maven Archetype) projects.
> >
> >    Thanks
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    On Thursday, September 17, 2020, 11:21:48 PM GMT+4:30, HRH
> >    <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>> wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    That's precisely what I was doing, by looking into the Maven docs,
> >    and trying to find a way to copy this file to the right
> >    destination folder. The generated pom.xml files for both templates
> >    seem identical with the exception of the main class name and the
> >    project name, so there must be a reason why they behave differently.
> >
> >    Thanks
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael
> >    <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >    On 9/17/2020 11:33 AM, HRH wrote:
> >    > Ok, I need to be more specific vis-a-vis my last reply. Initially,
> >    > when I created the src/main/resources sub-folder and put my
> >    image.jpg
> >    > in that directory, Maven copied it the .jpg file to the
> >    > "target/classes" directory instead of
> >    > "target/classes/org/openjfx/${package} where all the class files
> >    > reside. In contrast, for the "FXML JavaFX Archetype (Gluon)"
> >    template,
> >    > Maven copies the content of the "src/main/resources" to
> >    > "target/classes/org/openjfx/${package} and the runtime can load
> >    the file.
> >
> >    It's up to you to figure out what/if maven is doing differently
> >    for one
> >    project and not the other. It's not a NetBeans issue. Take a look
> >    at the
> >    structure under resources
> >
> >    -ernie
> >
> >    >
> >    > I hope this clarifies the ambiguity in the last reply.
> >    >
> >    > On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH
> >    > <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid> 
> <mailto:hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>>> 
> wrote:
> >    >
> >    >
> >    > Ernie
> >    >
> >    > I have done that (making a "resources" sub-folder under the
> >    src/main)
> >    > but Maven does not copy its content to the "target" subtree. Not
> >    sure why?
> >    >
> >    > On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael
> >    > <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
> >    >
> >    >
> >    > On 9/17/2020 9:58 AM, HRH wrote:
> >    > >
> >    > > Hi Ernie,
> >    > >
> >    > > I hear what you're saying about the empty directory. I kept the
> >    > > artifact in the src/main and manually copied it to the
> >    target/classes
> >    > > tree after the build. However, "Run Main Project" tends to
> >    rebuild and
> >    > > wipe the "target" sub-tree (because I am missing the nb-javac
> >    plugin),
> >    > > which then leads to a runtime error due to missing artifact.
> >    > > Currently, I going through Maven documentation to figure out a
> >    way (I
> >    > > recall seeing a Maven plugin somewhere) to copy this file from
> >    > > "main/src" to "target/classes" as the last step in the build 
> and I
> >    > > believe this will circumvent my issue.
> >    >
> >    > I'm confused. Why don't you create the resources directory,
> >    > .../src/main/resources/ and move the files to there and be done
> >    with the
> >    > problem?
> >    >
> >    > You do not seem to have a maven compliant file layout. Why not
> >    make it
> >    > compliant and be done with this whole issue of manually copying
> >    files
> >    > around?
> >    >
> >    > -ernie
> >    >
> >    > >
> >    > > Thanks as always for your insight
> >    > > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> >    > > <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>
> >    <mailto:errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>>> wrote:
> >    > >
> >    > >
> >    > > On 9/17/2020 5:11 AM, HRH wrote:
> >    > > > Hi,
> >    > > >
> >    > > > The "Simple JavaFX Maven Archetype (Gluon)" template from
> >    the "New
> >    > > > Projects->Java with Maven" does not create a resource
> >    sub-folder under
> >    > > > the src subtree, so the developer can store required
> >    artifacts (i.e.
> >    > > > jpg images,etc.) for the project in that folder. If the
> >    artifacts
> >    > > > placed in the src directory with the main and the controller
> >    source
> >    > > > code, the maven does not copy them to the target->classes,
> >    hence the
> >    > > > developer needs to manually copy
> >    > > The developer can put the resources where they belong for the
> >    maven
> >    > > build system when the developer initially adds them.
> >    > >
> >    > > > these artifacts src->main to the "target->classes" after
> >    each build,
> >    > > > to avoid runtime errors.
> >    > > >
> >    > > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)"
> >    template always
> >    > > > creates "Other
> >    Sources/src/main/resources/${project.package}" tree
> >    > > > structure for the artifacts (i.e. fxml, css, images, etc.)
> >    and the
> >    > > > maven copies them to the "target->classes->${package}"
> >    sub-folder.
> >    > > >
> >    > > > If possible, it would be great if these two templates create a
> >    > > > consistent tree structure.
> >    > >
> >    > >
> >    > > The FXML project has resources, so it creates the directory
> >    and puts the
> >    > > resources there; the other project type does not does not have
> >    resources
> >    > > and so does not create the directory. You're suggesting
> >    creating empty
> >    > > directories, which SCM will get rid of.
> >    > >
> >    > > Just create the directory when you need it. (I kind of agree
> >    with you,
> >    > > but there are so many valid directory structures for a
> >    project... The
> >    > > SCM issue is the clincher, empty directories do not stay
> >    around) If you
> >    > > don't know where the resources are supposed to go, then having
> >    some
> >    > > directory hanging around won't help anyway.
> >    > >
> >    > > -ernie
> >    > >
> >    > >
> >    > >
> > ---------------------------------------------------------------------
> >    > > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    > > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>>
> >    > > For additional commands, e-mail:
> > users-help@netbeans.apache.org <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    > > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>>
> >    > >
> >    > > For further information about the NetBeans mailing lists, visit:
> >    > >
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> >
> >    >
> >    > >
> >    > >
> >    >
> >    >
> >    >
> > ---------------------------------------------------------------------
> >    > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    > For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> >    >
> >    > For further information about the NetBeans mailing lists, visit:
> >    > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >    >
> >
> >
> > ---------------------------------------------------------------------
> >    To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >    For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> >    <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >
> >    For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Resource sub-folder for Maven based JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
 The directory structure for the FXML JavaFX project:|->src|        |->main|        |            |->java
|        |            |          |->org|        |            |                   |->openjfx|        |            |                                  |->mavenfxmlwebview
|        |            |->resources
|        |->testtarget         |->classes                         |->org                                  |->openjfx                                                 |->mavenfxmlwebview
The directory structure for the Simple JavaFX project:|->src|        |->main|        |            |->java
|        |            |          |->org|        |            |                   |->openjfx|        |            |                                  |->mavenfxsliderbar
|        |            |->resources
|        |->testtarget         |->classes                         |->org                                  |->openjfx                                                 |->mavenfxsliderbar
Hope the bars are still lining up properly after I submit this email.
Thanks




    On Thursday, October 1, 2020, 10:45:19 PM GMT+3:30, Ernie Rael <er...@raelity.com> wrote:  
 
 @HRH,

Could you provide the directory structure under src/main/resources for 
both the working project and the failing project.

-ernie

On 10/1/2020 11:17 AM, HRH wrote:
> No, the folder contains an image file (.jpeg)
>
> On Tuesday, September 29, 2020, 9:21:41 PM GMT+3:30, Geertjan Wielenga 
> <ge...@apache.org> wrote:
>
>
> Because the folder is empty?
>
> Gj
>
> On Tue, 29 Sep 2020 at 19:45, HRH <hr...@yahoo.com.invalid> wrote:
>
>
>
>
>    Well, I looked into the IDE generated POMs for both project types
>    assiduously and there are no major differences, that would lead
>    one to believe Maven is the culprit here. In summary, during the
>    project build, the resource sub-folder (within the Maven compliant
>    folder structure) is copied from the "src" sub-tree to the
>    "target" sub-tree, by the IDE for the "FXML JavaFX Maven
>    Archetype" projects but this step is completely elided for the
>    "Simple JavaFX Maven Archetype) projects.
>
>    Thanks
>
>
>
>
>
>
>
>
>
>
>
>
>    On Thursday, September 17, 2020, 11:21:48 PM GMT+4:30, HRH
>    <hr...@yahoo.com.invalid> wrote:
>
>
>
>
>
>
>
>
>
>
>
>    That's precisely what I was doing, by looking into the Maven docs,
>    and trying to find a way to copy this file to the right
>    destination folder. The generated pom.xml files for both templates
>    seem identical with the exception of the main class name and the
>    project name, so there must be a reason why they behave differently.
>
>    Thanks
>
>
>
>
>
>
>
>
>
>
>
>
>
>    On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael
>    <errael@raelity.com <ma...@raelity.com>> wrote:
>
>
>
>
>
>
>
>
>
>    On 9/17/2020 11:33 AM, HRH wrote:
>    > Ok, I need to be more specific vis-a-vis my last reply. Initially,
>    > when I created the src/main/resources sub-folder and put my
>    image.jpg
>    > in that directory, Maven copied it the .jpg file to the
>    > "target/classes" directory instead of
>    > "target/classes/org/openjfx/${package} where all the class files
>    > reside. In contrast, for the "FXML JavaFX Archetype (Gluon)"
>    template,
>    > Maven copies the content of the "src/main/resources" to
>    > "target/classes/org/openjfx/${package} and the runtime can load
>    the file.
>
>    It's up to you to figure out what/if maven is doing differently
>    for one
>    project and not the other. It's not a NetBeans issue. Take a look
>    at the
>    structure under resources
>
>    -ernie
>
>    >
>    > I hope this clarifies the ambiguity in the last reply.
>    >
>    > On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH
>    > <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>> wrote:
>    >
>    >
>    > Ernie
>    >
>    > I have done that (making a "resources" sub-folder under the
>    src/main)
>    > but Maven does not copy its content to the "target" subtree. Not
>    sure why?
>    >
>    > On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael
>    > <errael@raelity.com <ma...@raelity.com>> wrote:
>    >
>    >
>    > On 9/17/2020 9:58 AM, HRH wrote:
>    > >
>    > > Hi Ernie,
>    > >
>    > > I hear what you're saying about the empty directory. I kept the
>    > > artifact in the src/main and manually copied it to the
>    target/classes
>    > > tree after the build. However, "Run Main Project" tends to
>    rebuild and
>    > > wipe the "target" sub-tree (because I am missing the nb-javac
>    plugin),
>    > > which then leads to a runtime error due to missing artifact.
>    > > Currently, I going through Maven documentation to figure out a
>    way (I
>    > > recall seeing a Maven plugin somewhere) to copy this file from
>    > > "main/src" to "target/classes" as the last step in the build and I
>    > > believe this will circumvent my issue.
>    >
>    > I'm confused. Why don't you create the resources directory,
>    > .../src/main/resources/ and move the files to there and be done
>    with the
>    > problem?
>    >
>    > You do not seem to have a maven compliant file layout. Why not
>    make it
>    > compliant and be done with this whole issue of manually copying
>    files
>    > around?
>    >
>    > -ernie
>    >
>    > >
>    > > Thanks as always for your insight
>    > > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
>    > > <errael@raelity.com <ma...@raelity.com>
>    <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
>    > >
>    > >
>    > > On 9/17/2020 5:11 AM, HRH wrote:
>    > > > Hi,
>    > > >
>    > > > The "Simple JavaFX Maven Archetype (Gluon)" template from
>    the "New
>    > > > Projects->Java with Maven" does not create a resource
>    sub-folder under
>    > > > the src subtree, so the developer can store required
>    artifacts (i.e.
>    > > > jpg images,etc.) for the project in that folder. If the
>    artifacts
>    > > > placed in the src directory with the main and the controller
>    source
>    > > > code, the maven does not copy them to the target->classes,
>    hence the
>    > > > developer needs to manually copy
>    > > The developer can put the resources where they belong for the
>    maven
>    > > build system when the developer initially adds them.
>    > >
>    > > > these artifacts src->main to the "target->classes" after
>    each build,
>    > > > to avoid runtime errors.
>    > > >
>    > > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)"
>    template always
>    > > > creates "Other
>    Sources/src/main/resources/${project.package}" tree
>    > > > structure for the artifacts (i.e. fxml, css, images, etc.)
>    and the
>    > > > maven copies them to the "target->classes->${package}"
>    sub-folder.
>    > > >
>    > > > If possible, it would be great if these two templates create a
>    > > > consistent tree structure.
>    > >
>    > >
>    > > The FXML project has resources, so it creates the directory
>    and puts the
>    > > resources there; the other project type does not does not have
>    resources
>    > > and so does not create the directory. You're suggesting
>    creating empty
>    > > directories, which SCM will get rid of.
>    > >
>    > > Just create the directory when you need it. (I kind of agree
>    with you,
>    > > but there are so many valid directory structures for a
>    project... The
>    > > SCM issue is the clincher, empty directories do not stay
>    around) If you
>    > > don't know where the resources are supposed to go, then having
>    some
>    > > directory hanging around won't help anyway.
>    > >
>    > > -ernie
>    > >
>    > >
>    > >
>    ---------------------------------------------------------------------
>    > > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
>    <ma...@netbeans.apache.org>
>    > <mailto:users-unsubscribe@netbeans.apache.org
>    <ma...@netbeans.apache.org>>
>    > > <mailto:users-unsubscribe@netbeans.apache.org
>    <ma...@netbeans.apache.org>
>    > <mailto:users-unsubscribe@netbeans.apache.org
>    <ma...@netbeans.apache.org>>>
>    > > For additional commands, e-mail:
>    users-help@netbeans.apache.org
>    <ma...@netbeans.apache.org>
>    > <mailto:users-help@netbeans.apache.org
>    <ma...@netbeans.apache.org>>
>    > > <mailto:users-help@netbeans.apache.org
>    <ma...@netbeans.apache.org>
>    > <mailto:users-help@netbeans.apache.org
>    <ma...@netbeans.apache.org>>>
>    > >
>    > > For further information about the NetBeans mailing lists, visit:
>    > >
>    https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>    >
>    > >
>    > >
>    >
>    >
>    >
>    ---------------------------------------------------------------------
>    > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
>    <ma...@netbeans.apache.org>
>    > <mailto:users-unsubscribe@netbeans.apache.org
>    <ma...@netbeans.apache.org>>
>    > For additional commands, e-mail: users-help@netbeans.apache.org
>    <ma...@netbeans.apache.org>
>    > <mailto:users-help@netbeans.apache.org
>    <ma...@netbeans.apache.org>>
>    >
>    > For further information about the NetBeans mailing lists, visit:
>    > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>    >
>
>
>    ---------------------------------------------------------------------
>    To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
>    <ma...@netbeans.apache.org>
>    For additional commands, e-mail: users-help@netbeans.apache.org
>    <ma...@netbeans.apache.org>
>
>    For further information about the NetBeans mailing lists, visit:
>    https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
>
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

  

Re: Resource sub-folder for Maven based JavaFX

Posted by Ernie Rael <er...@raelity.com>.
@HRH,

Could you provide the directory structure under src/main/resources for 
both the working project and the failing project.

-ernie

On 10/1/2020 11:17 AM, HRH wrote:
> No, the folder contains an image file (.jpeg)
>
> On Tuesday, September 29, 2020, 9:21:41 PM GMT+3:30, Geertjan Wielenga 
> <ge...@apache.org> wrote:
>
>
> Because the folder is empty?
>
> Gj
>
> On Tue, 29 Sep 2020 at 19:45, HRH <hr...@yahoo.com.invalid> wrote:
>
>
>
>
>     Well, I looked into the IDE generated POMs for both project types
>     assiduously and there are no major differences, that would lead
>     one to believe Maven is the culprit here. In summary, during the
>     project build, the resource sub-folder (within the Maven compliant
>     folder structure) is copied from the "src" sub-tree to the
>     "target" sub-tree, by the IDE for the "FXML JavaFX Maven
>     Archetype" projects but this step is completely elided for the
>     "Simple JavaFX Maven Archetype) projects.
>
>     Thanks
>
>
>
>
>
>
>
>
>
>
>
>
>     On Thursday, September 17, 2020, 11:21:48 PM GMT+4:30, HRH
>     <hr...@yahoo.com.invalid> wrote:
>
>
>
>
>
>
>
>
>
>
>
>     That's precisely what I was doing, by looking into the Maven docs,
>     and trying to find a way to copy this file to the right
>     destination folder. The generated pom.xml files for both templates
>     seem identical with the exception of the main class name and the
>     project name, so there must be a reason why they behave differently.
>
>     Thanks
>
>
>
>
>
>
>
>
>
>
>
>
>
>     On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael
>     <errael@raelity.com <ma...@raelity.com>> wrote:
>
>
>
>
>
>
>
>
>
>     On 9/17/2020 11:33 AM, HRH wrote:
>     > Ok, I need to be more specific vis-a-vis my last reply. Initially,
>     > when I created the src/main/resources sub-folder and put my
>     image.jpg
>     > in that directory, Maven copied it the .jpg file to the
>     > "target/classes" directory instead of
>     > "target/classes/org/openjfx/${package} where all the class files
>     > reside. In contrast, for the "FXML JavaFX Archetype (Gluon)"
>     template,
>     > Maven copies the content of the "src/main/resources" to
>     > "target/classes/org/openjfx/${package} and the runtime can load
>     the file.
>
>     It's up to you to figure out what/if maven is doing differently
>     for one
>     project and not the other. It's not a NetBeans issue. Take a look
>     at the
>     structure under resources
>
>     -ernie
>
>     >
>     > I hope this clarifies the ambiguity in the last reply.
>     >
>     > On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH
>     > <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>> wrote:
>     >
>     >
>     > Ernie
>     >
>     > I have done that (making a "resources" sub-folder under the
>     src/main)
>     > but Maven does not copy its content to the "target" subtree. Not
>     sure why?
>     >
>     > On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael
>     > <errael@raelity.com <ma...@raelity.com>> wrote:
>     >
>     >
>     > On 9/17/2020 9:58 AM, HRH wrote:
>     > >
>     > > Hi Ernie,
>     > >
>     > > I hear what you're saying about the empty directory. I kept the
>     > > artifact in the src/main and manually copied it to the
>     target/classes
>     > > tree after the build. However, "Run Main Project" tends to
>     rebuild and
>     > > wipe the "target" sub-tree (because I am missing the nb-javac
>     plugin),
>     > > which then leads to a runtime error due to missing artifact.
>     > > Currently, I going through Maven documentation to figure out a
>     way (I
>     > > recall seeing a Maven plugin somewhere) to copy this file from
>     > > "main/src" to "target/classes" as the last step in the build and I
>     > > believe this will circumvent my issue.
>     >
>     > I'm confused. Why don't you create the resources directory,
>     > .../src/main/resources/ and move the files to there and be done
>     with the
>     > problem?
>     >
>     > You do not seem to have a maven compliant file layout. Why not
>     make it
>     > compliant and be done with this whole issue of manually copying
>     files
>     > around?
>     >
>     > -ernie
>     >
>     > >
>     > > Thanks as always for your insight
>     > > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
>     > > <errael@raelity.com <ma...@raelity.com>
>     <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
>     > >
>     > >
>     > > On 9/17/2020 5:11 AM, HRH wrote:
>     > > > Hi,
>     > > >
>     > > > The "Simple JavaFX Maven Archetype (Gluon)" template from
>     the "New
>     > > > Projects->Java with Maven" does not create a resource
>     sub-folder under
>     > > > the src subtree, so the developer can store required
>     artifacts (i.e.
>     > > > jpg images,etc.) for the project in that folder. If the
>     artifacts
>     > > > placed in the src directory with the main and the controller
>     source
>     > > > code, the maven does not copy them to the target->classes,
>     hence the
>     > > > developer needs to manually copy
>     > > The developer can put the resources where they belong for the
>     maven
>     > > build system when the developer initially adds them.
>     > >
>     > > > these artifacts src->main to the "target->classes" after
>     each build,
>     > > > to avoid runtime errors.
>     > > >
>     > > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)"
>     template always
>     > > > creates "Other
>     Sources/src/main/resources/${project.package}" tree
>     > > > structure for the artifacts (i.e. fxml, css, images, etc.)
>     and the
>     > > > maven copies them to the "target->classes->${package}"
>     sub-folder.
>     > > >
>     > > > If possible, it would be great if these two templates create a
>     > > > consistent tree structure.
>     > >
>     > >
>     > > The FXML project has resources, so it creates the directory
>     and puts the
>     > > resources there; the other project type does not does not have
>     resources
>     > > and so does not create the directory. You're suggesting
>     creating empty
>     > > directories, which SCM will get rid of.
>     > >
>     > > Just create the directory when you need it. (I kind of agree
>     with you,
>     > > but there are so many valid directory structures for a
>     project... The
>     > > SCM issue is the clincher, empty directories do not stay
>     around) If you
>     > > don't know where the resources are supposed to go, then having
>     some
>     > > directory hanging around won't help anyway.
>     > >
>     > > -ernie
>     > >
>     > >
>     > >
>     ---------------------------------------------------------------------
>     > > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
>     <ma...@netbeans.apache.org>
>     > <mailto:users-unsubscribe@netbeans.apache.org
>     <ma...@netbeans.apache.org>>
>     > > <mailto:users-unsubscribe@netbeans.apache.org
>     <ma...@netbeans.apache.org>
>     > <mailto:users-unsubscribe@netbeans.apache.org
>     <ma...@netbeans.apache.org>>>
>     > > For additional commands, e-mail:
>     users-help@netbeans.apache.org
>     <ma...@netbeans.apache.org>
>     > <mailto:users-help@netbeans.apache.org
>     <ma...@netbeans.apache.org>>
>     > > <mailto:users-help@netbeans.apache.org
>     <ma...@netbeans.apache.org>
>     > <mailto:users-help@netbeans.apache.org
>     <ma...@netbeans.apache.org>>>
>     > >
>     > > For further information about the NetBeans mailing lists, visit:
>     > >
>     https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>     >
>     > >
>     > >
>     >
>     >
>     >
>     ---------------------------------------------------------------------
>     > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
>     <ma...@netbeans.apache.org>
>     > <mailto:users-unsubscribe@netbeans.apache.org
>     <ma...@netbeans.apache.org>>
>     > For additional commands, e-mail: users-help@netbeans.apache.org
>     <ma...@netbeans.apache.org>
>     > <mailto:users-help@netbeans.apache.org
>     <ma...@netbeans.apache.org>>
>     >
>     > For further information about the NetBeans mailing lists, visit:
>     > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>     >
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
>     <ma...@netbeans.apache.org>
>     For additional commands, e-mail: users-help@netbeans.apache.org
>     <ma...@netbeans.apache.org>
>
>     For further information about the NetBeans mailing lists, visit:
>     https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
>
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Resource sub-folder for Maven based JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
 No, the folder contains an image file (.jpeg)

    On Tuesday, September 29, 2020, 9:21:41 PM GMT+3:30, Geertjan Wielenga <ge...@apache.org> wrote:  
 
 Because the folder is empty?
Gj
On Tue, 29 Sep 2020 at 19:45, HRH <hr...@yahoo.com.invalid> wrote:



 
Well, I looked into the IDE generated POMs for both project types assiduously and there are no major differences, that would lead one to believe Maven is the culprit here. In summary, during the project build, the resource sub-folder (within the Maven compliant folder structure) is copied from the "src" sub-tree to the "target" sub-tree, by the IDE for the "FXML JavaFX Maven Archetype" projects but this step is completely elided for the "Simple JavaFX Maven Archetype) projects.
Thanks


 

 

 

 

 

 On Thursday, September 17, 2020, 11:21:48 PM GMT+4:30, HRH <hr...@yahoo.com.invalid> wrote:

 

 


 


 

 That's precisely what I was doing, by looking into the Maven docs, and trying to find a way to copy this file to the right destination folder. The generated pom.xml files for both templates seem identical with the exception of the main class name and the project name, so there must be a reason why they behave differently.

Thanks



 

 

 

 

 

 On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael <er...@raelity.com> wrote:

 

 


 


 On 9/17/2020 11:33 AM, HRH wrote:
> Ok, I need to be more specific vis-a-vis my last reply. Initially, 
> when I created the src/main/resources sub-folder and put my image.jpg 
> in that directory, Maven copied it the .jpg file to the 
> "target/classes" directory instead of 
> "target/classes/org/openjfx/${package} where all the class files 
> reside. In contrast, for the "FXML JavaFX Archetype (Gluon)" template, 
> Maven copies the content of the "src/main/resources" to 
> "target/classes/org/openjfx/${package} and the runtime can load the file.

It's up to you to figure out what/if maven is doing differently for one 
project and not the other. It's not a NetBeans issue. Take a look at the 
structure under resources

-ernie

>
> I hope this clarifies the ambiguity in the last reply.
>
> On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH 
> <hr...@yahoo.com.invalid> wrote:
>
>
> Ernie
>
> I have done that (making a "resources" sub-folder under the src/main) 
> but Maven does not copy its content to the "target" subtree. Not sure why?
>
> On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> On 9/17/2020 9:58 AM, HRH wrote:
> >
> > Hi Ernie,
> >
> > I hear what you're saying about the empty directory. I kept the
> > artifact in the src/main and manually copied it to the target/classes
> > tree after the build. However, "Run Main Project" tends to rebuild and
> > wipe the "target" sub-tree (because I am missing the nb-javac plugin),
> > which then leads to a runtime error due to missing artifact.
> > Currently, I going through Maven documentation to figure out a way (I
> > recall seeing a Maven plugin somewhere) to copy this file from
> > "main/src" to "target/classes" as the last step in the build and I
> > believe this will circumvent my issue.
>
> I'm confused. Why don't you create the resources directory,
> .../src/main/resources/ and move the files to there and be done with the
> problem?
>
> You do not seem to have a maven compliant file layout. Why not make it
> compliant and be done with this whole issue of manually copying files
> around?
>
> -ernie
>
> >
> > Thanks as always for your insight
> > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> > <errael@raelity.com <ma...@raelity.com>> wrote:
> >
> >
> > On 9/17/2020 5:11 AM, HRH wrote:
> > > Hi,
> > >
> > > The "Simple JavaFX Maven Archetype (Gluon)" template from the "New
> > > Projects->Java with Maven" does not create a resource sub-folder under
> > > the src subtree, so the developer can store required artifacts (i.e.
> > > jpg images,etc.) for the project in that folder. If the artifacts
> > > placed in the src directory with the main and the controller source
> > > code, the maven does not copy them to the target->classes, hence the
> > > developer needs to manually copy
> > The developer can put the resources where they belong for the maven
> > build system when the developer initially adds them.
> >
> > > these artifacts src->main to the "target->classes" after each build,
> > > to avoid runtime errors.
> > >
> > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template always
> > > creates "Other Sources/src/main/resources/${project.package}" tree
> > > structure for the artifacts (i.e. fxml, css, images, etc.) and the
> > > maven copies them to the "target->classes->${package}" sub-folder.
> > >
> > > If possible, it would be great if these two templates create a
> > > consistent tree structure.
> >
> >
> > The FXML project has resources, so it creates the directory and puts the
> > resources there; the other project type does not does not have resources
> > and so does not create the directory. You're suggesting creating empty
> > directories, which SCM will get rid of.
> >
> > Just create the directory when you need it. (I kind of agree with you,
> > but there are so many valid directory structures for a project... The
> > SCM issue is the clincher, empty directories do not stay around) If you
> > don't know where the resources are supposed to go, then having some
> > directory hanging around won't help anyway.
> >
> > -ernie
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> > For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



 

 

 

 
  

Re: Resource sub-folder for Maven based JavaFX

Posted by Geertjan Wielenga <ge...@apache.org>.
Because the folder is empty?

Gj

On Tue, 29 Sep 2020 at 19:45, HRH <hr...@yahoo.com.invalid> wrote:

>
>
>
> Well, I looked into the IDE generated POMs for both project types
> assiduously and there are no major differences, that would lead one to
> believe Maven is the culprit here. In summary, during the project build,
> the resource sub-folder (within the Maven compliant folder structure) is
> copied from the "src" sub-tree to the "target" sub-tree, by the IDE for the
> "FXML JavaFX Maven Archetype" projects but this step is completely elided
> for the "Simple JavaFX Maven Archetype) projects.
>
> Thanks
>
>
>
>
>
>
>
>
>
>
>
>
> On Thursday, September 17, 2020, 11:21:48 PM GMT+4:30, HRH
> <hr...@yahoo.com.invalid> wrote:
>
>
>
>
>
>
>
>
>
>
>
> That's precisely what I was doing, by looking into the Maven docs, and
> trying to find a way to copy this file to the right destination folder. The
> generated pom.xml files for both templates seem identical with the
> exception of the main class name and the project name, so there must be a
> reason why they behave differently.
>
> Thanks
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael <
> errael@raelity.com> wrote:
>
>
>
>
>
>
>
>
>
> On 9/17/2020 11:33 AM, HRH wrote:
> > Ok, I need to be more specific vis-a-vis my last reply. Initially,
> > when I created the src/main/resources sub-folder and put my image.jpg
> > in that directory, Maven copied it the .jpg file to the
> > "target/classes" directory instead of
> > "target/classes/org/openjfx/${package} where all the class files
> > reside. In contrast, for the "FXML JavaFX Archetype (Gluon)" template,
> > Maven copies the content of the "src/main/resources" to
> > "target/classes/org/openjfx/${package} and the runtime can load the file.
>
> It's up to you to figure out what/if maven is doing differently for one
> project and not the other. It's not a NetBeans issue. Take a look at the
> structure under resources
>
> -ernie
>
> >
> > I hope this clarifies the ambiguity in the last reply.
> >
> > On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH
> > <hr...@yahoo.com.invalid> wrote:
> >
> >
> > Ernie
> >
> > I have done that (making a "resources" sub-folder under the src/main)
> > but Maven does not copy its content to the "target" subtree. Not sure
> why?
> >
> > On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael
> > <er...@raelity.com> wrote:
> >
> >
> > On 9/17/2020 9:58 AM, HRH wrote:
> > >
> > > Hi Ernie,
> > >
> > > I hear what you're saying about the empty directory. I kept the
> > > artifact in the src/main and manually copied it to the target/classes
> > > tree after the build. However, "Run Main Project" tends to rebuild and
> > > wipe the "target" sub-tree (because I am missing the nb-javac plugin),
> > > which then leads to a runtime error due to missing artifact.
> > > Currently, I going through Maven documentation to figure out a way (I
> > > recall seeing a Maven plugin somewhere) to copy this file from
> > > "main/src" to "target/classes" as the last step in the build and I
> > > believe this will circumvent my issue.
> >
> > I'm confused. Why don't you create the resources directory,
> > .../src/main/resources/ and move the files to there and be done with the
> > problem?
> >
> > You do not seem to have a maven compliant file layout. Why not make it
> > compliant and be done with this whole issue of manually copying files
> > around?
> >
> > -ernie
> >
> > >
> > > Thanks as always for your insight
> > > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> > > <errael@raelity.com <ma...@raelity.com>> wrote:
> > >
> > >
> > > On 9/17/2020 5:11 AM, HRH wrote:
> > > > Hi,
> > > >
> > > > The "Simple JavaFX Maven Archetype (Gluon)" template from the "New
> > > > Projects->Java with Maven" does not create a resource sub-folder
> under
> > > > the src subtree, so the developer can store required artifacts (i.e.
> > > > jpg images,etc.) for the project in that folder. If the artifacts
> > > > placed in the src directory with the main and the controller source
> > > > code, the maven does not copy them to the target->classes, hence the
> > > > developer needs to manually copy
> > > The developer can put the resources where they belong for the maven
> > > build system when the developer initially adds them.
> > >
> > > > these artifacts src->main to the "target->classes" after each build,
> > > > to avoid runtime errors.
> > > >
> > > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template
> always
> > > > creates "Other Sources/src/main/resources/${project.package}" tree
> > > > structure for the artifacts (i.e. fxml, css, images, etc.) and the
> > > > maven copies them to the "target->classes->${package}" sub-folder.
> > > >
> > > > If possible, it would be great if these two templates create a
> > > > consistent tree structure.
> > >
> > >
> > > The FXML project has resources, so it creates the directory and puts
> the
> > > resources there; the other project type does not does not have
> resources
> > > and so does not create the directory. You're suggesting creating empty
> > > directories, which SCM will get rid of.
> > >
> > > Just create the directory when you need it. (I kind of agree with you,
> > > but there are so many valid directory structures for a project... The
> > > SCM issue is the clincher, empty directories do not stay around) If you
> > > don't know where the resources are supposed to go, then having some
> > > directory hanging around won't help anyway.
> > >
> > > -ernie
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > > <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > > For additional commands, e-mail: users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > > <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > >
> > > For further information about the NetBeans mailing lists, visit:
> > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > For additional commands, e-mail: users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
>
>
>
>
>
>

Re: Resource sub-folder for Maven based JavaFX

Posted by Geertjan Wielenga <ge...@apache.org>.
Then you’re going to need to find the right place to report this, which is
not here.

Gj

On Thu, 1 Oct 2020 at 21:17, HRH <hr...@yahoo.com.invalid> wrote:

>
>
> Ernie,
>
> Whether I execute the Maven from the command line (i.e. mvn clean package)
> or within the bounds of IDE, the resources are not copied to where the
> *.class files reside under the "target\classes\${package-structure}"
> sub-tree, instead, they're copied under "target\classes" with the
> module-info. This behavior is not consistent with the FXML JavaFx project
> type. The interim solution to circumnavigate this situation is to either
> hard code the path to the resource, manually copy the resource to the
> proper location after the project builds, or use FXML JavaFX project type
> instead.
>
> From the start of this thread, I have been circumspect of not pointing
> finger at the IDE and that remains unchanged. My goal is to point out this
> anomalous difference between the two project types.
>
> Thanks
>
>
>
>
>
>
>
>
>
>
>
>
> On Tuesday, September 29, 2020, 9:41:45 PM GMT+3:30, Ernie Rael <
> errael@raelity.com> wrote:
>
>
>
>
>
>
>
>
>
> In the project directory, from the OS command line, did you try running
> "mvn clean package"?
>
> This takes NetBeans out of the equation; I don't think NetBeans is
> copying stuff from resource to target.
>
> I think maven replicates the resources directory structure under target.
>
> -ernie
>
> On 9/29/2020 10:44 AM, HRH wrote:
> >
> > Well, I looked into the IDE generated POMs for both project types
> > assiduously and there are no major differences, that would lead one to
> > believe Maven is the culprit here. In summary, during the project
> > build, the resource sub-folder (within the Maven compliant folder
> > structure) is copied from the "src" sub-tree to the "target" sub-tree,
> > by the IDE for the "FXML JavaFX Maven Archetype" projects but this
> > step is completely elided for the "Simple JavaFX Maven Archetype)
> > projects.
> >
> > Thanks
> > On Thursday, September 17, 2020, 11:21:48 PM GMT+4:30, HRH
> > <hr...@yahoo.com.invalid> wrote:
> >
> >
> > That's precisely what I was doing, by looking into the Maven docs, and
> > trying to find a way to copy this file to the right destination
> > folder. The generated pom.xml files for both templates seem identical
> > with the exception of the main class name and the project name, so
> > there must be a reason why they behave differently.
> >
> > Thanks
> >
> > On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael
> > <er...@raelity.com> wrote:
> >
> >
> > On 9/17/2020 11:33 AM, HRH wrote:
> > > Ok, I need to be more specific vis-a-vis my last reply. Initially,
> > > when I created the src/main/resources sub-folder and put my image.jpg
> > > in that directory, Maven copied it the .jpg file to the
> > > "target/classes" directory instead of
> > > "target/classes/org/openjfx/${package} where all the class files
> > > reside. In contrast, for the "FXML JavaFX Archetype (Gluon)" template,
> > > Maven copies the content of the "src/main/resources" to
> > > "target/classes/org/openjfx/${package} and the runtime can load the
> > file.
> >
> > It's up to you to figure out what/if maven is doing differently for one
> > project and not the other. It's not a NetBeans issue. Take a look at the
> > structure under resources
> >
> > -ernie
> >
> > >
> > > I hope this clarifies the ambiguity in the last reply.
> > >
> > > On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH
> > > <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>> wrote:
> > >
> > >
> > > Ernie
> > >
> > > I have done that (making a "resources" sub-folder under the src/main)
> > > but Maven does not copy its content to the "target" subtree. Not
> > sure why?
> > >
> > > On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael
> > > <errael@raelity.com <ma...@raelity.com>> wrote:
> > >
> > >
> > > On 9/17/2020 9:58 AM, HRH wrote:
> > > >
> > > > Hi Ernie,
> > > >
> > > > I hear what you're saying about the empty directory. I kept the
> > > > artifact in the src/main and manually copied it to the target/classes
> > > > tree after the build. However, "Run Main Project" tends to rebuild
> and
> > > > wipe the "target" sub-tree (because I am missing the nb-javac
> plugin),
> > > > which then leads to a runtime error due to missing artifact.
> > > > Currently, I going through Maven documentation to figure out a way (I
> > > > recall seeing a Maven plugin somewhere) to copy this file from
> > > > "main/src" to "target/classes" as the last step in the build and I
> > > > believe this will circumvent my issue.
> > >
> > > I'm confused. Why don't you create the resources directory,
> > > .../src/main/resources/ and move the files to there and be done with
> the
> > > problem?
> > >
> > > You do not seem to have a maven compliant file layout. Why not make it
> > > compliant and be done with this whole issue of manually copying files
> > > around?
> > >
> > > -ernie
> > >
> > > >
> > > > Thanks as always for your insight
> > > > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> > > > <errael@raelity.com <ma...@raelity.com>
> > <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
> > > >
> > > >
> > > > On 9/17/2020 5:11 AM, HRH wrote:
> > > > > Hi,
> > > > >
> > > > > The "Simple JavaFX Maven Archetype (Gluon)" template from the "New
> > > > > Projects->Java with Maven" does not create a resource sub-folder
> > under
> > > > > the src subtree, so the developer can store required artifacts
> (i.e.
> > > > > jpg images,etc.) for the project in that folder. If the artifacts
> > > > > placed in the src directory with the main and the controller source
> > > > > code, the maven does not copy them to the target->classes, hence
> the
> > > > > developer needs to manually copy
> > > > The developer can put the resources where they belong for the maven
> > > > build system when the developer initially adds them.
> > > >
> > > > > these artifacts src->main to the "target->classes" after each
> build,
> > > > > to avoid runtime errors.
> > > > >
> > > > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template
> > always
> > > > > creates "Other Sources/src/main/resources/${project.package}" tree
> > > > > structure for the artifacts (i.e. fxml, css, images, etc.) and the
> > > > > maven copies them to the "target->classes->${package}" sub-folder.
> > > > >
> > > > > If possible, it would be great if these two templates create a
> > > > > consistent tree structure.
> > > >
> > > >
> > > > The FXML project has resources, so it creates the directory and
> > puts the
> > > > resources there; the other project type does not does not have
> > resources
> > > > and so does not create the directory. You're suggesting creating
> empty
> > > > directories, which SCM will get rid of.
> > > >
> > > > Just create the directory when you need it. (I kind of agree with
> you,
> > > > but there are so many valid directory structures for a project... The
> > > > SCM issue is the clincher, empty directories do not stay around)
> > If you
> > > > don't know where the resources are supposed to go, then having some
> > > > directory hanging around won't help anyway.
> > > >
> > > > -ernie
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > > <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > > > <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > > <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>>>
> > > > For additional commands, e-mail: users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > > <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > > > <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > > <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>>>
> > > >
> > > > For further information about the NetBeans mailing lists, visit:
> > > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> >
> > >
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > > <mailto:users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > > For additional commands, e-mail: users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > > <mailto:users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>>
> > >
> > > For further information about the NetBeans mailing lists, visit:
> > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> > For additional commands, e-mail: users-help@netbeans.apache.org
> > <ma...@netbeans.apache.org>
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
>
>

Re: Resource sub-folder for Maven based JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
 Ernie,
Whether I execute the Maven from the command line (i.e. mvn clean package) or within the bounds of IDE, the resources are not copied to where the *.class files reside under the "target\classes\${package-structure}" sub-tree, instead, they're copied under "target\classes" with the module-info. This behavior is not consistent with the FXML JavaFx project type. The interim solution to circumnavigate this situation is to either hard code the path to the resource, manually copy the resource to the proper location after the project builds, or use FXML JavaFX project type instead.

From the start of this thread, I have been circumspect of not pointing finger at the IDE and that remains unchanged. My goal is to point out this anomalous difference between the two project types.
Thanks
    On Tuesday, September 29, 2020, 9:41:45 PM GMT+3:30, Ernie Rael <er...@raelity.com> wrote:  
 
 In the project directory, from the OS command line, did you try running 
"mvn clean package"?

This takes NetBeans out of the equation; I don't think NetBeans is 
copying stuff from resource to target.

I think maven replicates the resources directory structure under target.

-ernie

On 9/29/2020 10:44 AM, HRH wrote:
>
> Well, I looked into the IDE generated POMs for both project types 
> assiduously and there are no major differences, that would lead one to 
> believe Maven is the culprit here. In summary, during the project 
> build, the resource sub-folder (within the Maven compliant folder 
> structure) is copied from the "src" sub-tree to the "target" sub-tree, 
> by the IDE for the "FXML JavaFX Maven Archetype" projects but this 
> step is completely elided for the "Simple JavaFX Maven Archetype) 
> projects.
>
> Thanks
> On Thursday, September 17, 2020, 11:21:48 PM GMT+4:30, HRH 
> <hr...@yahoo.com.invalid> wrote:
>
>
> That's precisely what I was doing, by looking into the Maven docs, and 
> trying to find a way to copy this file to the right destination 
> folder. The generated pom.xml files for both templates seem identical 
> with the exception of the main class name and the project name, so 
> there must be a reason why they behave differently.
>
> Thanks
>
> On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> On 9/17/2020 11:33 AM, HRH wrote:
> > Ok, I need to be more specific vis-a-vis my last reply. Initially,
> > when I created the src/main/resources sub-folder and put my image.jpg
> > in that directory, Maven copied it the .jpg file to the
> > "target/classes" directory instead of
> > "target/classes/org/openjfx/${package} where all the class files
> > reside. In contrast, for the "FXML JavaFX Archetype (Gluon)" template,
> > Maven copies the content of the "src/main/resources" to
> > "target/classes/org/openjfx/${package} and the runtime can load the 
> file.
>
> It's up to you to figure out what/if maven is doing differently for one
> project and not the other. It's not a NetBeans issue. Take a look at the
> structure under resources
>
> -ernie
>
> >
> > I hope this clarifies the ambiguity in the last reply.
> >
> > On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH
> > <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>> wrote:
> >
> >
> > Ernie
> >
> > I have done that (making a "resources" sub-folder under the src/main)
> > but Maven does not copy its content to the "target" subtree. Not 
> sure why?
> >
> > On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael
> > <errael@raelity.com <ma...@raelity.com>> wrote:
> >
> >
> > On 9/17/2020 9:58 AM, HRH wrote:
> > >
> > > Hi Ernie,
> > >
> > > I hear what you're saying about the empty directory. I kept the
> > > artifact in the src/main and manually copied it to the target/classes
> > > tree after the build. However, "Run Main Project" tends to rebuild and
> > > wipe the "target" sub-tree (because I am missing the nb-javac plugin),
> > > which then leads to a runtime error due to missing artifact.
> > > Currently, I going through Maven documentation to figure out a way (I
> > > recall seeing a Maven plugin somewhere) to copy this file from
> > > "main/src" to "target/classes" as the last step in the build and I
> > > believe this will circumvent my issue.
> >
> > I'm confused. Why don't you create the resources directory,
> > .../src/main/resources/ and move the files to there and be done with the
> > problem?
> >
> > You do not seem to have a maven compliant file layout. Why not make it
> > compliant and be done with this whole issue of manually copying files
> > around?
> >
> > -ernie
> >
> > >
> > > Thanks as always for your insight
> > > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> > > <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
> > >
> > >
> > > On 9/17/2020 5:11 AM, HRH wrote:
> > > > Hi,
> > > >
> > > > The "Simple JavaFX Maven Archetype (Gluon)" template from the "New
> > > > Projects->Java with Maven" does not create a resource sub-folder 
> under
> > > > the src subtree, so the developer can store required artifacts (i.e.
> > > > jpg images,etc.) for the project in that folder. If the artifacts
> > > > placed in the src directory with the main and the controller source
> > > > code, the maven does not copy them to the target->classes, hence the
> > > > developer needs to manually copy
> > > The developer can put the resources where they belong for the maven
> > > build system when the developer initially adds them.
> > >
> > > > these artifacts src->main to the "target->classes" after each build,
> > > > to avoid runtime errors.
> > > >
> > > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template 
> always
> > > > creates "Other Sources/src/main/resources/${project.package}" tree
> > > > structure for the artifacts (i.e. fxml, css, images, etc.) and the
> > > > maven copies them to the "target->classes->${package}" sub-folder.
> > > >
> > > > If possible, it would be great if these two templates create a
> > > > consistent tree structure.
> > >
> > >
> > > The FXML project has resources, so it creates the directory and 
> puts the
> > > resources there; the other project type does not does not have 
> resources
> > > and so does not create the directory. You're suggesting creating empty
> > > directories, which SCM will get rid of.
> > >
> > > Just create the directory when you need it. (I kind of agree with you,
> > > but there are so many valid directory structures for a project... The
> > > SCM issue is the clincher, empty directories do not stay around) 
> If you
> > > don't know where the resources are supposed to go, then having some
> > > directory hanging around won't help anyway.
> > >
> > > -ernie
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> > > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> > > For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> > > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> > >
> > > For further information about the NetBeans mailing lists, visit:
> > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> > For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

  

Re: Resource sub-folder for Maven based JavaFX

Posted by Ernie Rael <er...@raelity.com>.
In the project directory, from the OS command line, did you try running 
"mvn clean package"?

This takes NetBeans out of the equation; I don't think NetBeans is 
copying stuff from resource to target.

I think maven replicates the resources directory structure under target.

-ernie

On 9/29/2020 10:44 AM, HRH wrote:
>
> Well, I looked into the IDE generated POMs for both project types 
> assiduously and there are no major differences, that would lead one to 
> believe Maven is the culprit here. In summary, during the project 
> build, the resource sub-folder (within the Maven compliant folder 
> structure) is copied from the "src" sub-tree to the "target" sub-tree, 
> by the IDE for the "FXML JavaFX Maven Archetype" projects but this 
> step is completely elided for the "Simple JavaFX Maven Archetype) 
> projects.
>
> Thanks
> On Thursday, September 17, 2020, 11:21:48 PM GMT+4:30, HRH 
> <hr...@yahoo.com.invalid> wrote:
>
>
> That's precisely what I was doing, by looking into the Maven docs, and 
> trying to find a way to copy this file to the right destination 
> folder. The generated pom.xml files for both templates seem identical 
> with the exception of the main class name and the project name, so 
> there must be a reason why they behave differently.
>
> Thanks
>
> On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> On 9/17/2020 11:33 AM, HRH wrote:
> > Ok, I need to be more specific vis-a-vis my last reply. Initially,
> > when I created the src/main/resources sub-folder and put my image.jpg
> > in that directory, Maven copied it the .jpg file to the
> > "target/classes" directory instead of
> > "target/classes/org/openjfx/${package} where all the class files
> > reside. In contrast, for the "FXML JavaFX Archetype (Gluon)" template,
> > Maven copies the content of the "src/main/resources" to
> > "target/classes/org/openjfx/${package} and the runtime can load the 
> file.
>
> It's up to you to figure out what/if maven is doing differently for one
> project and not the other. It's not a NetBeans issue. Take a look at the
> structure under resources
>
> -ernie
>
> >
> > I hope this clarifies the ambiguity in the last reply.
> >
> > On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH
> > <hrh747@yahoo.com.invalid <ma...@yahoo.com.invalid>> wrote:
> >
> >
> > Ernie
> >
> > I have done that (making a "resources" sub-folder under the src/main)
> > but Maven does not copy its content to the "target" subtree. Not 
> sure why?
> >
> > On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael
> > <errael@raelity.com <ma...@raelity.com>> wrote:
> >
> >
> > On 9/17/2020 9:58 AM, HRH wrote:
> > >
> > > Hi Ernie,
> > >
> > > I hear what you're saying about the empty directory. I kept the
> > > artifact in the src/main and manually copied it to the target/classes
> > > tree after the build. However, "Run Main Project" tends to rebuild and
> > > wipe the "target" sub-tree (because I am missing the nb-javac plugin),
> > > which then leads to a runtime error due to missing artifact.
> > > Currently, I going through Maven documentation to figure out a way (I
> > > recall seeing a Maven plugin somewhere) to copy this file from
> > > "main/src" to "target/classes" as the last step in the build and I
> > > believe this will circumvent my issue.
> >
> > I'm confused. Why don't you create the resources directory,
> > .../src/main/resources/ and move the files to there and be done with the
> > problem?
> >
> > You do not seem to have a maven compliant file layout. Why not make it
> > compliant and be done with this whole issue of manually copying files
> > around?
> >
> > -ernie
> >
> > >
> > > Thanks as always for your insight
> > > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> > > <errael@raelity.com <ma...@raelity.com> 
> <mailto:errael@raelity.com <ma...@raelity.com>>> wrote:
> > >
> > >
> > > On 9/17/2020 5:11 AM, HRH wrote:
> > > > Hi,
> > > >
> > > > The "Simple JavaFX Maven Archetype (Gluon)" template from the "New
> > > > Projects->Java with Maven" does not create a resource sub-folder 
> under
> > > > the src subtree, so the developer can store required artifacts (i.e.
> > > > jpg images,etc.) for the project in that folder. If the artifacts
> > > > placed in the src directory with the main and the controller source
> > > > code, the maven does not copy them to the target->classes, hence the
> > > > developer needs to manually copy
> > > The developer can put the resources where they belong for the maven
> > > build system when the developer initially adds them.
> > >
> > > > these artifacts src->main to the "target->classes" after each build,
> > > > to avoid runtime errors.
> > > >
> > > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template 
> always
> > > > creates "Other Sources/src/main/resources/${project.package}" tree
> > > > structure for the artifacts (i.e. fxml, css, images, etc.) and the
> > > > maven copies them to the "target->classes->${package}" sub-folder.
> > > >
> > > > If possible, it would be great if these two templates create a
> > > > consistent tree structure.
> > >
> > >
> > > The FXML project has resources, so it creates the directory and 
> puts the
> > > resources there; the other project type does not does not have 
> resources
> > > and so does not create the directory. You're suggesting creating empty
> > > directories, which SCM will get rid of.
> > >
> > > Just create the directory when you need it. (I kind of agree with you,
> > > but there are so many valid directory structures for a project... The
> > > SCM issue is the clincher, empty directories do not stay around) 
> If you
> > > don't know where the resources are supposed to go, then having some
> > > directory hanging around won't help anyway.
> > >
> > > -ernie
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> > > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> > > For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> > > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>>
> > >
> > > For further information about the NetBeans mailing lists, visit:
> > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> > For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Resource sub-folder for Maven based JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
 
Well, I looked into the IDE generated POMs for both project types assiduously and there are no major differences, that would lead one to believe Maven is the culprit here. In summary, during the project build, the resource sub-folder (within the Maven compliant folder structure) is copied from the "src" sub-tree to the "target" sub-tree, by the IDE for the "FXML JavaFX Maven Archetype" projects but this step is completely elided for the "Simple JavaFX Maven Archetype) projects.
Thanks
    On Thursday, September 17, 2020, 11:21:48 PM GMT+4:30, HRH <hr...@yahoo.com.invalid> wrote:  
 
  That's precisely what I was doing, by looking into the Maven docs, and trying to find a way to copy this file to the right destination folder. The generated pom.xml files for both templates seem identical with the exception of the main class name and the project name, so there must be a reason why they behave differently.

Thanks

    On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael <er...@raelity.com> wrote:  
 
 On 9/17/2020 11:33 AM, HRH wrote:
> Ok, I need to be more specific vis-a-vis my last reply. Initially, 
> when I created the src/main/resources sub-folder and put my image.jpg 
> in that directory, Maven copied it the .jpg file to the 
> "target/classes" directory instead of 
> "target/classes/org/openjfx/${package} where all the class files 
> reside. In contrast, for the "FXML JavaFX Archetype (Gluon)" template, 
> Maven copies the content of the "src/main/resources" to 
> "target/classes/org/openjfx/${package} and the runtime can load the file.

It's up to you to figure out what/if maven is doing differently for one 
project and not the other. It's not a NetBeans issue. Take a look at the 
structure under resources

-ernie

>
> I hope this clarifies the ambiguity in the last reply.
>
> On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH 
> <hr...@yahoo.com.invalid> wrote:
>
>
> Ernie
>
> I have done that (making a "resources" sub-folder under the src/main) 
> but Maven does not copy its content to the "target" subtree. Not sure why?
>
> On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> On 9/17/2020 9:58 AM, HRH wrote:
> >
> > Hi Ernie,
> >
> > I hear what you're saying about the empty directory. I kept the
> > artifact in the src/main and manually copied it to the target/classes
> > tree after the build. However, "Run Main Project" tends to rebuild and
> > wipe the "target" sub-tree (because I am missing the nb-javac plugin),
> > which then leads to a runtime error due to missing artifact.
> > Currently, I going through Maven documentation to figure out a way (I
> > recall seeing a Maven plugin somewhere) to copy this file from
> > "main/src" to "target/classes" as the last step in the build and I
> > believe this will circumvent my issue.
>
> I'm confused. Why don't you create the resources directory,
> .../src/main/resources/ and move the files to there and be done with the
> problem?
>
> You do not seem to have a maven compliant file layout. Why not make it
> compliant and be done with this whole issue of manually copying files
> around?
>
> -ernie
>
> >
> > Thanks as always for your insight
> > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> > <errael@raelity.com <ma...@raelity.com>> wrote:
> >
> >
> > On 9/17/2020 5:11 AM, HRH wrote:
> > > Hi,
> > >
> > > The "Simple JavaFX Maven Archetype (Gluon)" template from the "New
> > > Projects->Java with Maven" does not create a resource sub-folder under
> > > the src subtree, so the developer can store required artifacts (i.e.
> > > jpg images,etc.) for the project in that folder. If the artifacts
> > > placed in the src directory with the main and the controller source
> > > code, the maven does not copy them to the target->classes, hence the
> > > developer needs to manually copy
> > The developer can put the resources where they belong for the maven
> > build system when the developer initially adds them.
> >
> > > these artifacts src->main to the "target->classes" after each build,
> > > to avoid runtime errors.
> > >
> > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template always
> > > creates "Other Sources/src/main/resources/${project.package}" tree
> > > structure for the artifacts (i.e. fxml, css, images, etc.) and the
> > > maven copies them to the "target->classes->${package}" sub-folder.
> > >
> > > If possible, it would be great if these two templates create a
> > > consistent tree structure.
> >
> >
> > The FXML project has resources, so it creates the directory and puts the
> > resources there; the other project type does not does not have resources
> > and so does not create the directory. You're suggesting creating empty
> > directories, which SCM will get rid of.
> >
> > Just create the directory when you need it. (I kind of agree with you,
> > but there are so many valid directory structures for a project... The
> > SCM issue is the clincher, empty directories do not stay around) If you
> > don't know where the resources are supposed to go, then having some
> > directory hanging around won't help anyway.
> >
> > -ernie
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> > For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

    

Re: Resource sub-folder for Maven based JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
 That's precisely what I was doing, by looking into the Maven docs, and trying to find a way to copy this file to the right destination folder. The generated pom.xml files for both templates seem identical with the exception of the main class name and the project name, so there must be a reason why they behave differently.

Thanks

    On Thursday, September 17, 2020, 11:11:27 PM GMT+4:30, Ernie Rael <er...@raelity.com> wrote:  
 
 On 9/17/2020 11:33 AM, HRH wrote:
> Ok, I need to be more specific vis-a-vis my last reply. Initially, 
> when I created the src/main/resources sub-folder and put my image.jpg 
> in that directory, Maven copied it the .jpg file to the 
> "target/classes" directory instead of 
> "target/classes/org/openjfx/${package} where all the class files 
> reside. In contrast, for the "FXML JavaFX Archetype (Gluon)" template, 
> Maven copies the content of the "src/main/resources" to 
> "target/classes/org/openjfx/${package} and the runtime can load the file.

It's up to you to figure out what/if maven is doing differently for one 
project and not the other. It's not a NetBeans issue. Take a look at the 
structure under resources

-ernie

>
> I hope this clarifies the ambiguity in the last reply.
>
> On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH 
> <hr...@yahoo.com.invalid> wrote:
>
>
> Ernie
>
> I have done that (making a "resources" sub-folder under the src/main) 
> but Maven does not copy its content to the "target" subtree. Not sure why?
>
> On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> On 9/17/2020 9:58 AM, HRH wrote:
> >
> > Hi Ernie,
> >
> > I hear what you're saying about the empty directory. I kept the
> > artifact in the src/main and manually copied it to the target/classes
> > tree after the build. However, "Run Main Project" tends to rebuild and
> > wipe the "target" sub-tree (because I am missing the nb-javac plugin),
> > which then leads to a runtime error due to missing artifact.
> > Currently, I going through Maven documentation to figure out a way (I
> > recall seeing a Maven plugin somewhere) to copy this file from
> > "main/src" to "target/classes" as the last step in the build and I
> > believe this will circumvent my issue.
>
> I'm confused. Why don't you create the resources directory,
> .../src/main/resources/ and move the files to there and be done with the
> problem?
>
> You do not seem to have a maven compliant file layout. Why not make it
> compliant and be done with this whole issue of manually copying files
> around?
>
> -ernie
>
> >
> > Thanks as always for your insight
> > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> > <errael@raelity.com <ma...@raelity.com>> wrote:
> >
> >
> > On 9/17/2020 5:11 AM, HRH wrote:
> > > Hi,
> > >
> > > The "Simple JavaFX Maven Archetype (Gluon)" template from the "New
> > > Projects->Java with Maven" does not create a resource sub-folder under
> > > the src subtree, so the developer can store required artifacts (i.e.
> > > jpg images,etc.) for the project in that folder. If the artifacts
> > > placed in the src directory with the main and the controller source
> > > code, the maven does not copy them to the target->classes, hence the
> > > developer needs to manually copy
> > The developer can put the resources where they belong for the maven
> > build system when the developer initially adds them.
> >
> > > these artifacts src->main to the "target->classes" after each build,
> > > to avoid runtime errors.
> > >
> > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template always
> > > creates "Other Sources/src/main/resources/${project.package}" tree
> > > structure for the artifacts (i.e. fxml, css, images, etc.) and the
> > > maven copies them to the "target->classes->${package}" sub-folder.
> > >
> > > If possible, it would be great if these two templates create a
> > > consistent tree structure.
> >
> >
> > The FXML project has resources, so it creates the directory and puts the
> > resources there; the other project type does not does not have resources
> > and so does not create the directory. You're suggesting creating empty
> > directories, which SCM will get rid of.
> >
> > Just create the directory when you need it. (I kind of agree with you,
> > but there are so many valid directory structures for a project... The
> > SCM issue is the clincher, empty directories do not stay around) If you
> > don't know where the resources are supposed to go, then having some
> > directory hanging around won't help anyway.
> >
> > -ernie
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> > For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

  

Re: Resource sub-folder for Maven based JavaFX

Posted by Ernie Rael <er...@raelity.com>.
On 9/17/2020 11:33 AM, HRH wrote:
> Ok, I need to be more specific vis-a-vis my last reply. Initially, 
> when I created the src/main/resources sub-folder and put my image.jpg 
> in that directory, Maven copied it the .jpg file to the 
> "target/classes" directory instead of 
> "target/classes/org/openjfx/${package} where all the class files 
> reside. In contrast, for the "FXML JavaFX Archetype (Gluon)" template, 
> Maven copies the content of the "src/main/resources" to 
> "target/classes/org/openjfx/${package} and the runtime can load the file.

It's up to you to figure out what/if maven is doing differently for one 
project and not the other. It's not a NetBeans issue. Take a look at the 
structure under resources

-ernie

>
> I hope this clarifies the ambiguity in the last reply.
>
> On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH 
> <hr...@yahoo.com.invalid> wrote:
>
>
> Ernie
>
> I have done that (making a "resources" sub-folder under the src/main) 
> but Maven does not copy its content to the "target" subtree. Not sure why?
>
> On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> On 9/17/2020 9:58 AM, HRH wrote:
> >
> > Hi Ernie,
> >
> > I hear what you're saying about the empty directory. I kept the
> > artifact in the src/main and manually copied it to the target/classes
> > tree after the build. However, "Run Main Project" tends to rebuild and
> > wipe the "target" sub-tree (because I am missing the nb-javac plugin),
> > which then leads to a runtime error due to missing artifact.
> > Currently, I going through Maven documentation to figure out a way (I
> > recall seeing a Maven plugin somewhere) to copy this file from
> > "main/src" to "target/classes" as the last step in the build and I
> > believe this will circumvent my issue.
>
> I'm confused. Why don't you create the resources directory,
> .../src/main/resources/ and move the files to there and be done with the
> problem?
>
> You do not seem to have a maven compliant file layout. Why not make it
> compliant and be done with this whole issue of manually copying files
> around?
>
> -ernie
>
> >
> > Thanks as always for your insight
> > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> > <errael@raelity.com <ma...@raelity.com>> wrote:
> >
> >
> > On 9/17/2020 5:11 AM, HRH wrote:
> > > Hi,
> > >
> > > The "Simple JavaFX Maven Archetype (Gluon)" template from the "New
> > > Projects->Java with Maven" does not create a resource sub-folder under
> > > the src subtree, so the developer can store required artifacts (i.e.
> > > jpg images,etc.) for the project in that folder. If the artifacts
> > > placed in the src directory with the main and the controller source
> > > code, the maven does not copy them to the target->classes, hence the
> > > developer needs to manually copy
> > The developer can put the resources where they belong for the maven
> > build system when the developer initially adds them.
> >
> > > these artifacts src->main to the "target->classes" after each build,
> > > to avoid runtime errors.
> > >
> > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template always
> > > creates "Other Sources/src/main/resources/${project.package}" tree
> > > structure for the artifacts (i.e. fxml, css, images, etc.) and the
> > > maven copies them to the "target->classes->${package}" sub-folder.
> > >
> > > If possible, it would be great if these two templates create a
> > > consistent tree structure.
> >
> >
> > The FXML project has resources, so it creates the directory and puts the
> > resources there; the other project type does not does not have resources
> > and so does not create the directory. You're suggesting creating empty
> > directories, which SCM will get rid of.
> >
> > Just create the directory when you need it. (I kind of agree with you,
> > but there are so many valid directory structures for a project... The
> > SCM issue is the clincher, empty directories do not stay around) If you
> > don't know where the resources are supposed to go, then having some
> > directory hanging around won't help anyway.
> >
> > -ernie
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> > For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Resource sub-folder for Maven based JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
 Ok, I need to be more specific vis-a-vis my last reply. Initially, when I created the src/main/resources sub-folder and put my image.jpg in that directory, Maven copied it the .jpg file to the "target/classes" directory instead of "target/classes/org/openjfx/${package} where all the class files reside. In contrast, for the "FXML JavaFX Archetype (Gluon)" template, Maven copies the content of the "src/main/resources" to "target/classes/org/openjfx/${package} and the runtime can load the file.
I hope this clarifies the ambiguity in the last reply.

    On Thursday, September 17, 2020, 10:31:40 PM GMT+4:30, HRH <hr...@yahoo.com.invalid> wrote:  
 
  Ernie
I have done that (making a "resources" sub-folder under the src/main) but Maven does not copy its content to the "target" subtree. Not sure why?

    On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael <er...@raelity.com> wrote:  
 
 On 9/17/2020 9:58 AM, HRH wrote:
>
> Hi Ernie,
>
> I hear what you're saying about the empty directory. I kept the 
> artifact in the src/main and manually copied it to the target/classes 
> tree after the build. However, "Run Main Project" tends to rebuild and 
> wipe the "target" sub-tree (because I am missing the nb-javac plugin), 
> which then leads to a runtime error due to missing artifact. 
> Currently, I going through Maven documentation to figure out a way (I 
> recall seeing a Maven plugin somewhere) to copy this file from 
> "main/src" to "target/classes" as the last step in the build and I 
> believe this will circumvent my issue.

I'm confused. Why don't you create the resources directory, 
.../src/main/resources/ and move the files to there and be done with the 
problem?

You do not seem to have a maven compliant file layout. Why not make it 
compliant and be done with this whole issue of manually copying files 
around?

-ernie

>
> Thanks as always for your insight
> On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> On 9/17/2020 5:11 AM, HRH wrote:
> > Hi,
> >
> > The "Simple JavaFX Maven Archetype (Gluon)" template from the "New
> > Projects->Java with Maven" does not create a resource sub-folder under
> > the src subtree, so the developer can store required artifacts (i.e.
> > jpg images,etc.) for the project in that folder. If the artifacts
> > placed in the src directory with the main and the controller source
> > code, the maven does not copy them to the target->classes, hence the
> > developer needs to manually copy
> The developer can put the resources where they belong for the maven
> build system when the developer initially adds them.
>
> > these artifacts src->main to the "target->classes" after each build,
> > to avoid runtime errors.
> >
> > In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template always
> > creates "Other Sources/src/main/resources/${project.package}" tree
> > structure for the artifacts (i.e. fxml, css, images, etc.) and the
> > maven copies them to the "target->classes->${package}" sub-folder.
> >
> > If possible, it would be great if these two templates create a
> > consistent tree structure.
>
>
> The FXML project has resources, so it creates the directory and puts the
> resources there; the other project type does not does not have resources
> and so does not create the directory. You're suggesting creating empty
> directories, which SCM will get rid of.
>
> Just create the directory when you need it. (I kind of agree with you,
> but there are so many valid directory structures for a project... The
> SCM issue is the clincher, empty directories do not stay around) If you
> don't know where the resources are supposed to go, then having some
> directory hanging around won't help anyway.
>
> -ernie
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

    

Re: Resource sub-folder for Maven based JavaFX

Posted by Ernie Rael <er...@raelity.com>.
On 9/17/2020 11:01 AM, HRH wrote:
> Ernie
>
> I have done that (making a "resources" sub-folder under the src/main) 
> but Maven does not copy its content to the "target" subtree. Not sure why?

To be clear. If, with no IDE, you do "mvn clean package" (or whatever 
you specifically need) the resources are not copied for one project 
(simple javafx) but they are copied for a different project (fxml). So 
this is a problem that has nothing to do with NetBeans.

-ernie

>
> On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> On 9/17/2020 9:58 AM, HRH wrote:
> >
> > Hi Ernie,
> >
> > I hear what you're saying about the empty directory. I kept the
> > artifact in the src/main and manually copied it to the target/classes
> > tree after the build. However, "Run Main Project" tends to rebuild and
> > wipe the "target" sub-tree (because I am missing the nb-javac plugin),
> > which then leads to a runtime error due to missing artifact.
> > Currently, I going through Maven documentation to figure out a way (I
> > recall seeing a Maven plugin somewhere) to copy this file from
> > "main/src" to "target/classes" as the last step in the build and I
> > believe this will circumvent my issue.
>
> I'm confused. Why don't you create the resources directory,
> .../src/main/resources/ and move the files to there and be done with the
> problem?
>
> You do not seem to have a maven compliant file layout. Why not make it
> compliant and be done with this whole issue of manually copying files
> around?
>
> -ernie
>
> >
> > Thanks as always for your insight
> > On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael
> > <errael@raelity.com <ma...@raelity.com>> wrote:
> >
> >
> > On 9/17/2020 5:11 AM, HRH wrote:
> > > Hi,
> > >
> > > The "Simple JavaFX Maven Archetype (Gluon)" template from the "New
> > > Projects->Java with Maven" does not create a resource sub-folder under
> > > the src subtree, so the developer can store required artifacts (i.e.
> > > jpg images,etc.) for the project in that folder. If the artifacts
> > > placed in the src directory with the main and the controller source
> > > code, the maven does not copy them to the target->classes, hence the
> > > developer needs to manually copy
> > The developer can put the resources where they belong for the maven
> > build system when the developer initially adds them.
> >
> > > these artifacts src->main to the "target->classes" after each build,
> > > to avoid runtime errors.
> > >
> > > In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template always
> > > creates "Other Sources/src/main/resources/${project.package}" tree
> > > structure for the artifacts (i.e. fxml, css, images, etc.) and the
> > > maven copies them to the "target->classes->${package}" sub-folder.
> > >
> > > If possible, it would be great if these two templates create a
> > > consistent tree structure.
> >
> >
> > The FXML project has resources, so it creates the directory and puts the
> > resources there; the other project type does not does not have resources
> > and so does not create the directory. You're suggesting creating empty
> > directories, which SCM will get rid of.
> >
> > Just create the directory when you need it. (I kind of agree with you,
> > but there are so many valid directory structures for a project... The
> > SCM issue is the clincher, empty directories do not stay around) If you
> > don't know where the resources are supposed to go, then having some
> > directory hanging around won't help anyway.
> >
> > -ernie
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> > For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> > <mailto:users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>>
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Resource sub-folder for Maven based JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
 Ernie
I have done that (making a "resources" sub-folder under the src/main) but Maven does not copy its content to the "target" subtree. Not sure why?

    On Thursday, September 17, 2020, 10:16:20 PM GMT+4:30, Ernie Rael <er...@raelity.com> wrote:  
 
 On 9/17/2020 9:58 AM, HRH wrote:
>
> Hi Ernie,
>
> I hear what you're saying about the empty directory. I kept the 
> artifact in the src/main and manually copied it to the target/classes 
> tree after the build. However, "Run Main Project" tends to rebuild and 
> wipe the "target" sub-tree (because I am missing the nb-javac plugin), 
> which then leads to a runtime error due to missing artifact. 
> Currently, I going through Maven documentation to figure out a way (I 
> recall seeing a Maven plugin somewhere) to copy this file from 
> "main/src" to "target/classes" as the last step in the build and I 
> believe this will circumvent my issue.

I'm confused. Why don't you create the resources directory, 
.../src/main/resources/ and move the files to there and be done with the 
problem?

You do not seem to have a maven compliant file layout. Why not make it 
compliant and be done with this whole issue of manually copying files 
around?

-ernie

>
> Thanks as always for your insight
> On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> On 9/17/2020 5:11 AM, HRH wrote:
> > Hi,
> >
> > The "Simple JavaFX Maven Archetype (Gluon)" template from the "New
> > Projects->Java with Maven" does not create a resource sub-folder under
> > the src subtree, so the developer can store required artifacts (i.e.
> > jpg images,etc.) for the project in that folder. If the artifacts
> > placed in the src directory with the main and the controller source
> > code, the maven does not copy them to the target->classes, hence the
> > developer needs to manually copy
> The developer can put the resources where they belong for the maven
> build system when the developer initially adds them.
>
> > these artifacts src->main to the "target->classes" after each build,
> > to avoid runtime errors.
> >
> > In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template always
> > creates "Other Sources/src/main/resources/${project.package}" tree
> > structure for the artifacts (i.e. fxml, css, images, etc.) and the
> > maven copies them to the "target->classes->${package}" sub-folder.
> >
> > If possible, it would be great if these two templates create a
> > consistent tree structure.
>
>
> The FXML project has resources, so it creates the directory and puts the
> resources there; the other project type does not does not have resources
> and so does not create the directory. You're suggesting creating empty
> directories, which SCM will get rid of.
>
> Just create the directory when you need it. (I kind of agree with you,
> but there are so many valid directory structures for a project... The
> SCM issue is the clincher, empty directories do not stay around) If you
> don't know where the resources are supposed to go, then having some
> directory hanging around won't help anyway.
>
> -ernie
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

  

Re: Resource sub-folder for Maven based JavaFX

Posted by Ernie Rael <er...@raelity.com>.
On 9/17/2020 9:58 AM, HRH wrote:
>
> Hi Ernie,
>
> I hear what you're saying about the empty directory. I kept the 
> artifact in the src/main and manually copied it to the target/classes 
> tree after the build. However, "Run Main Project" tends to rebuild and 
> wipe the "target" sub-tree (because I am missing the nb-javac plugin), 
> which then leads to a runtime error due to missing artifact. 
> Currently, I going through Maven documentation to figure out a way (I 
> recall seeing a Maven plugin somewhere) to copy this file from 
> "main/src" to "target/classes" as the last step in the build and I 
> believe this will circumvent my issue.

I'm confused. Why don't you create the resources directory, 
.../src/main/resources/ and move the files to there and be done with the 
problem?

You do not seem to have a maven compliant file layout. Why not make it 
compliant and be done with this whole issue of manually copying files 
around?

-ernie

>
> Thanks as always for your insight
> On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> On 9/17/2020 5:11 AM, HRH wrote:
> > Hi,
> >
> > The "Simple JavaFX Maven Archetype (Gluon)" template from the "New
> > Projects->Java with Maven" does not create a resource sub-folder under
> > the src subtree, so the developer can store required artifacts (i.e.
> > jpg images,etc.) for the project in that folder. If the artifacts
> > placed in the src directory with the main and the controller source
> > code, the maven does not copy them to the target->classes, hence the
> > developer needs to manually copy
> The developer can put the resources where they belong for the maven
> build system when the developer initially adds them.
>
> > these artifacts src->main to the "target->classes" after each build,
> > to avoid runtime errors.
> >
> > In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template always
> > creates "Other Sources/src/main/resources/${project.package}" tree
> > structure for the artifacts (i.e. fxml, css, images, etc.) and the
> > maven copies them to the "target->classes->${package}" sub-folder.
> >
> > If possible, it would be great if these two templates create a
> > consistent tree structure.
>
>
> The FXML project has resources, so it creates the directory and puts the
> resources there; the other project type does not does not have resources
> and so does not create the directory. You're suggesting creating empty
> directories, which SCM will get rid of.
>
> Just create the directory when you need it. (I kind of agree with you,
> but there are so many valid directory structures for a project... The
> SCM issue is the clincher, empty directories do not stay around) If you
> don't know where the resources are supposed to go, then having some
> directory hanging around won't help anyway.
>
> -ernie
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Resource sub-folder for Maven based JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
 
Hi Ernie,
I hear what you're saying about the empty directory. I kept the artifact in the src/main and manually copied it to the target/classes tree after the build. However, "Run Main Project" tends to rebuild and wipe the "target" sub-tree (because I am missing the nb-javac plugin), which then leads to a runtime error due to missing artifact. Currently, I going through Maven documentation to figure out a way (I recall seeing a Maven plugin somewhere) to copy this file from "main/src" to "target/classes" as the last step in the build and I believe this will circumvent my issue.
Thanks as always for your insight
    On Thursday, September 17, 2020, 7:47:21 PM GMT+4:30, Ernie Rael <er...@raelity.com> wrote:  
 
 On 9/17/2020 5:11 AM, HRH wrote:
> Hi,
>
> The "Simple JavaFX Maven Archetype (Gluon)" template from the "New 
> Projects->Java with Maven" does not create a resource sub-folder under 
> the src subtree, so the developer can store required artifacts (i.e. 
> jpg images,etc.) for the project in that folder. If the artifacts 
> placed in the src directory with the main and the controller source 
> code, the maven does not copy them to the target->classes, hence the 
> developer needs to manually copy
The developer can put the resources where they belong for the maven 
build system when the developer initially adds them.
> these artifacts src->main to the "target->classes" after each build, 
> to avoid runtime errors.
>
> In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template always 
> creates "Other Sources/src/main/resources/${project.package}" tree 
> structure for the artifacts (i.e. fxml, css, images, etc.) and the 
> maven copies them to the "target->classes->${package}" sub-folder.
>
> If possible, it would be great if these two templates create a 
> consistent tree structure.

The FXML project has resources, so it creates the directory and puts the 
resources there; the other project type does not does not have resources 
and so does not create the directory. You're suggesting creating empty 
directories, which SCM will get rid of.

Just create the directory when you need it. (I kind of agree with you, 
but there are so many valid directory structures for a project... The 
SCM issue is the clincher, empty directories do not stay around) If you 
don't know where the resources are supposed to go, then having some 
directory hanging around won't help anyway.

-ernie


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

  

Re: Resource sub-folder for Maven based JavaFX

Posted by Ernie Rael <er...@raelity.com>.
On 9/17/2020 5:11 AM, HRH wrote:
> Hi,
>
> The "Simple JavaFX Maven Archetype (Gluon)" template from the "New 
> Projects->Java with Maven" does not create a resource sub-folder under 
> the src subtree, so the developer can store required artifacts (i.e. 
> jpg images,etc.) for the project in that folder. If the artifacts 
> placed in the src directory with the main and the controller source 
> code, the maven does not copy them to the target->classes, hence the 
> developer needs to manually copy
The developer can put the resources where they belong for the maven 
build system when the developer initially adds them.
> these artifacts src->main to the "target->classes" after each build, 
> to avoid runtime errors.
>
> In contrast, the "FXML JavaFX Maven Archetype (Gluon)" template always 
> creates "Other Sources/src/main/resources/${project.package}" tree 
> structure for the artifacts (i.e. fxml, css, images, etc.) and the 
> maven copies them to the "target->classes->${package}" sub-folder.
>
> If possible, it would be great if these two templates create a 
> consistent tree structure.

The FXML project has resources, so it creates the directory and puts the 
resources there; the other project type does not does not have resources 
and so does not create the directory. You're suggesting creating empty 
directories, which SCM will get rid of.

Just create the directory when you need it. (I kind of agree with you, 
but there are so many valid directory structures for a project... The 
SCM issue is the clincher, empty directories do not stay around) If you 
don't know where the resources are supposed to go, then having some 
directory hanging around won't help anyway.

-ernie


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists