title: Deploying maven project to glassfish with Netbeans
body: <p>this is my first post here so I would like to say hi to this wonderful community. Tips found here helped me many times, but now I am in need to ask a question</p>
  
  <p>So here is my problem. I'm struggling to deploy a simple maven application into Glassfish server, just to check if my configuration is correct for further developing. I useNetbeans IDE, but since it provides small and barely readable console log, I try to do so using system Terminal (I use Fedora).</p>
  
  <p>Application I'm trying to deploy consists of a Stateless EJB bean (called DziekanatBean and currently doing nothing) and a Maven POM project (simply called maven), which includes this EJB bean as module. I try to deploy the whole project using</p>
  
  <pre>mvn -e glassfish:deploy</pre>
  
  <p>Project does not deploy, I occur following errors:</p>
  
  <pre><code>[INFO] Error stacktraces are turned on.
  [INFO] Scanning for projects...
  [INFO] ------------------------------------------------------------------------
  [INFO] Reactor Build Order:
  [INFO] 
  [INFO] maven
  [INFO] DziekanatBean
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building maven 1.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-glassfish-plugin:2.1:deploy (default-cli) @ maven ---
  Downloading: http://maven.ocean.net.au/release/org/apache/maven/maven-plugin-api/maven-metadata.xml
  Downloading: http://maven.ocean.net.au/external/org/apache/maven/maven-plugin-api/maven-metadata.xml
  Downloading: http://maven.ocean.net.au/snapshot/org/apache/maven/maven-plugin-api/maven-metadata.xml
  [WARNING] Could not transfer metadata org.apache.maven:maven-plugin-api/maven-metadata.xml from/to release.ocean.net.au (http://maven.ocean.net.au/release): maven.ocean.net.au: Ta nazwa lub usługa jest nieznana
  [WARNING] Could not transfer metadata org.apache.maven:maven-plugin-api/maven-metadata.xml from/to external.ocean.net.au (http://maven.ocean.net.au/external): maven.ocean.net.au
  [WARNING] Could not transfer metadata org.apache.maven:maven-plugin-api/maven-metadata.xml from/to snapshot.ocean.net.au (http://maven.ocean.net.au/snapshot): maven.ocean.net.au
  [INFO] asadmin --host localhost --port 4848 --user anonymous --passwordfile /tmp/mgfp3352576098599531177.tmp --interactive=false --echo=true --terse=true deploy --name maven --force=false --precompilejsp=false --verify=false --generatermistubs=false --availabilityenabled=false --asyncreplication=true --keepreposdir=false --keepfailedstubs=false --isredeploy=false --logreportederrors=true --upload=false "/mnt/D/Studia/Semestr 4/java/projekt/maven/target/Dziekanat.jar"
  [ERROR] remote failure: File not found : /mnt/D/Studia/Semestr 4/java/projekt/maven/target/Dziekanat.jar
  [ERROR] Deployment of /mnt/D/Studia/Semestr 4/java/projekt/maven/target/Dziekanat.jar failed.
  [ERROR] For more detail on what might be causing the problem try running maven with the --debug option 
  [ERROR] or setting the maven-glassfish-plugin "echo" property to "true".
  [INFO] ------------------------------------------------------------------------
  [INFO] Reactor Summary:
  [INFO] 
  [INFO] maven ............................................. FAILURE [16.724s]
  [INFO] DziekanatBean ..................................... SKIPPED
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 16.893s
  [INFO] Finished at: Sat May 18 23:45:39 CEST 2013
  [INFO] Final Memory: 12M/172M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.glassfish.maven.plugin:maven-glassfish-plugin:2.1:deploy (default-cli) on project maven: Deployment of /mnt/D/Studia/Semestr 4/java/projekt/maven/target/Dziekanat.jar failed. -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.glassfish.maven.plugin:maven-glassfish-plugin:2.1:deploy (default-cli) on project maven: Deployment of /mnt/D/Studia/Semestr 4/java/projekt/maven/target/Dziekanat.jar failed.
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
      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:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      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)
  Caused by: org.apache.maven.plugin.MojoFailureException: Deployment of /mnt/D/Studia/Semestr 4/java/projekt/maven/target/Dziekanat.jar failed.
      at org.glassfish.maven.plugin.command.AsadminCommand.execute(AsadminCommand.java:121)
      at org.glassfish.maven.plugin.DeployGlassfishMojo.doExecute(DeployGlassfishMojo.java:66)
      at au.net.ocean.maven.plugin.OceanMojo.execute(OceanMojo.java:67)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      ... 19 more
  [ERROR] 
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
  </code></pre>
  
  <p>These are my settings:<br />
  <b>~/.m2/settings.xml</b></p>
  
  <pre><code>&lt;settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                        http://maven.apache.org/xsd/settings-1.0.0.xsd"&gt;
      &lt;localRepository/&gt;
      &lt;interactiveMode/&gt;
      &lt;usePluginRegistry/&gt;
      &lt;offline/&gt;
      &lt;pluginGroups/&gt;
      &lt;servers/&gt;
      &lt;mirrors/&gt;
      &lt;priveProfiles&gt;
      &lt;activeProfile&gt;glassfish-context&lt;/activeProfile&gt;
  &lt;/activeProfoxies/&gt;
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;glassfish-context&lt;/id&gt;
              &lt;properties&gt;
                  &lt;local.glassfish.home&gt;/usr/lib64/glassfish&lt;/local.glassfish.home&gt;
                  &lt;local.glassfish.user&gt;admin&lt;/local.glassfish.user&gt;
                  &lt;local.glassfish.domain&gt;domain1&lt;/local.glassfish.domain&gt;
                  &lt;local.glassfish.httpPort&gt;8080&lt;/local.glassfish.httpPort&gt;
                  &lt;local.glassfish.adminPort&gt;4848&lt;/local.glassfish.adminPort&gt;
              &lt;/properties&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
      &lt;activeProfiles&gt;
          &lt;activeProfile&gt;glassfish-context&lt;/activeProfile&gt;
      &lt;/activeProfiles&gt;
  &lt;/settings&gt;
  </code></pre>
  
  <p><b>pom.xml</b></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.zulik&lt;/groupId&gt;
      &lt;artifactId&gt;maven&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
      &lt;name&gt;maven&lt;/name&gt;
      &lt;modules&gt;
          &lt;module&gt;DziekanatBean&lt;/module&gt;
      &lt;/modules&gt;
      &lt;pluginRepositories&gt;
          &lt;pluginRepository&gt;
  
              &lt;id&gt;maven.java.net&lt;/id&gt;
              &lt;name&gt;Java.net Maven2 Repository&lt;/name&gt;
              &lt;url&gt;http://download.java.net/maven/2&lt;/url&gt;
          &lt;/pluginRepository&gt;
      &lt;/pluginRepositories&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.11&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;build&gt;
          &lt;finalName&gt;Dziekanat&lt;/finalName&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.glassfish.maven.plugin&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-glassfish-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;glassfishDirectory&gt;${local.glassfish.home}&lt;/glassfishDirectory&gt;
                      &lt;echo&gt;true&lt;/echo&gt;
                      &lt;debug&gt;true&lt;/debug&gt;
                      &lt;autoCreate&gt;true&lt;/autoCreate&gt;
                      &lt;glassfishDirectory&gt;${local.glassfish.home}&lt;/glassfishDirectory&gt;
                      &lt;user&gt;anonymous&lt;/user&gt;
                      &lt;adminPassword&gt;password_here&lt;/adminPassword&gt;
  
                      &lt;domain&gt;
                          &lt;name&gt;${local.glassfish.domain}&lt;/name&gt;
                          &lt;httpPort&gt;${local.glassfish.httpPort}&lt;/httpPort&gt;
                          &lt;adminPort&gt;${local.glassfish.adminPort}&lt;/adminPort&gt;
                      &lt;/domain&gt;
                      &lt;components&gt;
                          &lt;component&gt;
                              &lt;name&gt;${project.artifactId}&lt;/name&gt;
                              &lt;artifact&gt;${project.build.directory}/${project.build.finalName}.jar&lt;/artifact&gt;
                          &lt;/component&gt;
                      &lt;/components&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Thanks in advance for any help.</p>