maven builds fails inside ubuntu vagrant machine as well as docker instance

I am developing an api using jaxb. The maven build (using jdk-7) works on my local windows machine. Now if I try to build it on my vagrant box (ubuntu/trusty64) after setting up maven and openjdk7 on the vm, I get following error on performing mvn clean install: (operation not permitted)

  • Debug rails app inside docker use Intellij/Rubymine
  • Docker: How to use redirect (command >> file.txt) from CMD[]?
  • Using docker-compose in Dockerfile
  • How to use docker for deployment and development?
  • Connecting to postgres from a docker container
  • libcontainer, runc and nsenter bootstrap
  • There are in all 5 projects as part of my pom.xml, the first 3 (business and projects) gets built successfully, only the 4th one (which generates the war) file fails with this error when it is trying to generate the war file. Maven was successful in copying other files into the target folder for other projects.

    Also, I am able to do perform maven builds on the same machine without errors on simple java projects (from

    My guess is the Vagrant Virtualbox VM is not is not able to allocate required resources to JVM but i am clueless on how i could do it. I did try to increase the memory footprint by setting the maven properties on my vm

    export MAVEN_OPTS=”-Xms1024m -Xmx4096m -XX:PermSize=1024m”

    Detailed error:

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.4:war (default-war) on project '<app>' : Could not copy webapp classes [/usr/src/<app>/target/classes]: /usr/src/<app>/target/<app>-<my-app-src>/rest/config/ResourceConfig.class (Operation not permitted) -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.4:war (default-war) on project <my-app>: Could not copy webapp classes [/vagrant_data/<my-app-src>/<my-app>/target/classes]
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(
        at org.apache.maven.DefaultMaven.doExecute(
        at org.apache.maven.DefaultMaven.execute(
        at org.apache.maven.cli.MavenCli.execute(
        at org.apache.maven.cli.MavenCli.doMain(
        at org.apache.maven.cli.MavenCli.main(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(
    Caused by: org.apache.maven.plugin.MojoExecutionException: Could not copy webapp classes [/vagrant_data/<my-apps-src>/target/classes]
        at org.apache.maven.plugin.war.packaging.ClassesPackagingTask.performPackaging(
        at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleClassesDirectory(
        at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(
        at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(
        at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(
        at org.apache.maven.plugin.war.WarMojo.performPackaging(
        at org.apache.maven.plugin.war.WarMojo.execute(
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
        ... 19 more
    Caused by: /vagrant_data/<my-apps-src>/target/<my-app>-<my-app-src>/rest/config/ResourceConfig.class (Operation not permitted)
        at Method)
        at org.codehaus.plexus.util.FileUtils.doCopyFile(
        at org.codehaus.plexus.util.FileUtils.copyFile(
        at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(
        at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask$1.registered(
        at org.apache.maven.plugin.war.util.WebappStructure.registerFile(
        at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(
        at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFiles(
        at org.apache.maven.plugin.war.packaging.ClassesPackagingTask.performPackaging(
        ... 27 more

  • nginx in docker how to disable http redirects to https
  • Can't run Docker container from image after commit
  • Docker Ignores limits.conf (trying to solve “too many open files” error)
  • Get list of containers/services of docker-compose from inside a container
  • 502 Bad Gateway on Docker, NPM, PHPFPM and Symfony
  • Docker-Compose build failing on Google App Engine
  • One Solution collect form web for “maven builds fails inside ubuntu vagrant machine as well as docker instance”

    it seems that you don’t have permision to write in that folder.
    you could try using chmod 777 . -R in the vagrant shared folder. Also before doing this you could check if you can create a new file in the target directory by “touch target/newFile”.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.