Maven Tomcat7:deploy "Cannot invoke Tomcat manager: Connection refused: connect" - java

I'm trying to deploy my web app on Tomcat 7 with Maven (version 3.2.1), but getting exception listed in the title.
I've tried following solutions from questions (tomcat:deploy: "Cannot invoke Tomcat manager: Connection refused", Tomcat deployement issue in a Maven project):
Use tomcat user with manager-script role (respectfully edited settings.xml, pom.xml, tomcat-users.xml)
Deploy without specifying tomcat user.
Use diff maven commands e.g.: clean install tomcat7:deploy, clean tomcat7:deploy, tomcat7:redeploy, tomcat7:redeploy-only.
Also I should mention that if I'm running app on server without maven i.e. Project > Run As > Run on Server or using maven tomcat7-run goals i.e. clean install tomcat7:run then it all works as fine.
This is how I edit settings.xml, pom.xml, tomcat-users.xml when using tomcat user.
tomcat-users.xml:
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="user" password="pass" roles="manager-script"></user>
</tomcat-users>
settings.xml:
<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">
<localRepository>${user.home}/.m2/repository</localRepository>
<interactiveMode>true</interactiveMode>
<usePluginRegistry>false</usePluginRegistry>
<offline>false</offline>
<servers>
<server>
<id>apache-tomcat-7</id>
<username>user</username>
<password>pass</password>
</server>
</servers>
</settings>
pom.xml:
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example.company</groupId>
<artifactId>magazine</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>market Maven Webapp</name>
<url>http://maven.apache.org</url>
<build>
<finalName>${project.artifactId}</finalName>
<outputDirectory>${CATALINA_HOME}/webapps/${project.artifactId}/${project.artifactId}</outputDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<server>apache-tomcat-7</server>
<url>http://localhost:8080/manager/text</url>
<path>/${project.artifactId}</path>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</build>
...//dependencies
</project>
EDIT:
My Maven output with goals clean install tomcat7:deploy -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building market Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # magazine ---
[INFO] Deleting D:\git\magazine\target
[INFO] Deleting D:\EclipseWorkspace\apache-tomcat-7.0.59\webapps\magazine\magazine
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # magazine ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # magazine ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 19 source files to D:\EclipseWorkspace\apache-tomcat-7.0.59\webapps\magazine\magazine
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # magazine ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\git\magazine\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # magazine ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # magazine ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.4:war (default-war) # magazine ---
[INFO] Packaging webapp
[INFO] Assembling webapp [magazine] in [D:\git\magazine\target\magazine]
[INFO] Processing war project
[INFO] Copying webapp resources [D:\git\magazine\src\main\webapp]
[INFO] Webapp assembled in [376 msecs]
[INFO] Building war: D:\git\magazine\target\magazine.war
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # magazine ---
[INFO] Installing D:\git\magazine\target\magazine.war to C:\Users\Mark\.m2\repository\ua\khpi\norkin\magazine\0.0.1-SNAPSHOT\magazine-0.0.1-SNAPSHOT.war
[INFO] Installing D:\git\magazine\pom.xml to C:\Users\Mark\.m2\repository\ua\khpi\norkin\magazine\0.0.1-SNAPSHOT\magazine-0.0.1-SNAPSHOT.pom
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:deploy (default-cli) # magazine >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # magazine ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # magazine ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # magazine ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\git\magazine\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # magazine ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # magazine ---
[INFO] No tests to run.
[INFO] Skipping execution of surefire because it has already been run for this configuration
[INFO]
[INFO] --- maven-war-plugin:2.4:war (default-war) # magazine ---
[INFO] Packaging webapp
[INFO] Assembling webapp [magazine] in [D:\git\magazine\target\magazine]
[INFO] Processing war project
[INFO] Copying webapp resources [D:\git\magazine\src\main\webapp]
[INFO] Webapp assembled in [221 msecs]
[INFO] Building war: D:\git\magazine\target\magazine.war
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:deploy (default-cli) # magazine <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:deploy (default-cli) # magazine ---
[INFO] Deploying war to http://localhost:8080/magazine
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.622 s
[INFO] Finished at: 2015-03-08T11:09:46+02:00
[INFO] Final Memory: 25M/221M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project magazine: Cannot invoke Tomcat manager: Connection refused: connect -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project magazine: Cannot invoke Tomcat manager
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
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:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
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:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot invoke Tomcat manager
at org.apache.tomcat.maven.plugin.tomcat7.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:141)
at org.apache.tomcat.maven.plugin.tomcat7.AbstractWarCatalinaMojo.execute(AbstractWarCatalinaMojo.java:68)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:178)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.tomcat.maven.common.deployer.TomcatManager.invoke(TomcatManager.java:742)
at org.apache.tomcat.maven.common.deployer.TomcatManager.deployImpl(TomcatManager.java:705)
at org.apache.tomcat.maven.common.deployer.TomcatManager.deploy(TomcatManager.java:388)
at org.apache.tomcat.maven.plugin.tomcat7.deploy.AbstractDeployWarMojo.deployWar(AbstractDeployWarMojo.java:85)
at org.apache.tomcat.maven.plugin.tomcat7.deploy.AbstractDeployMojo.invokeManager(AbstractDeployMojo.java:82)
at org.apache.tomcat.maven.plugin.tomcat7.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:132)
... 22 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/MojoExecutionException
Also there is no log file in ${CATALINA_HOME}/logs - what I have is empty folder.
Besides there is no ${project.dir}/target/tomcat folder that I observed before.
Also should this option be checked ?

Related

How to debug springboot maven application in intellij

I want to start spring-boot maven application in debug mode in intellij Idea, but when I make breakpoints the application doesn't suspend and goes further. I've read a lot of topics but I still don't understand how to do it. Could you help me decide the best course of action.
Edit: I use spring-boot-maven-plugin and Maven Run/Debug configuration with spring-boot:run in command line.
Edit: So when I added Jvm Arguments to pom.xml I recieved such log:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building shop 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.5.8.RELEASE:run (default-cli) > test-compile # shop >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # shop ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # shop ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # shop ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Валера\IdeaProjects\shop\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # shop ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< spring-boot-maven-plugin:1.5.8.RELEASE:run (default-cli) < test-compile # shop <<<
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.8.RELEASE:run (default-cli) # shop ---
[INFO] Attaching agents: []
Listening for transport dt_socket at address: 5005
But when requesting localhost:5005/myPage I recieve Error 101 (net: : ERR_CONNECTION_RESET). Seems like some maven arguments did not specify.
Here my maven plagin in pom.xml:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>
-Xdebug - Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
</jvmArguments>
</configuration>
</plugin>
</plugins>
</build>
In your Run/Debug Configurations enter the following into your command line:
spring-boot:run -Dspring.profiles.active=local,<mine> -Dfork=false -f pom.xml
My Maven spring-boot:run configuration debugs just fine with the -D fork=false added.
You may use below command in the CLI:
export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n
Below is my project settings:
enter image description here

Maven failing to assemble WAR - Java Heap Space Issue - Stanford Core NLP

So i'm getting this error when trying to Clean Install with Maven. I've attempted increasing MAVEN_OPTS with Xmx-512m or w/e it was called, similarly fiddled with Eclipse ini to increase heap space, but all of this to no avail, I keep getting this error:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building DiaryAppREST 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # DiaryAppREST ---
[INFO] Deleting C:\Users\Administrator\workspace\DiaryAppREST\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # DiaryAppREST ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Administrator\workspace\DiaryAppREST\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # DiaryAppREST ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\Administrator\workspace\DiaryAppREST\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # DiaryAppREST ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Administrator\workspace\DiaryAppREST\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) # DiaryAppREST ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # DiaryAppREST ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:3.0.0:war (default-war) # DiaryAppREST ---
[INFO] Packaging webapp
[INFO] Assembling webapp [DiaryAppREST] in [C:\Users\Administrator\workspace\DiaryAppREST\target\DiaryAppREST-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\Administrator\workspace\DiaryAppREST\WebContent]
[INFO] Webapp assembled in [8913 msecs]
[INFO] Building war: C:\Users\Administrator\workspace\DiaryAppREST\target\DiaryAppREST-0.0.1-SNAPSHOT.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.019 s
[INFO] Finished at: 2017-02-28T09:52:30+00:00
[INFO] Final Memory: 86M/247M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.0.0:war (default-war) on project DiaryAppREST: Error assembling WAR: Problem creating war: Execution exception (and the archive is probably corrupt but I could not delete it): Java heap space -> [Help 1]
[ERROR]
I can't understand what is causing this, tried to find information online but can't seem to find this specific problem that anyone else is having. If anyone would be able to help i'd be very much appreciated.
Just figured it out,
Firstly, I had set MAVEN_OPTS incorrectly, I had them set as:
set MAVEN_OPTS="Xmx 512m"
After changing this to:
set MAVEN_OPTS="-Xmx512m"
You can also add this line into your profile (.profile, .bash_profile, etc) for this to be set in every terminal you open.
export MAVEN_OPTS="-Xmx512m"
And then went into the directory the project was in using CMD,
I ran:
mvn clean install -U
This seemed to do the trick and everything went successfully.
Hope this helps anyone else having problems!
I had the same issue running maven via ant from Jenkins on a Windows box.
The issue was how to pass the memory parameter. Here is the updated ant script showing how to pass the parameter "<jvmarg value="-Xmx1024m" />":
<target name="web.package" depends="init" if="warName">
<artifact:mvn mavenHome="${maven.home}" failonerror="true" fork="true">
<jvmarg value="-Dmaven.multiModuleProjectDirectory=$M2_HOME" />
<jvmarg value="-Xmx1024m" />
<arg value="package" />
<arg value="-Pwar" />
<arg value="-DwarName=${warName}" />
<arg value="-Denv=${env}" />
<arg value="-e" />
</artifact:mvn>
</target>
For info, here is the crash output:
[artifact:mvn] [INFO] Building war: D:\Jenkins\workspace\DEPLOY_SVN\atl_dev_trunk\src\tomcat\target\abc##6_4_6_0.war
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [INFO] BUILD FAILURE
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [INFO] Total time: 01:50 min
[artifact:mvn] [INFO] Finished at: 2017-11-09T02:35:50+01:00
[artifact:mvn] [INFO] Final Memory: 99M/247M
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.0.0:war (default-war) on project abc: Error assembling WAR: Problem creating war: Execution exception (and the archive is probably corrupt but I could not delete it): Java heap space -> [Help 1]

Maven Deploy to Tomcat

I want to deploy Maven based war file to Tomcat.
Technologies used :
Maven 3.1.1
Eclipse 4.2
JDK 7
Spring 4.1.1.RELEASED
Tomcat 7
Logback 1.0.13
I have this plugin in my maven file:
<!-- For Maven Tomcat Plugin -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>TomcatServer</server>
<path>/DevicesCloudWebApp</path>
<username>admin</username>
<password>admin</password>
<update>true</update>
</configuration>
</plugin>
but when I deploy using the command mvn tomcat7:deploy
I have this error:
[DEBUG] Connection 0.0.0.0:62265<->127.0.0.1:8080 closed
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:deploy (default-cli) > package # DevicesCloudWebApp >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # DevicesCloudWebApp ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # DevicesCloudWebApp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # DevicesCloudWebApp ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/nullpointer/Development/J2EE/eclipseWSJ2EE/DevicesCloudWebApp/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # DevicesCloudWebApp ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # DevicesCloudWebApp ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # DevicesCloudWebApp ---
[INFO] Packaging webapp
[INFO] Assembling webapp [DevicesCloudWebApp] in [/Users/nullpointer/Development/J2EE/eclipseWSJ2EE/DevicesCloudWebApp/target/DevicesCloudWebApp]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/nullpointer/Development/J2EE/eclipseWSJ2EE/DevicesCloudWebApp/src/main/webapp]
[INFO] Webapp assembled in [97 msecs]
[INFO] Building war: /Users/nullpointer/Development/J2EE/eclipseWSJ2EE/DevicesCloudWebApp/target/DevicesCloudWebApp.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:deploy (default-cli) < package # DevicesCloudWebApp <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:deploy (default-cli) # DevicesCloudWebApp ---
[INFO] Deploying war to http://localhost:8080/DeviceslCloudWebApp
Uploading: http://localhost:8080/manager/text/deploy?path=%2FDeviceslCloudWebApp
2170/6062 KB
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2FDeviceslCloudWebApp
2198/6062 KB
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2FDeviceslCloudWebApp
2176/6062 KB
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2FDeviceslCloudWebApp
2188/6062 KB
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.922 s
[INFO] Finished at: 2016-12-02T20:57:29+01:00
[INFO] Final Memory: 16M/303M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project DevicesCloudWebApp: Cannot invoke Tomcat manager: Broken pipe -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/MojoExecutionException
Try adding authentication configuration like below
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>${tomcat7-maven-plugin.version}</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>tomcat</server>
<username>admin1</username>
<password>admin1</password>
<path>/${project.artifactId}</path>
<update>true</update>
</configuration>
</plugin>
Update the role configuration like below in the tomcat -> $CATALINA_HOME/conf/tomcat-users.xml in <tomcat-users> element
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<user username="admin" password="admin" roles="manager-gui"/>
<user username="admin1" password="admin1" roles="manager-script"/>

mvn tomcat7:deploy - Cannot invoke Tomcat manager: Broken pipe

I'm getting an error trying to deploy the CLIFF .war to my tomcat7 server.
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:deploy (default-cli) on project cliff: Cannot invoke Tomcat manager: Connection to http://localhost:8080 refused: Connection refused
OS X 10.10.5
Apache Tomcat/8.0.24
JVM 1.8.0_05-b13
David-Laxers-MacBook-Pro:CLIFF davidlaxer$ mvn -version
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T09:37:52-08:00)
Maven home: /Users/davidlaxer/Downloads/apache-maven-3.2.1
Java version: 1.8.0_05, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac"
David-Laxers-MacBook-Pro:CLIFF davidlaxer$
David-Laxers-MacBook-Pro:CLIFF davidlaxer$ sudo mvn tomcat7:deploy -DskipTests
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] CLIFF
[INFO] common
[INFO] stanford-entity-extractor
[INFO] cliff
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building CLIFF 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.1:deploy (default-cli) # CLIFF >>>
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.1:deploy (default-cli) # CLIFF <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.1:deploy (default-cli) # CLIFF ---
[INFO] Skipping non-war project
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building common 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.1:deploy (default-cli) # common >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/davidlaxer/CLIFF/common/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # common ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/davidlaxer/CLIFF/common/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # common ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.16:test (default-test) # common ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # common ---
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.1:deploy (default-cli) # common <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.1:deploy (default-cli) # common ---
[INFO] Skipping non-war project
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building stanford-entity-extractor 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.1:deploy (default-cli) # stanford-entity-extractor >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # stanford-entity-extractor ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 14 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # stanford-entity-extractor ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # stanford-entity-extractor ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 23 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # stanford-entity-extractor ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.16:test (default-test) # stanford-entity-extractor ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # stanford-entity-extractor ---
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.1:deploy (default-cli) # stanford-entity-extractor <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.1:deploy (default-cli) # stanford-entity-extractor ---
[INFO] Skipping non-war project
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cliff 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.1:deploy (default-cli) # cliff >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # cliff ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 12 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # cliff ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # cliff ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/davidlaxer/CLIFF/webapp/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # cliff ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.16:test (default-test) # cliff ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # cliff ---
[INFO] Packaging webapp
[INFO] Assembling webapp [cliff] in [/Users/davidlaxer/CLIFF/webapp/target/cliff-2.3.0]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/davidlaxer/CLIFF/webapp/src/main/webapp]
[INFO] Webapp assembled in [1345 msecs]
[INFO] Building war: /Users/davidlaxer/CLIFF/webapp/target/cliff-2.3.0.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.1:deploy (default-cli) # cliff <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.1:deploy (default-cli) # cliff ---
[INFO] Deploying war to http://localhost:8080/cliff-2.3.0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] CLIFF ............................................. SUCCESS [ 1.728 s]
[INFO] common ............................................ SUCCESS [ 1.883 s]
[INFO] stanford-entity-extractor ......................... SUCCESS [ 0.265 s]
[INFO] cliff ............................................. FAILURE [ 11.384 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.717 s
[INFO] Finished at: 2015-08-26T08:07:32-08:00
[INFO] Final Memory: 12M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:deploy (default-cli) on project cliff: Cannot invoke Tomcat manager: Connection to http://localhost:8080 refused: Connection refused -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/ConnectException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :cliff
pom.xml:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<server>CliffTomcatServer</server>
<path>/${project.build.finalName}</path>
</configuration>
</plugin>
~/.m2/settings.xml:
<server>
<id>CliffTomcatServer</id>
<username>cliff</username>
<password>beer</password>
</server>
/usr/local/apache-tomcat-8.0.24/conftomcat_users.xml:
<tomcat-users>
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="cliff" password="beer" roles="manager,manager-gui,manager-script"/>
Added to pom.xlm: http://localhost:8080/manager/text
[INFO] Deploying war to http://localhost:8080/cliff-2.3.0
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fcliff-2.3.0
2052/127150 KB
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fcliff-2.3.0
2356/127150 KB
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fcliff-2.3.0
2052/127150 KB
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fcliff-2.3.0
2156/127150 KB
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] CLIFF ............................................. SUCCESS [ 1.523 s]
[INFO] common ............................................ SUCCESS [ 1.718 s]
[INFO] stanford-entity-extractor ......................... SUCCESS [ 0.359 s]
[INFO] cliff ............................................. FAILURE [ 12.664 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.735 s
[INFO] Finished at: 2015-08-26T11:04:23-08:00
[INFO] Final Memory: 12M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:deploy (default-cli) on project cliff: Cannot invoke Tomcat manager: Broken pipe -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :cliff
David-Laxers-MacBook-Pro:CLIFF davidlaxer$
When I set in the ~/.m2/settings.xml,it does not work. So I set in the pom.xml,like this:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>${tomcat7-maven-plugin.version}</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>tomcat</server>
<username>admin1</username>
<password>admin1</password>
<path>/${project.artifactId}</path>
<update>true</update>
</configuration>
</plugin>
And in $CATALINA_HOME/conf/tomcat-users.xml file, in <tomcat-users> element, add as follows:
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<user username="admin" password="admin" roles="manager-gui"/>
<user username="admin1" password="admin1" roles="manager-script"/>
Then it works for me. :)
The role for deploying on /manager/text is "manager-script" and the Apache Tomcat Manager How-To indicates it shouldn't be applied to a user with the manager-gui role. I use a deployment user with only the manager-script role and no others, and that uploads the WAR file fine without the broken pipe message. If I add the manager-gui role to my deployment user, I get the broken pipe message you encounter. Try changing your tomcat-users.xml to limit Cliff's role to the single manager-script role. Hope it helps.
http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html
You may need to add this
<configuration>
..
<update>true</update>
..
</configuration>
to your pom.xml file to run
mvn tomcat7:deploy
I got this error when running mvn tomcat7:deploy instead of mvn tomcat7:redeploy.
If you're running CentOS, you may need to install additional management libraries:
yum install tomcat-webapps tomcat-admin-webapps
On other platforms solution may be similar.
I haven't been able to use the mvn redeploy shortcut since I merged in the code that split it into a few mvn modules. I recommend copying the .war file from webapp/target to the tomcat webapps dir on your computer/server.
May be you should check the webapps/manager/WEB-INF/web.xml file to ensure your .war file is smaller than the configured value.
<max-file-size>152428800</max-file-size>
<max-request-size>152428800</max-request-size>
See this question: IBM MobileFirst Platform 6.3 Operational Analytics Failed installation for Tomcat
if you already have the same application deploy on the tomcat server you need to undeploy it first. If you deploy it again it can give your the connection error.

Compile maven netbeans project in terminal

I would like compile a Netbeans Maven - Java Application in my linux terminal.
This is because I would like to work with Git CVS and be able to compile the project in a server being IDE independent.
But I'm having trouble understanding really how dependencies work, or that's what I think.
I'm using a simple java application code to connect to a mysql database and get some information.
I'm using this code:
public static void main(String[] args) throws Exception {
Class.forName("com.mysql.jdbc.Driver");
try (Connection connect = DriverManager.getConnection("jdbc:mysql://192.168.2.21/altadb?" + "user=marco&password=Marco19")) {
Statement statement = connect.createStatement();
ResultSet resultSet = statement.executeQuery("select idCuentaConcentradora, noCliente, nombreCliente, noCuenta, nombreCuenta from altadb.catCuentaConcentradora");
while (resultSet.next()) {
int idCuentaConcentradora = resultSet.getInt("idCuentaConcentradora");
String noCliente = resultSet.getString("noCliente");
String nombreCliente = resultSet.getString("nombreCliente");
String noCuenta = resultSet.getString("noCuenta");
String nombreCuenta = resultSet.getString("nombreCuenta");
System.out.println("idCuentaConcentradora: " + idCuentaConcentradora);
System.out.println("noCliente: " + noCliente);
System.out.println("nombreCliente: " + nombreCliente);
System.out.println("noCuenta: " + noCuenta);
System.out.println("nombreCuenta: " + nombreCuenta);
System.out.println("---------------------------------------------------");
}
} catch (SQLException e) {
System.out.println(e.getMessage());
}
}
Then added the mysql-connector-java to the project dependencies, the pom.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?><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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.alta.MySQLAccess_Mvn</groupId>
<artifactId>MySQLAccess_Mvn</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.31</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
</project>
If I use the netbeans IDE with clean and build and then run the project there is no error and the information is fetched from the database.
If I try to do the same from terminal I get an error:
[marko#mark-laptop MySQLAccess_Mvn]$ mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MySQLAccess_Mvn 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # MySQLAccess_Mvn ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # MySQLAccess_Mvn ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # MySQLAccess_Mvn ---
[INFO] Compiling 1 source file to /home/marko/NetBeansProjects/MySQLAccess_Mvn/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # MySQLAccess_Mvn ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/marko/NetBeansProjects/MySQLAccess_Mvn/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # MySQLAccess_Mvn ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # MySQLAccess_Mvn ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # MySQLAccess_Mvn ---
[INFO] Building jar: /home/marko/NetBeansProjects/MySQLAccess_Mvn/target/MySQLAccess_Mvn-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # MySQLAccess_Mvn ---
[INFO] Installing /home/marko/NetBeansProjects/MySQLAccess_Mvn/target/MySQLAccess_Mvn-1.0-SNAPSHOT.jar to /home/marko/.m2/repository/com/alta/MySQLAccess_Mvn/MySQLAccess_Mvn/1.0-SNAPSHOT/MySQLAccess_Mvn-1.0-SNAPSHOT.jar
[INFO] Installing /home/marko/NetBeansProjects/MySQLAccess_Mvn/pom.xml to /home/marko/.m2/repository/com/alta/MySQLAccess_Mvn/MySQLAccess_Mvn/1.0-SNAPSHOT/MySQLAccess_Mvn-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.866 s
[INFO] Finished at: 2014-06-18T18:46:28-06:00
[INFO] Final Memory: 12M/144M
[INFO] ------------------------------------------------------------------------
[marko#mark-laptop MySQLAccess_Mvn]$ java -cp target/MySQLAccess_Mvn-1.0-SNAPSHOT.jar com.marco.mysql.first.test.test
Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.marco.mysql.first.test.test.main(test.java:23)
Thought since the dependency is being declared in the pom.xml the mysql driver would have been added to the project libraries... but it doesn't.
I would like to achieve the same output from Netbeans from terminal, from build to run.
I don't know how to do it.
If you have maven added to the system path then you can simply compile it using the maven commands on the prompt:
mvm clean install

Categories

Resources