Java app deployment to heroku using Maven failed - java

I am trying to setup the Continuous deployment process for a Tomcat based java app using Github for source code hosting, TravisCI for building the WAR file, running the unit tests and then Heroku to deploy the packaged WAR file.
I tried following the tutorial from
https://devcenter.heroku.com/articles/deploying-war-files-to-heroku-from-travis-ci#creating-a-java-web-application
I am getting an error while running the below step from the above tutorial:
mvn clean heroku:deploy-war
Command outpt:
$ mvn -e clean heroku:deploy-war
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.example:travis-heroku-java-example:war:0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 31, column 10
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Simple Web Application 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.3:clean (default-clean) # travis-heroku-java-example ---
[INFO] Deleting file set: /home/ciuser/travis-heroku-java-example/target (included: [**], excluded: [])
[INFO]
[INFO] >>> heroku-maven-plugin:0.3.6:deploy-war (default-cli) # travis-heroku-java-example >>>
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) # travis-heroku-java-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ciuser/travis-heroku-java-example/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) # travis-heroku-java-example ---
[INFO] Compiling 1 source file to /home/ciuser/travis-heroku-java-example/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) # travis-heroku-java-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ciuser/travis-heroku-java-example/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) # travis-heroku-java-example ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) # travis-heroku-java-example ---
[INFO] No tests to run.
[INFO] Surefire report directory: /home/ciuser/travis-heroku-java-example/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) # travis-heroku-java-example ---
[INFO] Packaging webapp
[INFO] Assembling webapp [travis-heroku-java-example] in [/home/ciuser/travis-heroku-java-example/target/travis-heroku-java-example]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/ciuser/travis-heroku-java-example/src/main/webapp]
[INFO] Webapp assembled in [86 msecs]
[INFO] Building war: /home/ciuser/travis-heroku-java-example/target/travis-heroku-java-example.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] <<< heroku-maven-plugin:0.3.6:deploy-war (default-cli) # travis-heroku-java-example <<<
[INFO]
[INFO] --- heroku-maven-plugin:0.3.6:deploy-war (default-cli) # travis-heroku-java-example ---
[INFO] Configured Artifact: com.github.jsimone:webapp-runner:7.0.57.2:jar
[INFO] Copying webapp-runner-7.0.57.2.jar to /home/ciuser/travis-heroku-java-example/target/dependency/webapp-runner.jar
[INFO] ---> Packaging application...
[INFO] - app: possessed-cemetery-7933
[INFO] - including: target/dependency/webapp-runner.jar
[INFO] - including: target/travis-heroku-java-example.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.636s
[INFO] Finished at: Fri Apr 24 03:33:35 UTC 2015
[INFO] Final Memory: 19M/46M
[INFO] ------------------------------------------------------------------------
[**ERROR] Failed to execute goal com.heroku.sdk:heroku-maven-plugin:0.3.6:deploy-war (default-cli) on project travis-heroku-java-example: Failed to deploy application: Forbidden -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.heroku.sdk:heroku-maven-plugin:0.3.6:deploy-war (default-cli) on project travis-heroku-java-example: Failed to deploy application**
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:606)
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: Failed to deploy application
at com.heroku.sdk.maven.DeployWarMojo.execute(DeployWarMojo.java:24)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.http.client.HttpResponseException: Forbidden
at com.heroku.sdk.deploy.RestClient.handleResponse(RestClient.java:87)
at com.heroku.sdk.deploy.RestClient.get(RestClient.java:26)
at com.heroku.sdk.deploy.ConfigVars.getConfigVars(ConfigVars.java:39)
at com.heroku.sdk.deploy.ConfigVars.merge(ConfigVars.java:22)
at com.heroku.sdk.deploy.App.mergeConfigVars(App.java:152)
at com.heroku.sdk.deploy.App.deploy(App.java:81)
at com.heroku.sdk.deploy.App.deploy(App.java:87)
at com.heroku.sdk.deploy.WarApp.deploy(WarApp.java:29)
at com.heroku.sdk.maven.DeployWarMojo.execute(DeployWarMojo.java:20)
... 21 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
$
Error Message in the above output:
[**ERROR] Failed to execute goal com.heroku.sdk:heroku-maven-plugin:0.3.6:deploy-war (default-cli) on project travis-heroku-java-example: Failed to deploy application: Forbidden -> [Help 1]
Here is the Maven System configuration:
$ mvn -version
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-79-generic", arch: "amd64", family: "unix"
Java Version is:
$ java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
$
Pom file:
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>travis-heroku-java-example</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>Simple Web Application</name>
<dependencies>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.4_spec</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
<pluginRepositories>
<pluginRepository>
<id>rubygems-releases</id>
<url>http://rubygems-proxy.torquebox.org/releases</url>
</pluginRepository>
</pluginRepositories>
<build>
<finalName>travis-heroku-java-example</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
<version>0.3.6</version>
<configuration>
<appName>possessed-cemetery-7933</appName>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
<version>0.3.6</version>
<configuration>
<appName>boiling-beach-1111</appName>
</configuration>
</plugin>
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId>
<version>1.0.5</version>
<configuration>
<execArgLines>
<execArgLine>${project.build.directory}/rubygems/bin/travis</execArgLine>
<execArgLine>encrypt</execArgLine>
<execArgLine>HEROKU_API_KEY=${herokuApiKey}</execArgLine>
</execArgLines>
</configuration>
<dependencies>
<dependency>
<groupId>rubygems</groupId>
<artifactId>travis</artifactId>
<version>1.7.1</version>
<type>gem</type>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>pry</artifactId>
<version>0.9.12.6</version>
<type>gem</type>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

I found what the issue was!!!
Heroku deploy-war maven plugin requires Maven 3.2.X version while I was using 3.0.X version.
Installed Maven 3.2.1 version on my ubuntu machine and the war file was successfully deployed to Heroku.
I got to know this from Github Heroku Maven plugin repository Readme file:
Requirements
Maven 3.2.x
Java 1.7 or higher
Thank you #Steve for your time.
Output:
$ maven -version
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T17:37:52+00:00)
Maven home: /usr/share/maven3
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-79-generic", arch: "amd64", family: "unix"
$
$
$
$ maven -e clean heroku:deploy-war
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.example:travis-heroku-java-example:war:0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 31, column 11
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Simple Web Application 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # travis-heroku-java-example ---
[INFO] Deleting /home/ciuser/travis-heroku-java-example/target
[INFO]
[INFO] >>> heroku-maven-plugin:0.3.6:deploy-war (default-cli) # travis-heroku-java-example >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # travis-heroku-java-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ciuser/travis-heroku-java-example/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # travis-heroku-java-example ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /home/ciuser/travis-heroku-java-example/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # travis-heroku-java-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ciuser/travis-heroku-java-example/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # travis-heroku-java-example ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # travis-heroku-java-example ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # travis-heroku-java-example ---
[INFO] Packaging webapp
[INFO] Assembling webapp [travis-heroku-java-example] in [/home/ciuser/travis-heroku-java-example/target/travis-heroku-java-example]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/ciuser/travis-heroku-java-example/src/main/webapp]
[INFO] Webapp assembled in [38 msecs]
[INFO] Building war: /home/ciuser/travis-heroku-java-example/target/travis-heroku-java-example.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] <<< heroku-maven-plugin:0.3.6:deploy-war (default-cli) # travis-heroku-java-example <<<
[INFO]
[INFO] --- heroku-maven-plugin:0.3.6:deploy-war (default-cli) # travis-heroku-java-example ---
[INFO] Configured Artifact: com.github.jsimone:webapp-runner:7.0.57.2:jar
[INFO] Copying webapp-runner-7.0.57.2.jar to /home/ciuser/travis-heroku-java-example/target/dependency/webapp-runner.jar
[INFO] ---> Packaging application...
[INFO] - app: boiling-beach-1111
[INFO] - including: target/dependency/webapp-runner.jar
[INFO] - including: target/travis-heroku-java-example.war
[INFO] - installing: OpenJDK 1.8
[INFO] ---> Creating slug...
[INFO] - file: target/heroku/slug.tgz
[INFO] - size: 56MB
[INFO] ---> Uploading slug...
[INFO] - stack: cedar-14
[INFO] - process types: [web]
[INFO] ---> Releasing...
[INFO] - version: 6
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32.265 s
[INFO] Finished at: 2015-04-24T20:05:46+00:00
[INFO] Final Memory: 19M/48M
[INFO] ------------------------------------------------------------------------

Related

mvn spring-boot:run errors with No plugin found for prefix 'spring-boot' in the current project and in the plugin groups

I have a Java application which should be run with mvn spring-boot:run -Dspring.profiles.active=dev -Djasypt.encryptor.password=<DJASYPT_ENCRYPTOR_PASSWORD>.
If I just run that command I get this:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ie.avis.digital.account:accapiapp:jar:1.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.httpcomponents:httpclient:jar -> version (?) vs 4.5.3 # ie.avis.digital.account:accapiapp:[unknown-version], C:\DevTools\git\api.account\accapiapp\pom.xml, line 156, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] accapi
[INFO] accapiapp
Downloading: https://binaries.avisgroup.com:443/artifactory/public-maven/org/eclipse/m2e/lifecycle-mapping/1.0.0/lifecycle-mapping-1.0.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
Downloading: https://binaries.avisgroup.com:443/artifactory/public-maven/org/codehaus/mojo/maven-metadata.xml
Downloading: https://binaries.avisagroup.com:443/artifactory/public-maven/org/apache/maven/plugins/maven-metadata.xml
Downloaded: https://binaries.avisgroup.com:443/artifactory/public-maven/org/apache/maven/plugins/maven-metadata.xml (10 kB at 1.2 kB/s)
Downloaded: https://binaries.avisgroup.com:443/artifactory/public-maven/org/codehaus/mojo/maven-metadata.xml (20 kB at 299 B/s)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] accapi ......................................... SKIPPED
[INFO] accapiapp ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:12 min
[INFO] Finished at: 2022-01-11T19:10:33Z
[INFO] Final Memory: 13M/209M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'spring-boot' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\A183540\.m2\repository), avis-nexus (https://binaries.avisagroup.com:443/artifactory/public-maven/)] -> [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/NoPluginFoundForPrefixException
I don't think I should need to add this to the accapi pom:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.12.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
and this to plugins
If I do and run the mvn command I get this:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
I get this:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ie.avis.digital.account:accapiapp:jar:1.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.httpcomponents:httpclient:jar -> version (?) vs 4.5.3 # ie.avis.digital.account:accapiapp:[unknown-version], C:\DevTools\git\api.account\accapiapp\pom.xml, line 156, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] accapi
[INFO] accapiapp
Downloading: https://binaries.avisgroup.com:443/artifactory/public-maven/org/eclipse/m2e/lifecycle-mapping/1.0.0/lifecycle-mapping-1.0.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building accapi 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) > test-compile # accapi >>>
[INFO]
[INFO] <<< spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) < test-compile # accapi <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) # accapi ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building accapiapp 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) > test-compile # accapiapp >>>
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create (2) # accapiapp ---
[INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD"
[INFO] Working directory: C:\DevTools\git\api.account\accapiapp
[INFO] Storing buildNumber: b9bd8c84473a4d0f5ab3f0e0f9a24a92620850d8 at timestamp: 1641928952817
[INFO] Storing buildScmBranch: develop
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create-metadata (1) # accapiapp ---
[INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD"
[INFO] Working directory: C:\DevTools\git\api.account\accapiapp
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # accapiapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 20 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) # accapiapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # accapiapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 15 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) # accapiapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) < test-compile # accapiapp <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) # accapiapp ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] accapi ......................................... SUCCESS [ 0.997 s]
[INFO] accapiapp ...................................... SUCCESS [ 4.948 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.137 s
[INFO] Finished at: 2022-01-11T19:22:35Z
[INFO] Final Memory: 33M/258M
[INFO] ------------------------------------------------------------------------
Even if I was correct to do this I'd expect the application to remain running. Is there anything obvious that I'm doing wrong?
I had to cd accapiapp then run my mvn command.

Custom maven archetype doesn't generate sources defined in archtype.xml

I'm trying to create a custom archetype which defines a substantial pom.xml and includes a couple of source files.
None of the sources I define in my archetype.xml are included when generate a project using this archetype (the pom.xml is generated as expected).
My archetype.xml is located in src/main/resources/META-INF/maven and defines two sources.
<archetype xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0 http://maven.apache.org/xsd/archetype-1.0.0.xsd">
<id>custom-archetype</id>
<sources>
<source>src/main/java/App.java</source>
</sources>
<resources>
<resource>src/test/java/BatFile.bat</resource>
</resources>
</archetype>
App.java is located in src/main/resources/archetype-resources/src/main/java.
BatFile.bat is located in src/main/resources/archetype-resources/src/main/resources.
I also have an archetype-metadata.xml located in src/main/resources/META-INF/maven which I use to define dependency version
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor name="custom">
<requiredProperties>
<requiredProperty key="thorntail-version">
<defaultValue>2.2.1.Final</defaultValue>
</requiredProperty>
</requiredProperties>
</archetype-descriptor>
My root pom.xml is as follows
<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>uk.co.xxxxx</groupId>
<artifactId>custom-archetype</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Custom Archetype</name>
<description>Archetype for Custom projects</description>
</project>
I'm following the maven Documentation on creating custom archetypes and as far as I can see I'm doing everything correctly.
This is the result of running mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreade
d.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Custom Archetype 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # custom-archetype ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 6 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # custom-archetype ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # custom-archetype ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) custom-archetype ---
[INFO] No sources to compile
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # custom-archetype
---
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # custom-archetype ---
[INFO] --- maven-install-plugin:2.4:install (default-install) # custom-archetype
---
[INFO] Installing D:\dev\customarchetype\target\custom-archetype-0.0.1-SNAPSHOT.jar to C:\Users\xxxx\.m2\repository\uk\co\xxxxx\custom-archetype\0
.0.1-SNAPSHOT\custom-archetype-0.0.1-SNAPSHOT.jar
[INFO] Installing D:\dev\custom\customarchetype\pom.xml to C:\Users\xxxx\.m2\rep
ository\uk\co\xxxxx\custom-archetype\0.0.2-SNAPSHOT\custom-archetype-0.0.
1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.849 s
[INFO] Finished at: 2019-01-11T09:29:18+00:00
[INFO] Final Memory: 8M/245M
[INFO] ------------------------------------------------------------------------
I'm running the following maven command to generate my project
mvn archetype:generate -DarchetypeGroupId=uk.co.gamma.xxxxx -DarchetypeArtifactId=custom-archetype -DarchetypeVersion=0.0.1-SNAPSHOT -DgroupId=uk.co.xxxxx -Dversion=0.0.1-SNAPSHOT -DartifactId=test12 -Dpackage=uk.co.xxxxx
and this is the output
[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 Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) # standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) # standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) # standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository not defined. Using the one from [uk.co.xxxxx:custom-archetype:0.0.1-SNAPSHOT] found in catalog local
[INFO] Using property: groupId = uk.co.xxxxx
[INFO] Using property: artifactId = test12
[INFO] Using property: version = 0.0.1-SNAPSHOT
[INFO] Using property: package = uk.co.xxxxx
[INFO] Using property: thorntail-version = 2.2.1.Final
Confirm properties configuration:
groupId: uk.co.xxxxx
artifactId: test12
version: 0.0.1-SNAPSHOT
package: uk.co.xxxxx
thorntail-version: 2.2.1.Final
Y: :
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: custom-archetype:0.0.1-SNAPSHOT
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: uk.co.xxxxx
[INFO] Parameter: artifactId, Value: test12
[INFO] Parameter: version, Value: 0.0.1-SNAPSHOT
[INFO] Parameter: package, Value: uk.co.xxxxx
[INFO] Parameter: packageInPathFormat, Value: uk/co/xxxxx
[INFO] Parameter: package, Value: uk.co.xxxxx
[INFO] Parameter: version, Value: 0.0.1-SNAPSHOT
[INFO] Parameter: thorntail-version, Value: 2.2.1.Final
[INFO] Parameter: groupId, Value: uk.co.xxxxx
[INFO] Parameter: artifactId, Value: test12
[INFO] Project created from Archetype in dir: D:\dev\testarchetype\test12
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.281 s
[INFO] Finished at: 2019-01-11T10:27:45+00:00
[INFO] Final Memory: 13M/183M
[INFO] ------------------------------------------------------------------------
The generated project only contains pom.xml.
What do I need to do to include these files when generating a project from this archetype?
archetype-metadata.xml is an archetype 2.x descriptor whereas archetype.xml is an archetype 1.x descriptor. Using both means anything in archetype.xml is ignored. Including file generation in archetype-metadata.xml and deleting archetype.xml fixes the problem.

Getting blank surefire reports with "[WARNING] Unable to locate Test Source XRef to link to - DISABLED"

My pom.xml has following content
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<outputDirectory>${basedir}/target/surefire-reports</outputDirectory>
</configuration>
</plugin>
when I run mvn surefire-report::report I am getting following
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------------------------------------------------------
[INFO] Building TestApp 0.0.1-SNAPSHOT
[INFO] -----------------------------------------------------------------------
[INFO]
[INFO] >>> maven-surefire-report-plugin:2.18.1:report (default-cli) > [surefir
test # TestApp >>>
[WARNING] The POM for org.testng:testng:jar:5.14.3 is invalid, transitive depe
encies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.testng:testng:jar:5.14.4 is invalid, transitive depe
encies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.testng:testng:jar:5.14.5 is invalid, transitive depe
encies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # TestApp
-
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources
i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # TestApp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) #
stApp ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\nikhil.udgirkar\workspace\
stApp\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # TestA
---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # TestApp ---
[INFO]
[INFO] <<< maven-surefire-report-plugin:2.18.1:report (default-cli) < [surefir
test # TestApp <<<
[INFO]
[INFO] --- maven-surefire-report-plugin:2.18.1:report (default-cli) # TestApp
-
[WARNING] Unable to locate Test Source XRef to link to - DISABLED
[INFO] -----------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] -----------------------------------------------------------------------
[INFO] Total time: 3.316 s
[INFO] Finished at: 2016-09-26T12:37:33+05:30
[INFO] Final Memory: 17M/215M
[INFO] ---------------------------------------------------------------------
When I issued following command I am getting blank report
mvn surefire-report:report
I can get the .class files in it's respective folder
Thanks for your time

mvn tomcat7:deploy takes too long to deploy?

I am using tomcat7-maven-plugin to deploy my spring batch admin application,
below is my configuration in pom,
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<!-- Tomcat 7 has a different manager path - text - than other versions -->
<url>http://localhost:8081/manager/text</url>
<username>myusername</username>
<password>mypassword</password>
<path>/${project.build.finalName}</path>
<update>true</update>
</configuration>
</plugin>
I am running,
mvn clean install tomcat7:deploy
Though it completes successfully, it takes too long to complete this command nearly (4-5 min).
Below is the output of command. It takes lot of time to receive response after uploading war file. You can observer below output, it took 4.16 min.
It worked pretty fast till it displays the message "uploaded .." but after that it keeps waiting for response for 4-5 min.
I need to deploy application on multiple servers (5 servers) so it will take 25 min which is too long for only deployment.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.st:batch:war:1.0.0-BUILD-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework.batch:spring-batch-core:jar -> version ${spring.batch.version} vs (?) # line 125, column 15
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework.batch:spring-batch-infrastructure:jar -> version ${spring.batch.version} vs (?) # line 129, column 15
[WARNING] 'build.plugins.plugin.version' for org.mortbay.jetty:maven-jetty-plugin is missing. # line 182, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. # line 189, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # org.springframework.batch:spring-batch-admin-parent:1.3.0.RC1, /home/ubuntu/.m2/repository/org/springframework/batch/spring-batch-admin-parent/1.3.0.RC1/spring-batch-admin-parent-1.3.0.RC1.pom, line 245, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. # org.springframework.batch:spring-batch-admin-parent:1.3.0.RC1, /home/ubuntu/.m2/repository/org/springframework/batch/spring-batch-admin-parent/1.3.0.RC1/spring-batch-admin-parent-1.3.0.RC1.pom, line 253, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building st 1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # batch ---
[INFO] Deleting /home/ubuntu/java/spring/batch/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # batch ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 105 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # batch ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 53 source files to /home/ubuntu/java/spring/batch/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # batch ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ubuntu/java/spring/batch/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # batch ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # batch ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # batch ---
[INFO] Packaging webapp
[INFO] Assembling webapp [batch] in [/home/ubuntu/java/spring/batch/target/batch-1.0.0-BUILD-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/ubuntu/java/spring/batch/src/main/webapp]
[INFO] Webapp assembled in [130 msecs]
[INFO] Building war: /home/ubuntu/java/spring/batch/target/batch-1.0.0-BUILD-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # batch ---
[INFO] Installing /home/ubuntu/java/spring/batch/target/batch-1.0.0-BUILD-SNAPSHOT.war to /home/ubuntu/.m2/repository/com/st/batch/1.0.0-BUILD-SNAPSHOT/batch-1.0.0-BUILD-SNAPSHOT.war
[INFO] Installing /home/ubuntu/java/spring/batch/pom.xml to /home/ubuntu/.m2/repository/com/st/batch/1.0.0-BUILD-SNAPSHOT/batch-1.0.0-BUILD-SNAPSHOT.pom
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.1:deploy (default-cli) # batch >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # batch ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 105 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # batch ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # batch ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ubuntu/java/spring/batch/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # batch ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # batch ---
[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.2:war (default-war) # batch ---
[INFO] Packaging webapp
[INFO] Assembling webapp [batch] in [/home/ubuntu/java/spring/batch/target/batch-1.0.0-BUILD-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/ubuntu/java/spring/batch/src/main/webapp]
[INFO] Webapp assembled in [73 msecs]
[INFO] Building war: /home/ubuntu/java/spring/batch/target/batch-1.0.0-BUILD-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.1:deploy (default-cli) # batch <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.1:deploy (default-cli) # batch ---
[INFO] Deploying war to http://localhost:8081/batch-1.0.0-BUILD-SNAPSHOT
Uploading: http://localhost:8081/manager/text/deploy?path=%2Fbatch-1.0.0-BUILD-SNAPSHOT&update=true
Uploaded: http://localhost:8081/manager/text/deploy?path=%2Fbatch-1.0.0-BUILD-SNAPSHOT&update=true (16362 KB at 116869.5 KB/sec)
[INFO] tomcatManager status code:200, ReasonPhrase:OK
[INFO] OK - Deployed application at context path /batch-1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:16 min
[INFO] Finished at: 2014-07-23T11:49:33+00:00
[INFO] Final Memory: 23M/303M
[INFO] -------------------------
You could use the following commands to deploy your app. It will help with the length of time it takes to redelpoy, but it will not stop the length of time it takes for the Uploading: & Uploaded: parts since its waiting for Tomcat.
mvn -T 1C install tomcat7:redeploy-only -DskipTests -offline
-T 1C: This means that we will use 1 thread per core on the deploying machine

Maven won't deploy to tomcat; gives '405' error

I'm trying to deploy a simple JSF app onto a Tomcat 8 server on my local machine. When I run mvn tomcat:deploy, I get the following feedback:
C:\_workspace\portfolio>mvn tomcat:deploy
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.italic:portfolio:war:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:tomcat-maven-plugin is missing. # line 38, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Portfolio 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat-maven-plugin:1.1:deploy (default-cli) # portfolio >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # portfolio ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # portfolio ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # portfolio ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # portfolio ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # portfolio ---
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # portfolio ---
[INFO] Packaging webapp
[INFO] Assembling webapp [portfolio] in [C:\_workspace\portfolio\target\portfolio-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\_workspace\portfolio\src\main\webapp]
[INFO] Webapp assembled in [184 msecs]
[INFO] Building war: C:\_workspace\portfolio\target\portfolio-0.0.1-SNAPSHOT.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO]
[INFO] <<< tomcat-maven-plugin:1.1:deploy (default-cli) # portfolio <<<
[INFO]
[INFO] --- tomcat-maven-plugin:1.1:deploy (default-cli) # portfolio ---
[INFO] Deploying war to http://localhost:8080/portfolio
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.499s
[INFO] Finished at: Sat Feb 08 19:10:27 PST 2014
[INFO] Final Memory: 21M/180M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project portfolio: Cannot invoke Tomcat manager: Server returne
d HTTP response code: 405 for URL: http://localhost:8080/manager/text/deploy?path=%2Fportfolio&war= -> [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
C:\_workspace\portfolio>
Apparently Maven is finding the server, but is unable to deploy onto it. I looked around the interwebs and found that this could be due to maven trying to use a "PUT" command. However, after looking at the following answer, I added this code to my tomcat web.xml in the default servlet:
<init-param>
<param-name>readonly</param-name>
<param-value>false</param-value>
</init-param>
However, it doesn't appear to have had any effect. Do you have any further advice on what I can do to get this working?
I'm using Maven 3.1.1 and Tomcat 8.0.1.
It turns out that this was a silly mistake- the user that I had maven using had "manager-gui" privileges instead of "manager-script." Resolving this issue fixed my problem.

Categories