Ema.jar Ema.jar - 1 month ago 16
Java Question

org.apache.maven.plugins:maven-resources-plugin:2.5:resources (No such file or directory) -> [Help 1]

I'm trying to install a project using Maven but I get this error

Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project locanda: /opt/h2/databases/locanda.h2.db (No such file or directory) -> [Help 1]


I've tried to edit my project folder adding /opt/h2/databases/locanda.h2.db but the error still appears.

You can read my pom.xml here. If I remove the line:

<db.folder>/opt/h2/databases</db.folder>


the installation ends with no problems.

This is stack trace for the error, retrieved using clean install -X

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project locanda: /opt/h2/databases/locanda.h2.db (No such file or directory) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project locanda: /opt/h2/databases/locanda.h2.db (No such file or directory)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: org.apache.maven.plugin.MojoExecutionException: /opt/h2/databases/locanda.h2.db (No such file or directory)
at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:316)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 25 more
Caused by: org.apache.maven.shared.filtering.MavenFilteringException: /opt/h2/databases/locanda.h2.db (No such file or directory)
at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile(DefaultMavenFileFilter.java:130)
at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources(DefaultMavenResourcesFiltering.java:267)
at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:310)
... 27 more
Caused by: java.io.FileNotFoundException: /opt/h2/databases/locanda.h2.db (No such file or directory)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
at org.codehaus.plexus.util.FileUtils.copyStreamToFile(FileUtils.java:1107)
at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1013)
at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:2234)
at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile(DefaultMavenFileFilter.java:123)
... 29 more


The folder of my project can be found here.

Can you show me the cause of the problem? I'm trying to learn Maven and I would really appreciate some help.

P.s.
I'm unsing IntelliJ.

Answer

Try using <db.folder>opt/h2/databases</db.folder>.

I have removed the first forward slash.

Comments