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 <hrh...@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 <err...@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 > <err...@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-unsubscr...@netbeans.apache.org > <mailto:users-unsubscr...@netbeans.apache.org> > For additional commands, e-mail: users-h...@netbeans.apache.org > <mailto:users-h...@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-unsubscr...@netbeans.apache.org For additional commands, e-mail: users-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists