I get this error when I run mvn clean package in my IntelliJ terminal:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project protection: Fatal error compiling: invalid target release: 1.8 -> [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
Is this telling me that it is trying to compile with Java 1.8 or that it expects Java 1.8 but the available version is not correct?
You are using 1.8.And the default value for the compiler is 1.6 so you need to change the plugin properties to:
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
Related
I'm getting an error with maven. It added one dependency with the tool in VS Code and turned off checkstyle in . I tried to restart vs code because it might be a bug but clearly it isn't.
Error message with debugging:
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM c:\Users\wikim\Desktop\Java\argbot\pom.xml: Duplicated tag: 'configuration' (position: START_TAG seen ...</dependencies>\r\n <configuration>... #80:24) # line 80, column 24
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project (c:\Users\wikim\Desktop\Java\argbot\pom.xml) has 1 error
[ERROR] Non-parseable POM c:\Users\wikim\Desktop\Java\argbot\pom.xml: Duplicated tag: 'configuration' (position: START_TAG seen ...</dependencies>\r\n <configuration>... #80:24) # line 80, column 24 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
Here's pom.xml file
If you look at the error it shows line 80 has an issue. For the plugin maven-checkstyle-plugin you have two configuration tags in the XML. I would change it to a single one:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven-checkstyle-plugin.version}</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<configLocation>com/github/ngeor/checkstyle.xml</configLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<skip>${skipTests}</skip>
</configuration>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
</dependency>
<dependency>
<groupId>com.github.ngeor</groupId>
<artifactId>checkstyle-rules</artifactId>
<version>${checkstyle-rules.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>checkstyle</id>
<phase>none</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
I'm trying to add a LICENSE.txt to my maven project via a plugin.
I've tried using org.codehaus.mojo license-maven-plugin 1.14, with the following pom entries...
<organizationName>My Organization</organizationName>
<inceptionYear>2018</inceptionYear>
<licenses>
<license>
<name>GNU-JEFF General Public License (GPL)</name>
<url>http://www.gnu.org/licenses/gpl.txt</url>
</license>
</licenses>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>1.14</version>
<configuration>
<verbose>false</verbose>
<addSvnKeyWords>true</addSvnKeyWords>
</configuration>
<executions>
<execution>
<id>first</id>
<goals>
<goal>update-file-header</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<licenseName>gpl_v3</licenseName>
<organizationName>My Organization</organizationName>
<inceptionYear>2017</inceptionYear>
<roots>
<root>src/main/java</root>
<root>src/test</root>
</roots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
But with the following command...
mvn license:update-project-license
I get this error...
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.pcmsgroup.v21.pos.tools:confluence-updater:2.0.1-SNAPSHOT (C:\x\pom.xml) has 1 error
[ERROR] Malformed POM C:\x\pom.xml: Unrecognised tag: 'organizationName' (position: START_TAG seen ...</packaging>\r\n\t\r\n<organizationName>... #9:19) # C:\tools\workspace\POS-ConfluenceUpdater\pom.xml, line 9, column 19 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
The error has nothing to do with the plugin. As far as I can tell from the Maven XSD, your organizationName tag is indeed invalid, as the error says. Try replacing it with organization. That one does exist.
<organization>
<name>My Organization</name>
<url>http://example.com</url>
</organization>
I had been created a jar from my Java project using Eclipse IDE.
Then I have added that jar into my spring boot maven project's build path.
When I am trying to maven clean and install after adding my custom jar, I can't able to run maven install successfully.
I am getting below error,
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project springBootExample: Compilation failure: Compilation failure:
[ERROR] error reading C:\Users\VAIBHAV-PC\.m2\repository\org\hsqldb\hsqldb\2.3.3\hsqldb-2.3.3.jar; invalid LOC header (bad signature)
[ERROR] /D:springBootExample/src/main/java/com/springBootExample/service/impl/UserServiceImpl.java:[9,29] package com.ResponceGenerator does not exist
[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/MojoFailureException.
Can you upload the pom.xml of the SpringBoot Project ? Below is the example. Also make sure the custom jar is in your local maven repository.
Project A pom.xml ( Add the below plugin)
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.4.1.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>exec</classifier>
</configuration>
</execution>
</executions>
</plugin>
Project B pom.xml (Add your local repo information and include Project A under dependency section)
<repositories>
<repository>
<id>local-repo</id>
<url>file:${user.home}\.m2\repository</url>
</repository>
</repositories>
Project A Information
I get my Apache Storm from http://mirror.symnds.com/software/Apache/storm/apache-storm-0.9.3/apache-storm-0.9.3.tar.gz
I never modified any thing in the /home/user/storm/examples/storm-starter/ directory.
When I run this command
mvn exec:java -D storm.topology=storm.starter.WordCountTopology
in the /home/user/storm/examples/storm-starter/, it gives the error as below:
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project storm-starter: An exception occured while executing the Java class. java.lang.InterruptedException -> [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
MojoExecutionException - Apache Maven - Apache Software Foundation
cwiki.apache.org
Anyone know what is the problem & how to solve it?
I wish can provide me a detail solution as I am a newbie. Thank you.
Try this
Go to the path where your pom.xml file exists and run this command
mvn -e -f pom.xml compile exec:java -D storm.topology=storm.starter.WordCountTopology
Try adding this to your pom.xml and run the above command.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>java</executable>
<includeProjectDependencies>true</includeProjectDependencies>
<includePluginDependencies>true</includePluginDependencies>
<classpathScope>compile</classpathScope>
<mainClass>${storm.topology}</mainClass>
</configuration>
</plugin>
I have installed the m2e plugin for Eclipse and used it to create a simple archetype. I wrote a small test driver and am trying to build the project (via Maven) and compile my Java sources into class files.
I go toRun >> Run Configurations and create a New Maven Build. I name it and set its base directory to be my project root.
When I try to select Goals it doesn't see any and so I can't add/specify any. I click the Run button. Here is my console output:
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.me:myproject:0.0.1-SNAPSHOT (C:\Users\me\workbench\eclipse\workspace\MyProject\pom.xml) has 3 errors
[ERROR] 'build.plugins.plugin.artifactId' is missing. # line 145, column 17
[ERROR] 'build.plugins.plugin.groupId' is missing. # line 144, column 14
[ERROR] 'build.plugins.plugin.version' for : must be a valid version but is ''. # line 146, column 14
[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/ProjectBuildingException
The <build> tag in my pom.xml is:
<build>
<plugins>
<plugin>
<groupId></groupId>
<artifactId></artifactId>
<version></version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compiler:compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
A few things:
What should my artifactId, groupId and version be if this is the (standard) Maven compile phase?
Is this the correct way to launch a Maven build (through Run Configurations)? In Ant there is a plugin that lets you see all of the targets defined in your build.xml; I see no such analog in Maven/m2e.
Why does something as simple as compile require plugins? One would think this would be a standard part of any build tool.
You don't need to put anything as you are using all the defaults settings of the maven compiler. If you really want to specify it you can do it this way:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</plugin>