I get an error while pushing my app from eclipse to heroku.
it says
javac: invalid target release 1.7
how to rectify it
this is my pom.xml plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
Related
I have two project, which run on two different platform Android and Ios. which i am controlling by different suite runner file . when i am trying to run same via Maven , whichever plugin mention last , only that profile run , how can i make working of all.
<plugins>
<!-- build standalone exe jar -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<skip>false</skip>
<mainClass>platform.atcios.SuiteRunner</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<skip>false</skip>
<mainClass>platform.atc.SuiteRunner</mainClass>
</configuration>
</plugin>
</plugins>
</build>
in this , if atc is mention in last , when run for ios , atcios giving build fail error and viceversa.
how to make both work
You need to define different <executions> inside the same <plugin> tag.
Each <execution> may have its own <configuration>.
How to make mvn test goal fail if ANY warning is detected?
I have tried without success:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<failOnWarning>true</failOnWarning>
</configuration>
</plugin>
I am running maven application "DemoApp" that generates checkstyle static code analysis reports. It works correctly when I run it on eclipse, but when I build it on jenkins it gives the below error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site plugin:3.3:site (default-site) on project DemoApp: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.3:site failed: A required class was missing while executing org.apache.maven.plugins:maven-site-plugin:3
and The following exception :
java.lang.NoClassDefFoundError: org/apache/maven/doxia/siterenderer/DocumentContent
Caused by: java.lang.ClassNotFoundException: org.apache.maven.doxia.siterenderer.DocumentContent
I added the following plugins in pom.xml
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<configuration>
<configLocation>src/main/resources/google_checks.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>false</failsOnError>
<linkXRef>false</linkXRef>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<reportSets>
<reportSet>
<reports>
<report>checkstyle</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
I can't tell whether this solves your current issue but generally: Declarations within <pluginManagement> do not actually set anything in the build process but are intended as a centralized place for declarations common to (sub-)projects:
[...] this only configures plugins that are actually referenced within the plugins element in the children or in the current POM.
See the different versions in the error message: maven-site-plugin:3.3 and in the declaration: <version>3.7.1.
To add such a plugin declaration to the build process you have to declare/reference it additionaly in:
<build>
...
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
</plugin>
</plugins>
...
</build>
The same applies to the maven-checkstyle-plugin:
If you want to report to the console or fail the build, you must add an execution of checkstyle::check to the <build> element and configure any options that you need.
Hello everyone I'm new with open shift and GIT and I try to depoly my spring mvc project on open shift and I get errors I can't manage to resolve them to deploy the application.
Plugin org.apache.maven.plugins:maven-war-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-war-plugin:jar:2.5.1: Failure to find org.apache.maven.plugins:maven-war-plugin:pom:2.5.1 in http://maven.repository.redhat.com/techpreview/all was cached in the local repository, resolution will not be reattempted until the update interval of eap has elapsed or updates are forced -> [Help 1]
[ERROR]
read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
An error occurred executing 'gear postreceive' (exit code: 1)
Error message: CLIENT_ERROR: Failed to execute: 'control build' for /var/lib/openshift/5674c0e22d5271dc8d000016/jbossews
POM.XML
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.5</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>openshift</id>
<build>
<finalName>GestionBP</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<outputEncoding>UTF-8</outputEncoding>
<outputDirectory>webapps</outputDirectory>
<warName>ROOT</warName>
</configuration>
</plugin>
</plugins>
</build>
Can someone help me. Thank you aa lot
Have you tried removing the forced version number?
I have created a maven project which has got Testng scripts. I have created multiple maven profile in my POM.xml file. I have added the below plugin to create a jar file for my project. But how can I run this jar file passing maven profile as the option (I don't have any main class for my project)
<build>
<plugins>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.1</version>
</plugin>
</plugins>
</build>
Regards,
Kiran