Liferay theme + maven - java

I want create liferay theme, so I created a Maven project from archetype. My 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>com.liferay.sample</groupId>
<artifactId>sample-theme</artifactId>
<packaging>war</packaging>
<name>sample-theme Theme</name>
<version>0.0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>com.liferay.maven.plugins</groupId>
<artifactId>liferay-maven-plugin</artifactId>
<version>6.1.20</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>theme-merge</goal>
<goal>build-css</goal>
<goal>build-thumbnail</goal>
</goals>
</execution>
</executions>
<configuration>
<autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir>
<appServerDeployDir>${liferay.app.server.deploy.dir}</appServerDeployDir>
<appServerLibGlobalDir>${liferay.app.server.lib.global.dir}</appServerLibGlobalDir>
<appServerPortalDir>${liferay.app.server.portal.dir}</appServerPortalDir>
<liferayVersion>${liferay.version}</liferayVersion>
<parentTheme>${liferay.theme.parent}</parentTheme>
<pluginType>theme</pluginType>
<themeType>${liferay.theme.type}</themeType>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<version>6.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-bridges</artifactId>
<version>6.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-taglib</artifactId>
<version>6.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-java</artifactId>
<version>6.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<properties>
<liferay.theme.parent>_styled</liferay.theme.parent>
<liferay.theme.type>vm</liferay.theme.type>
</properties>
</project>And I use maven:package and I see an error:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sample-theme Theme 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.400s
[INFO] Finished at: Tue Oct 16 14:47:58 CEST 2012
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find goal 'build-css' in plugin com.liferay.maven.plugins:liferay-maven-plugin:6.1.0 among available goals build-lang, build-wsdd, build-ext, build-service, direct-deploy, theme-merge, build-thumbnail, deploy -> [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/MojoNotFoundException
What is wrong? I am try change version liferay-maven-plugin but it not resolve my problem.

Use version 6.1.1 as there is no build-css goal in liferay-maven-plugin.jar of 6.1.0 version
Take a look at liferay-maven-plugin.jar/META-INF/maven/plugin.xml for available goals.

You dont have a goal named as 'build-css'
Are you using groovy for your configuration file?
What you have pasted here is only a build file, for Maven's use.
Where are you other goals located, for example, look for "build-thumbnail" and "theme-merge"? Must be in a configuration file that this Maven build file is reading.
Where ever these other goals are, you need to create your goal there, or in a similar file. Then build again.

Remove the entry build-css and build-thumbnail and deploy it again, or you can check the pom.xml file as an reference given in below link.
http://www.liferay.com/community/forums/-/message_boards/message/5220131

As others have written - 6.1.0 doesn't support 'build-css' goal, so you should delete or comment out following line in Your pom.xml:
<goal>build-css</goal>

Related

Problem while executing mvn liquibase:diff where snapshot us used as target url

Using liquibase with maven spring boot project have generated the snapshot at one state of db later tried generating the difference between the snapshot and online db using mvn liquibase:diff.
liquibase.properties as follows.
changeLogFile=src/main/resources/bd.changeLog-base.xml
diffChangeLogFile=src/main/resources/bd.changeLog-base.xml
outputChangeLogFile=src/main/resources/liquibase-new-changeLog.xml
url=offline:mysql?snapshot=src/main/resources/snap_shot.json
driver=com.mysql.jdbc.Driver
referenceDriver=com.mysql.jdbc.Driver
referenceUrl=jdbc:mysql://localhost:3306/db_sample
referenceUsername=yyyy
referencePassword=xxxx
using the following maven-plugin dependency in 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<!--<version>2.4.2</version>-->
<version>2.2.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>Liquibaseapplicationexample</groupId>
<artifactId>Liquibaseapplicationexample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
</dependency>
</dependencies>
<build>
<finalName>liquibase-demo</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.5.5</version>
<configuration>
<propertyFile>src/main/resources/liquibase/config/liquibase.properties</propertyFile>
<promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
</configuration>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.2.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.2.2.RELEASE</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>development</id>
<properties>
<build.profile.id>development</build.profile.id>
</properties>
</profile>
</profiles>
</project>
I am getting following error.
[INFO] Scanning for projects...
[INFO]
[INFO] ------< Liquibaseapplicationexample:Liquibaseapplicationexample >-------
[INFO] Building Liquibaseapplicationexample 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- liquibase-maven-plugin:3.6.1:diff (default-cli) # Liquibaseapplicationexample ---
[INFO] ------------------------------------------------------------------------
[INFO] Parsing Liquibase Properties File
[INFO] File: src/main/resources/liquibase/config/liquibase.properties
[INFO] 'outputChangeLogFile' in properties file is not being used by this task.
[INFO] ------------------------------------------------------------------------
[INFO] Starting Liquibase at Mon, 05 Apr 2021 01:21:53 IST (version 3.5.5 built at 2018-04-11 09:05:04)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.778 s
[INFO] Finished at: 2021-04-05T01:21:53+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.5.5:diff (default-cli) on project Liquibaseapplicationexample: Error setting up or running Li
quibase: liquibase.exception.UnexpectedLiquibaseException: Cannot parse snapshot offline:mysql?snapshot=src/main/resources/snap_shot.json: src/main/resources/snap_shot.j
son does not exist -> [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.
Please help in solving this issue!
For me this issue fixed by upgrading liquibase-maven-plugin from 3.5.5 version to 3.10.1.
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.10.1</version>

Vaadin Widgetset Compilation Error After Vaadin8 Migration

I just migrated my Vaadin project from 7.7.6 to 8.0.5. First I wanted to use the Vaadin8 migration tool but my IDE used too many vaadin.* imports so I just did it manually. After hours of work (compatibility package imports) the maven build worked again and I wanted to open the WebApp in my browser but I got the "Failed to load the Widgetset..." error message. I thought that I have to recompile the Widgetset but the vaadin-maven-plugin throws an error:
EDIT 04.05.2017: I removed the QueryDSL dependency "querydsl-apt" and the widgetset is compiling... Does anyone know why this happens?
c:\dev\workspace_intellij\wsi>mvn vaadin:compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wsi 2.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.querydsl:querydsl-core:jar:3.7.4 is missing, no dependency information available
[INFO]
[INFO] --- vaadin-maven-plugin:8.0.5:compile (default-cli) # wsi ---
[INFO] auto discovered modules [WsiWidgetset]
[INFO] Using com.vaadin:vaadin-client-compiler version 8.0.5
[INFO] Compiling module WsiWidgetset
[INFO] [ERROR] An internal compiler exception occurred
[INFO] com.google.gwt.dev.jjs.InternalCompilerException: Error constructing Java AST
[INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.translateException(GwtAstBuilder.java:3944)
[INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.getInternalCompilerException(GwtAstBuilder.java:4351)
[INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.createMembers(GwtAstBuilder.java:4043)
[INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.processImpl(GwtAstBuilder.java:3883)
[INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.process(GwtAstBuilder.java:3918)
[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater$UnitProcessorImpl.process(CompilationStateBuilder.java:129)
[INFO] at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.process(JdtCompiler.java:384)
[INFO] at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:470)
[INFO] at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:1092)
[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:325)
[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:548)
[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:479)
[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:465)
[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:423)
[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:222)
[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:202)
[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:143)
[INFO] at com.google.gwt.dev.Compiler.compile(Compiler.java:204)
[INFO] at com.google.gwt.dev.Compiler.compile(Compiler.java:155)
[INFO] at com.google.gwt.dev.Compiler.compile(Compiler.java:144)
[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:118)
[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:125)
[INFO] Caused by: java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.lookup.MethodBinding.isDefaultMethod()Z
[INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.createMethod(GwtAstBuilder.java:4138)
[INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.createMembers(GwtAstBuilder.java:4033)
[INFO] ... 21 more
[INFO] [ERROR] at SVGPathSegLinetoVerticalAbs.java(30): public interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg
[INFO] org.eclipse.jdt.internal.compiler.ast.TypeDeclaration
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.929 s
[INFO] Finished at: 2017-05-02T15:04:34+02:00
[INFO] Final Memory: 35M/434M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:8.0.5:compile (default-cli) on project wsi: Command [[
[ERROR] C:\Program Files\Java\jdk1.8.0_102\jre\bin\java -Xmx1G -Dgwt.persistentunitcache=false com.google.gwt.dev.Compiler -logLevel INFO -style OBF -war c:\dev\workspace_intellij\wsi\target\classes\VAADIN\widgetsets -localWorkers 4 -failOnError -XfragmentCount -1 -sourceLevel auto -gen c:\dev\workspace_intellij\wsi\target\.generated WsiWidgetset
[ERROR] ]] failed with status 1
[ERROR] -> [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
My 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>
[...]
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
<relativePath />
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<vaadin.version>8.0.5</vaadin.version>
<vaadin.plugin.version>8.0.5</vaadin.plugin.version>
<vaadin.charts.version>4.0.0</vaadin.charts.version>
<vaadin.spring.version>2.0.1</vaadin.spring.version>
<vaadin.context.menu.version>2.0.0</vaadin.context.menu.version>
<vaadin.fontawesome.version>1.3.4</vaadin.fontawesome.version>
<vaadin.componentrenderer.version>2.0.0</vaadin.componentrenderer.version>
[...]
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-ldap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring-boot-starter</artifactId>
<version>${vaadin.spring.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>fontawesomelabel</artifactId>
<version>${vaadin.fontawesome.version}</version>
</dependency>
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-server-jndi</artifactId>
<version>1.5.5</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>4.0.1</version><!--$NO-MVN-MAN-VER$-->
</dependency>
<dependency>
<groupId>org.imgscalr</groupId>
<artifactId>imgscalr-lib</artifactId>
<version>4.2</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-core</artifactId>
<version>4.1.4</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>4.1.4</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>4.1.4</version>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>mediaelementjs-player</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>org.vaadin.patrik</groupId>
<artifactId>GridFastNavigation</artifactId>
<version>0.2.1</version>
</dependency>
<!-- Eigenes Kompilat, da Sourcen nicht attached waren -->
<dependency>
<groupId>org.vaadin.addons.lazyquerycontainer</groupId>
<artifactId>vaadin-lazyquerycontainer</artifactId>
<version>7.6.1.3</version>
</dependency>
<!-- WIDGETSET -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-charts</artifactId>
<version>${vaadin.charts.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-context-menu</artifactId>
<version>${vaadin.context.menu.version}</version>
</dependency>
<dependency>
<groupId>de.datenhahn.vaadin</groupId>
<artifactId>componentrenderer</artifactId>
<version>${vaadin.componentrenderer.version}</version>
</dependency>
<!-- WIDGETSET END -->
[...]
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-compatibility-server</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-compatibility-client</artifactId>
</dependency>
</dependencies>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<!-- Clean up also any pre-compiled themes -->
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/VAADIN/themes</directory>
<includes>
<include>**/styles.css</include>
<include>**/styles.scss.cache</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<!-- Exclude some unnecessary files generated by the GWT compiler. -->
<packagingExcludes>WEB-INF/classes/VAADIN/gwt-unitCache/**, WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<configuration>
<extraJvmArgs>-Xmx1G</extraJvmArgs>
</configuration>
<executions>
<execution>
<goals>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
<!-- Comment out compile-theme goal to use on-the-fly theme compilation -->
<goal>compile-theme</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources</outputDirectory>
<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
[...]
</project>
My Widgetset.gwt.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module>
<!--
Uncomment the following to compile the widgetset for one browser only.
Multiple browsers can be specified as a comma separated list. The supported user agents at the moment of writing were:
ie8,ie9,gecko1_8,safari,opera
The value gecko1_8 is used for Firefox and safari is used for webkit based browsers including Google Chrome.
-->
<!-- <set-property name="user.agent" value="safari"/> -->
<!--
To enable SuperDevMode, uncomment this line.
See https://vaadin.com/wiki/-/wiki/Main/Using%20SuperDevMode for more information and instructions.
-->
<!-- <set-configuration-property name="devModeRedirectEnabled" value="true" /> -->
<!--<inherits name="com.vaadin.DefaultWidgetSet"/>-->
<inherits name="com.vaadin.v7.Vaadin7WidgetSet" />
<inherits name="com.vaadin.addon.charts.Widgetset"/>
<inherits name="de.datenhahn.vaadin.componentrenderer.ComponentRendererWidgetSet"/>
<inherits name="com.vaadin.contextmenu.WidgetSet" />
<inherits name="org.vaadin.patrik.GridFastNavigation" />
</module>
Does anyone know whats going wrong?
Best regards
Generally NoSuchMethodError indicates a classpath problem, in the sense that the library that you have in your cp when writing the code (and your IDE is compiling inline your code to check it for errors) is a different version from the one in the maven compile-time cp. So a method that is available when writing the code is no longer found when compiling or running the code (see late binding).
In your particular case, this is most likely an indirect consequence due to the QueryDSL dependency that uses a JDT version, and the Vaadin maven plugin using a GWT plugin that references another JDT version.
As a workaround, you can explicitly exclude the JDT transitive dependency from either your QueryDSL version or the Vaadin maven plugin, and try to see if that works.
P.S. To see who exactly is referencing the JDT dependency you can run mvn dependency:tree
That worked> Thanks a lot. I added :
<exclusion>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<artifactId>ecj</artifactId>
</exclusion>
in my pom dependency.

Issue with automated test not being found in classpath file

To start, let me just say that I have done quite a bit of research on my own in trying to resolve this issue. I have looked over a bunch of answers here on SO and have tried many of them but, sadly, to no avail.
My current stack is Eclipse (Mars) with Maven and Selenium. When attempting to run my automated tests, I get the following:
[INFO] Scanning for projects... [INFO] [INFO]
------------------------------------------------------------------------ [INFO] Building automation 0.0.1-SNAPSHOT [INFO]
------------------------------------------------------------------------ [WARNING] The POM for org.testng:testng:jar:5.14.3 is invalid,
transitive dependencies (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 dependencies (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 dependencies (if any) will not be available, enable debug
logging for more details [INFO] [INFO] ---
maven-clean-plugin:2.5:clean (default-clean) # automation --- [INFO]
Deleting C:\Users\bmoore\workspace\automation\target [INFO] [INFO]
--- maven-resources-plugin:2.6:resources (default-resources) # automation --- [INFO] Using 'UTF-8' encoding to copy filtered
resources. [INFO] Copying 7 resources [INFO] [INFO] ---
maven-compiler-plugin:3.3:compile (default-compile) # automation ---
[INFO] Changes detected - recompiling the module! [INFO] Compiling 253
source files to C:\Users\bmoore\workspace\automation\target\classes
[INFO] [INFO] --- maven-resources-plugin:2.6:testResources
(default-testResources) # automation --- [INFO] Using 'UTF-8' encoding
to copy filtered resources. [INFO] Copying 3 resources [INFO] [INFO]
--- maven-compiler-plugin:3.3:testCompile (default-testCompile) # automation --- [INFO] Changes detected - recompiling the module!
[INFO] Compiling 17 source files to
C:\Users\bmoore\workspace\automation\target\test-classes [INFO]
[INFO] --- maven-surefire-plugin:2.19:test (default-test) # automation
------------------------------------------------------- T E S T S
------------------------------------------------------- Running TestSuite
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 9.679 s [INFO] Finished at:
2016-02-02T10:26:53-07:00 [INFO] Final Memory: 23M/277M [INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:2.19:test
(default-test) on project automation: Execution default-test of goal
org.apache.maven.plugins:maven-surefire-plugin:2.19:test failed: There
was an error in the forked process [ERROR] org.testng.TestNGException:
[ERROR] [ERROR] Cannot find class in classpath:
com..qa.automation.roles.SuperAdminCreateCouponTest [ERROR]
at org.testng.xml.XmlClass.loadClass(XmlClass.java:81) [ERROR] at
org.testng.xml.XmlClass.init(XmlClass.java:73) [ERROR] at
org.testng.xml.XmlClass.(XmlClass.java:59) [ERROR] at
org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:546)
[ERROR] at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
[ERROR] at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
[ERROR] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1344)
[ERROR] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2787)
[ERROR] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
[ERROR] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
[ERROR] at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
[ERROR] at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
[ERROR] at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
[ERROR] at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
[ERROR] at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
[ERROR] at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
[ERROR] at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
[ERROR] at org.testng.xml.XMLParser.parse(XMLParser.java:38) [ERROR]
at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:16) [ERROR]
at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:9) [ERROR]
at org.testng.xml.Parser.parse(Parser.java:172) [ERROR] at
org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:300) [ERROR]
at org.testng.TestNG.run(TestNG.java:1021) [ERROR] at
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:282)
[ERROR] at
org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:83)
[ERROR] at
org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:114)
[ERROR] at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:286)
[ERROR] at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:240)
[ERROR] at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
[ERROR] -> [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/PluginExecutionException
That is the full trace of what happened. The issue (as I see it) is with the following lines:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project automation: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test failed: There was an error in the forked process
[ERROR] org.testng.TestNGException:
[ERROR]
[ERROR] Cannot find class in classpath: com..qa.automation.roles.SuperAdminCreateCouponTest
I have tried verifying the classpath entries, and that the surefire plugin is present. In both cases, they are where they should be. I have tried committing files one-at-a-time and that works. It's only when I build that I have an issue, and it is blocking me from running the automation completely.
I am guessing that the issue is likely an easy one to resolve but, the Java/Eclipse stack is not second nature to me like .NET/C# is.
NOTE: I will update the question with new information should it become available.
UPDATE: I have included the POM below:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>com.kryterion.qa</groupId>
<artifactId>automation</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>automation</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<skipTests>false</skipTests>
</properties>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.9</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.48.2</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.48.2</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>2.48.2</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.48.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.37</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.10-FINAL</version>
</dependency>
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.4</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.11.1.1</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.8</version>
</dependency>
</dependencies>
<build>
<finalName>automation</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<skipTests>${skipTests}</skipTests>
<systemPropertyVariables>
<environment>${envName}</environment>
</systemPropertyVariables>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.16</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changelog-plugin</artifactId>
<version>2.2</version>
<configuration>
<issueLinkUrl>http://prodjira01:8080/browse/%ISSUE%</issueLinkUrl>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<show>private</show>
<additionalparam>${javadoc.doclint.none}</additionalparam>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.4</version>
<configuration>
<linkXRef>true</linkXRef>
<source>1.8</source>
<targetJdk>1.8</targetJdk>
<rulesets>
<ruleset>/rulesets/java/basic.xml</ruleset>
<ruleset>/rulesets/java/braces.xml</ruleset>
<ruleset>/rulesets/java/design.xml</ruleset>
</rulesets>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
<version>2.4</version>
<configuration>
<tagListOptions>
<tagClasses>
<tagClass>
<displayName>Todo</displayName>
<tags>
<tag>
<matchString>todo</matchString>
<matchType>ignoreCase</matchType>
</tag>
<tag>
<matchString>FIXME</matchString>
<matchType>ignoreCase</matchType>
</tag>
<tag>
<matchString>NB</matchString>
<matchType>exact</matchType>
</tag>
</tags>
</tagClass>
<tagClass>
<displayName>Deprecated</displayName>
<tags>
<tag>
<matchString>#deprecated</matchString>
<matchType>ignoreCase</matchType>
</tag>
</tags>
</tagClass>
</tagClasses>
</tagListOptions>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<xmlOutput>true</xmlOutput>
<!-- Optional directory to put findbugs xdoc xml report -->
<xmlOutputDirectory>target/site</xmlOutputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>config/sun_checks.xml</configLocation>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
#sircapsalot - I made the change you suggested below and what happened is that all of the:
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
Suddenly started throwing warnings in all the classes that had those imports. Thoughts?
According to Maven Central, the version you are requesting isn't there. (you are requesting org.testng:testng:jar:5.14.3)
Try updating to the newest version: 6.9.10 in your pom.xml
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.10</version>
</dependency>
So, I figured out the issue... It turns out, it was a problem with PEBKAC.
I renamed a file that I had changed yesterday back to its original state and all is well now. Thanks for those that chimed in to help with this!

Error buildling with maven for openshift

This is my POM.xml 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>myapp</groupId>
<artifactId>myapp</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>myapp</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.executable>${env.OPENSHIFT_WILDFLY_DIR}usr/lib/jvm/jdk1.8.0_05/bin/javac</maven.compiler.executable>
<maven.compiler.fork>true</maven.compiler.fork>
<spring.version>4.1.3.RELEASE</spring.version>
<jstl.version>1.2</jstl.version>
</properties>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
</dependency>
</dependencies>
<profiles>
<profile>
<!-- When built in OpenShift the 'openshift' profile will be used when invoking mvn. -->
<!-- Use this profile for any OpenShift specific customization your app will need. -->
<!-- By default that is to put the resulting archive into the 'deployments' folder. -->
<!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
<id>openshift</id>
<build>
<finalName>myapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<outputDirectory>deployments</outputDirectory>
<warName>ROOT</warName>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
When I am building using mvn package I am getting
------------------------------------------------------------------------
Building myapp 1.0
------------------------------------------------------------------------
--- maven-resources-plugin:2.5:resources (default-resources) # myapp ---
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
Copying 1 resource
--- maven-compiler-plugin:2.3.2:compile (default-compile) # myapp ---
Compiling 1 source file to D:\git\myapp\target\classes
-------------------------------------------------------------
COMPILATION ERROR :
-------------------------------------------------------------
Failure executing javac, but could not parse the error:
The system cannot find the path specified.
1 error
-------------------------------------------------------------
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 0.711s
Finished at: Wed Dec 31 13:15:42 IST 2014
Final Memory: 6M/15M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project myapp: Compilation failure
Failure executing javac, but could not parse the error:
The system cannot find the path specified.
-> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
what could be the issue?
I encountered the same problem with our group project. Particularly this line is breaking your build:
<maven.compiler.executable>${env.OPENSHIFT_WILDFLY_DIR}usr/lib/jvm/jdk1.8.0_05/bin/javac</maven.compiler.executable>
its specifying the path to javac to compile java files. However, this line above point to a fixed path (which isn't same on all computers). Remove it, and your local build will pass. However, I'm suspecting if you remove that line it might break something on openshift side, though.

Maven tomcat7 exec-war-only Error

I want to create an executable war/jar like explained in the tomcat7-maven-plugin documentation: http://tomcat.apache.org/maven-plugin-2.2/executable-war-jar.html
But i get a build failure (NullPointerException):
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Gothic Mod Manager 0.1.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:exec-war (default-cli) # gmm >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # gmm ---
[INFO] Using 'ISO-8859-1' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # gmm ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # gmm ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # gmm ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # gmm ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # gmm ---
[INFO] Packaging webapp
[INFO] Assembling webapp [gmm] in [C:\***\GMM\target\gmm-0.1.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\***\GMM\src\main\webapp]
[INFO] Webapp assembled in [963 msecs]
[INFO] Building war: C:\***\GMM\target\gmm-0.1.1-SNAPSHOT.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:exec-war-only (executable) # gmm ---
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:exec-war (default-cli) # gmm <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:exec-war (default-cli) # gmm ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.854s
[INFO] Finished at: Mon Jun 09 18:55:09 CEST 2014
[INFO] Final Memory: 30M/223M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:exec-war (default-cli) on project gmm: Execution default-cli of goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:exec-war failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:exec-war (default-cli) on project gmm: Execution default-cli of goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:exec-war failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
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:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
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: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)
at org.codehaus.classworlds.Launcher.main(Launcher.java:46)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:exec-war failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:115)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: java.lang.NullPointerException
at java.io.FileInputStream.<init>(FileInputStream.java:134)
at org.apache.tomcat.maven.plugin.tomcat7.run.AbstractExecWarMojo.execute(AbstractExecWarMojo.java:301)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
... 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/PluginExecutionException
The goals tomcat7:deploy, :redeploy, :undeploy and the startup of a local embedded server with tomcat7:run work as expected.
Unlike the documentation i linked above i only have a single .pom file, so i merged the parts from the docu together. My pom now looks like this:
<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>de.gothic-reloaded-mod</groupId>
<artifactId>gmm</artifactId>
<packaging>war</packaging>
<version>0.1.1-SNAPSHOT</version>
<name>Gothic Mod Manager</name>
<url>https://github.com/Katharsas/GMM</url>
<properties>
<org.springframework.version>4.0.4.RELEASE</org.springframework.version>
<org.springframework.security.version>3.2.0.RELEASE</org.springframework.security.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.imgscalr</groupId>
<artifactId>imgscalr-lib</artifactId>
<version>4.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.7</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-juli</artifactId>
<version>7.0.52</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${org.springframework.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${org.springframework.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${org.springframework.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${org.springframework.security.version}</version>
</dependency>
<!-- Apache Commons Upload -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<!-- Apache Commons Upload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<path>/GMM</path>
<encoding>UTF-8</encoding>
<username>admin</username>
<password>**********</password>
</configuration>
<executions>
<execution>
<id>executable</id>
<goals>
<goal>exec-war-only</goal>
<goal>exec-war</goal>
</goals>
<phase>package</phase>
<configuration>
<enableNaming>true</enableNaming>
<warRunDependencies>
<warRunDependency>
<dependency>
<groupId>de.gothic-reloaded-mod</groupId>
<artifactId>gmm</artifactId>
<version>0.1.1-SNAPSHOT</version>
<type>war</type>
</dependency>
<contextPath>/</contextPath>
</warRunDependency>
</warRunDependencies>
<extraDependencies>
<extraDependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.1.3.1</version>
</extraDependency>
<extraDependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</extraDependency>
</extraDependencies>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>ISO-8859-1</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
Additional info: Im using Eclipse Kepler, my Run Configuration looks like this:
tomcat7:exec-war -e
I also tried with the commando line, tried :exec-war-only but nothing worked.
I searched and tried different things for days now, so any help is much appreciated! : ]
The NPE is because the plugin does not find the packaged war file, I fixed that error by explicitly adding the package phase to the build, so for example:
mvn clean package tomcat7:exec-war
any phase that produce the war package fits well for avoiding the NPE: package, install, deploy, etc.
So, in your case, where you use a Run Configuration in Eclipse, just add package before tomcat7:exec-war -e
I have a similar issue with version 2.2 of the plugin, but I got it run with 2.1 according to this tutorial.
There is a version 2.3 now where the problem from 2.2 has been fixed!
(had some problems with 2.1 because it is so old)
Sadly its only a snapshot version and needs to be fetched from Apache Snapshots Repository. To get it you need to put this into your pom:
<pluginRepositories>
<pluginRepository>
<id>apache.snapshots</id>
<name>Apache Snapshots</name>
<url>http://repository.apache.org/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Then you can use the new version <version>2.3-SNAPSHOT</version>
I received this error with spring boot application. I had to spend quite sometime so putting it here that below plugin needs to be included
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
Also packaging type should be jar
<packaging>jar</packaging>
Start-class should be defined as your main class
<start-class>com.edu.schoolT.SchoolWeb</start-class>
main class or class annotated with #SpringBootApplication should extend SpringBootServletInitializer. For further info...
Create a deployable war file
I have fixed similar issue in my project and given reference below link
tomcat7-maven-plugin custom server.xml
Find pom.xml changes for this issue

Categories