Skip to content

Solution to compilation error/build failure due to outdated maven-compiler-plugin version in pom.xml files #1

@ksegaba

Description

@ksegaba

Hello, I cloned the github repository and encountered a compilation error when running the mvn package command (using Maven 3.9.8). I have included the error below:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] The ALTER Project [pom]
[INFO] ALTER Core Library and Desktop app [jar]
[INFO] ALTER Web app [war]
[INFO]
[INFO] -------------------< es.uvigo.ei.sing:alter-project >-------------------
[INFO] Building The ALTER Project 1.3.4 [1/3]
[INFO] from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] >>> source:3.0.1:jar (attach-sources) > generate-sources @ alter-project >>>
[INFO]
[INFO] <<< source:3.0.1:jar (attach-sources) < generate-sources @ alter-project <<<
[INFO]
[INFO]
[INFO] --- source:3.0.1:jar (attach-sources) @ alter-project ---
[INFO]
[INFO] ---------------------< es.uvigo.ei.sing:alter-lib >---------------------
[INFO] Building ALTER Core Library and Desktop app 1.3.4 [2/3]
[INFO] from alter-lib/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- javacc:2.6:javacc (javacc) @ alter-lib ---
[INFO] Skipping - all parsers are up to date
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ alter-lib ---
[INFO] Copying 1 resource from src/main/resources to target/classes
[INFO] The encoding used to copy filtered properties files have not been set. This means that the same encoding will be used to copy filtered properties files as when copying other filtered resources. This might not be what you want! Run your build with --debug to see which files might be affected. Read more at https://maven.apache.org/plugins/maven-resources-plugin/examples/filtering-properties-files.html
[INFO]
[INFO] --- compiler:3.1:compile (default-compile) @ alter-lib ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 130 source files to /home/seguraab/external_software/ALTER/alter-lib/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Source option 7 is no longer supported. Use 8 or later.
[ERROR] Target option 7 is no longer supported. Use 8 or later.
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for The ALTER Project 1.3.4:
[INFO]
[INFO] The ALTER Project .................................. SUCCESS [ 0.152 s]
[INFO] ALTER Core Library and Desktop app ................. FAILURE [ 0.290 s]
[INFO] ALTER Web app ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.482 s
[INFO] Finished at: 2024-08-14T15:03:58-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project alter-lib: Compilation failure: Compilation failure:
[ERROR] Source option 7 is no longer supported. Use 8 or later.
[ERROR] Target option 7 is no longer supported. Use 8 or later.
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :alter-lib

I was able to resolve the error by editing the pom.xml files within the alter-lib/ and alter-web/ directories.

Within alter-lib/pom.xml, I changed the configurations to the following:

			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version> <!-- was 3.1 -->
				<configuration>
					<source>8</source> <!-- was 1.7-->
					<target>8</target> <!-- was 1.7-->
				</configuration>
			</plugin>

Within alter-web/pom.xml, I did the same:

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version> <!-- was 2.3.2 -->
				<configuration>
					<source>8</source> <!-- was 1.7 -->
					<target>8</target> <!-- was 1.7 -->
				</configuration>
			</plugin>

I wanted to raise the issue since other users may have a similar problem. Thank you very much for creating this tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions