0

I started working on migrating one of my projects into Java9 and I ran into this issue while running, the project works alright with Java8 not sure where this error is coming from !!!

mvn clean install 

Failed to execute goal org.codehaus.gmaven:groovy-maven-plugin:2.0:execute (generate-deploy-files) on project {project-name}: Execution generate-deploy-files of goal org.codehaus.gmaven:groovy-maven-plugin:2.0:execute failed: No such property: canonicalFile for class: java.io.File

Based on my conversation with nullpointer, I ran the mvn dependency:tree

and I saw the following dependency

[INFO] |  +- org.thymeleaf:thymeleaf-spring4:jar:2.1.6.RELEASE:compile
[INFO] |  \- nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:jar:1.4.0:compile
[INFO] |     \- org.codehaus.groovy:groovy:jar:2.4.13:compile

What is interesting about this error is that I don't have this plugin in the project pom 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>
<artifactId>saif-content-syndication-service</artifactId>
<packaging>jar</packaging>
<name>Service Module</name>

<parent>
    <groupId>com.saif</groupId>
    <artifactId>{project-name}</artifactId>
    <version>0.0.23-SNAPSHOT</version>
</parent>

<properties>
    <content-syndication.version>0.0.4</content-syndication.version>
    <spine.version>3.2.6</spine.version>
    <tomcat.version>8.5.5</tomcat.version>
</properties>

<dependencies>
    <!-- Main Dependencies -->
    <dependency>
        <groupId>com.github.ben-manes.caffeine</groupId>
        <artifactId>caffeine</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-aop</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
    <dependency>
        <groupId>org.thymeleaf.extras</groupId>
        <artifactId>thymeleaf-extras-java8time</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-mongodb</artifactId>
    </dependency>
    <!-- Test Dependencies -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jaxb</groupId>
        <artifactId>jaxb-runtime</artifactId>
        <version>2.3.0</version>
    </dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.7.0</version>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
                <compilerArgs>
                    <arg>--add-modules=java.xml.bind</arg>
                    <arg>--add-opens java.base/java.lang=ALL-UNNAMED </arg>
                    <arg>--illegal-access=deny</arg>
                </compilerArgs>
                <!-- without forking compilation happens in the
                    same process, so no arguments are applied -->
                <fork>true</fork>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.10</version>
            <executions>
                <execution>
                    <id>reserve-server-ports</id>
                    <goals>
                        <goal>reserve-network-port</goal>
                    </goals>
                    <phase>pre-integration-test</phase>
                    <configuration>
                        <portNames>
                            <portName>server.port</portName>
                            <portName>management.port</portName>
                        </portNames>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Arar
  • 1,926
  • 5
  • 29
  • 47
  • your current pom seems to have a parent and few other dependencies..did you analyze your pom effectively? – Naman May 10 '18 at 03:49
  • @nullpointer Can you elaborate on your question? what do you mean by "analyze your pom effectively" I have nothing that is pulling groovy in the parent pom file – Arar May 10 '18 at 14:04
  • `mvn dependency:tree` is something that could help you understand the source of dependencies. – Naman May 10 '18 at 16:26
  • That is what I got when I ran the command : org.thymeleaf:thymeleaf-spring4:jar:2.1.6.RELEASE:compile [INFO] | \- nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:jar:1.4.0:compile [INFO] | \- org.codehaus.groovy:groovy:jar:2.4.13:compile – Arar May 10 '18 at 17:49
  • okay...and if you don't need it..exclude it fro the dependency it's coming in from. – Naman May 10 '18 at 18:19

1 Answers1

0

I was able to git rid of this issue by disabling the plugin that was causing it :

           <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>groovy-maven-plugin</artifactId>
                <version>2.0</version>
                <executions>
                    <execution>
                        <id>generate-deploy-files</id>
                        <phase/>
                    </execution>
                </executions>
            </plugin>
Arar
  • 1,926
  • 5
  • 29
  • 47