I have a Spring Core project in Java 1.8 that I imported into IntelliJ (previously I was using Eclipse) and for which I created various Maven configurations to execute builds, releases, etc.
Everything went well until I changed PCs, moving from Windows 10 to Windows 11. I reinstalled IntelliJ, configured the project, but when I try to run the mvn clean install
command either from the configuration or from Run Anything
, I receive this error during compilation:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project ReportERHomeService: Compilation failure
javac: file not found: D:RERSanitàselfbacksrccomiconsultingreporterstatsRange.java
The class obviously exists, and to be thorough, I tried downloading a standalone version of Maven and running the command through the Windows console, and everything was executed without errors.
I thought it might be a problem with the integrated version of IntelliJ, so I tried using the downloaded one, but I get the same error as above, so I’m inclined to think that the problem is, somehow, IntelliJ.
I’ve tried cleaning the cache, uninstalling and reinstalling the application and re-importing the projects, but the problem persists.
I’ve also tried renaming the package path of the class, and the error changes, but it still can’t find some other file.
Has anyone ever found themselves in a similar situation and provide any analysis or suggestions regarding this issue?
I’m using IntelliJ IDEA 2024.1.4 (Community Edition)
with the following integrated Maven version:
The standalone maven version:
Apache Maven 3.9.8 (36645f6c9b5079805ea5009217e36f2cffd34256)
Maven home: D:ApplicazioniMavenapache-maven-3.9.8
Java version: 1.8.0_422, vendor: Amazon.com Inc., runtime: C:Usersfxella.jdkscorretto-1.8.0_422jre
Default locale: it_IT, platform encoding: Cp1252
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
And the pom.xml (I’ve excluded dependencies and profiles for brevity, as they exceeded the character limit for the post):
<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>com.example</groupId>
<artifactId>Example</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<mavenVersion>3.3</mavenVersion>
<springVersion>4.3.30.RELEASE</springVersion>
<poi.version>3.17</poi.version>
</properties>
<build>
<sourceDirectory>src</sourceDirectory>
<finalName>${release.file}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${mavenVersion}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<fork>true</fork>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>${webContent}</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<descriptors>
<descriptor>src/assembly/bin.xml</descriptor>
</descriptors>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<tstamp>
<format property="thisday" pattern="yyyyMMdd"
locale="it,IT" unit="day" />
</tstamp>
<copy file="${project.build.directory}/${release.file}.war"
todir="${release.dir}/" />
<checksum
file="${project.build.directory}/${release.file}.war"
property="md5" />
<checksum file="${release.dir}/${release.file}.war"
property="${md5}" verifyProperty="isMD5ok" />
<fail message="Wrong md5 checksum in release folder.">
<condition>
<not>
<istrue value="${isMD5ok}" />
</not>
</condition>
</fail>
<mkdir dir="${backup.dir}/${thisday}" />
<copy file="${project.build.directory}/${release.file}.war"
todir="${backup.dir}/${thisday}" />
<checksum
file="${backup.dir}/${thisday}/${release.file}.war"
property="${md5}" verifyProperty="isMD5ok" />
<fail message="Wrong md5 checksum in release folder.">
<condition>
<not>
<istrue value="${isMD5ok}" />
</not>
</condition>
</fail>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
...
</profiles>
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2/</url>
</repository>
<repository>
<id>jcenter</id>
<url>https://jcenter.bintray.com/</url>
</repository>
</repositories>
<dependencies>
...
</dependencies>
</project>
As a side note, my coworkers have the same project, but with different IntelliJ version, and they have no problem with it.