Skip to content

Error when compile with 3.4.2 #782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
He-Pin opened this issue May 22, 2024 · 27 comments
Closed

Error when compile with 3.4.2 #782

He-Pin opened this issue May 22, 2024 · 27 comments

Comments

@He-Pin
Copy link

He-Pin commented May 22, 2024

[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:4.9.1:compile (default) on project ultra-mtop-jsonpath: Execution default of goal 
net.alchim31.maven:scala-maven-plugin:4.9.1:compile failed: A required class was missing while executing net.alchim31.maven:scala-maven-plugin:4.9.1:compile: dotty/tools/dotc/Driver
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>net.alchim31.maven:scala-maven-plugin:4.9.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy

Works for 2.13.14, but error when Scala 3.3/3.4
Maven:3.9.2
Java : Java 21

@slandelle
Copy link
Collaborator

Honestly, a contribution would be much appreciated.
I don't use Scala 3 myself.

@He-Pin
Copy link
Author

He-Pin commented May 22, 2024

Yeah, reporting here, but need some digging, I will try this when get time.

@Kordyjan
Copy link

I'll discuss that with the Scala 3 compiler team. Maybe we can help.

@SethTisue
Copy link

SethTisue commented May 29, 2024

For starters, we should at least understand what changed between Scala 3.2 and 3.3 that caused this, in order to assess the likely difficulty of fixing it. Can anyone think of a 3.3 change that's a plausible culprit?

@jozic
Copy link
Contributor

jozic commented May 30, 2024

Interesting, I don't use Scala 3 myself as well, but I maintain scoverage-maven-plugin and we do have tests using Scala 3.4.2 and this plugin and the tests were green the last time I checked. The code there is primitive of course, but may be something worth checking.

@He-Pin
Copy link
Author

He-Pin commented May 30, 2024

image
The only Scala file in my projects and it compiles well with 2.13.14 but fails on 3.3.3 and 3.4.2.

The Scala file is mixed, it references Java files written with Java 21 and Java files refer to this Scala Object too.
@jozic thanks for sharing.

@slandelle
Copy link
Collaborator

Several comments, to help people trying to help here:

  • this issue is lacking a reproducer
  • it would probably help to narrow the scope of the investigation:
    • does it work with a prior version of Scala 3 (3.0?, 3.1?, 3.2?)?
    • does it work with an older version of this plugin?

@He-Pin
Copy link
Author

He-Pin commented May 30, 2024

That's true, I will spend sometime to reproduce this, the result current shows dotty/tools/dotc/Driver is missing.

@hamzaremmal
Copy link

Hey @He-Pin, I've been trying to reproduce this issue locally but I wasn't able to do that. Can you share your maven configuration (pom.xml) ?

@He-Pin
Copy link
Author

He-Pin commented Jun 6, 2024

@hamzaremmal thank you, I will send you, but you need update the _2.13 to _3.

parent pom:

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.taobao</groupId>
        <artifactId>parent</artifactId>
        <version>2.0.0</version>
    </parent>
    <groupId>com.alibaba.ultramax</groupId>
    <artifactId>ultra-mtop</artifactId>
    <version>1.0.3-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>ultra-mtop</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <jacoco-plugin.version>0.8.11</jacoco-plugin.version>
        <java.version>21</java.version>
        <maven-antrun.version>1.8</maven-antrun.version>
        <maven-compile-plugin.version>3.11.0</maven-compile-plugin.version>
        <maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <pandora-boot-maven-plugin.version>2.2.3</pandora-boot-maven-plugin.version>
        <pandora-boot.version>2023-07-stable-final-jdk21</pandora-boot.version>
        <spring-boot.version>2.5.12</spring-boot.version>

        <netty.version>4.1.110.Final</netty.version>
        <spring.version>5.3.32</spring.version>
        <lombok.version>1.18.30</lombok.version>
        <kotlin.version>1.9.24</kotlin.version>
        <kotest.version>5.9.0</kotest.version>
        <mockk.version>1.12.0</mockk.version>
        <fastjson2.version>2.0.49</fastjson2.version>
        <mtop3.version>0.6.7</mtop3.version>
        <scala.version>2.13.14</scala.version>
        <agateware.version>1.1.0</agateware.version>
        <pekko.version>1.1.0-M1</pekko.version>
        <jackson.version>2.17.1</jackson.version>
        <ovs-client.version>0.0.1</ovs-client.version>
    </properties>

    <modules>
        <module>ultra-mtop-proxy</module>
        <module>ultra-mtop-proxy-common</module>
        <module>ultra-mtop-jsonpath</module>
        <module>ultra-mtop-start</module>
        <module>ultra-mtop-enhances-api</module>
        <module>ultra-mtop-enhances-i18nutils</module>
        <module>ultra-mtop-enhances-translate</module>
        <module>ultra-mtop-enhances</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.alibaba.mtop3</groupId>
                <artifactId>mtop3-invocation</artifactId>
                <version>${mtop3.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.mtop3</groupId>
                <artifactId>mtop3-common</artifactId>
                <version>${mtop3.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>999-not-exist</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>5.10.2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlinx</groupId>
                <artifactId>kotlinx-coroutines-bom</artifactId>
                <version>1.8.1</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib</artifactId>
                <version>${kotlin.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk8</artifactId>
                <version>${kotlin.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk7</artifactId>
                <version>${kotlin.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-common</artifactId>
                <version>${kotlin.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-test-junit5</artifactId>
                <version>${kotlin.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-reflect</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>io.kotest</groupId>
                <artifactId>kotest-runner-junit5</artifactId>
                <version>${kotest.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.kotest</groupId>
                <artifactId>kotest-assertions-core-jvm</artifactId>
                <version>${kotest.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.kotest</groupId>
                <artifactId>kotest-property-jvm</artifactId>
                <version>${kotest.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.mockk</groupId>
                <artifactId>mockk</artifactId>
                <version>${mockk.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-test</artifactId>
                <version>${kotlin.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>1.3.2</version>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-bom</artifactId>
                <version>${netty.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-framework-bom</artifactId>
                <version>${spring.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>jakarta.servlet</groupId>
                <artifactId>jakarta.servlet-api</artifactId>
                <version>6.0.0</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>com.taobao.pandora</groupId>
                <artifactId>pandora-boot-starter-bom</artifactId>
                <version>${pandora-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.alibaba.ultramax</groupId>
                <artifactId>ultra-mtop-proxy</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.ultramax</groupId>
                <artifactId>ultra-mtop-enhances-translate</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.ultramax</groupId>
                <artifactId>ultra-mtop-jsonpath</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.ultramax</groupId>
                <artifactId>ultra-mtop-proxy-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.ultramax</groupId>
                <artifactId>ultra-mtop-enhances-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.ultramax</groupId>
                <artifactId>ultra-mtop-enhances</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.aliyun.tair</groupId>
                <artifactId>tairjedis-sdk-singlepath</artifactId>
                <version>2.4.8</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jcl</artifactId>
                <version>999-not-exist</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>1.7.26</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>999-not-exist-v3</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
                <version>99.0-does-not-exist</version>
            </dependency>
            <dependency>
                <groupId>servlet-api</groupId>
                <artifactId>servlet-api</artifactId>
                <version>999-no-exist-SNAPSHOT</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>999-not-exist-SNAPSHOT</version>
            </dependency>
            <!-- fastjson -->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>${fastjson2.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.fastjson2</groupId>
                <artifactId>fastjson2</artifactId>
                <version>${fastjson2.version}</version>
            </dependency>
            <dependency>
                <groupId>io.vavr</groupId>
                <artifactId>vavr</artifactId>
                <version>0.10.4</version>
            </dependency>
            <dependency>
                <groupId>com.github.ben-manes.caffeine</groupId>
                <artifactId>caffeine</artifactId>
                <version>3.1.8</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-collections4</artifactId>
                <version>4.4</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.14.0</version>
            </dependency>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                <version>${scala.version}</version>
            </dependency>
            <dependency>
                <groupId>com.taobao.wireless</groupId>
                <artifactId>agateware-client</artifactId>
                <version>${agateware.version}</version>
            </dependency>
            <dependency>
                <groupId>com.taobao.eagleeye</groupId>
                <artifactId>eagleeye-core</artifactId>
                <version>1.10.0</version>
            </dependency>
            <dependency>
                <groupId>com.taobao.vipserver</groupId>
                <artifactId>vipserver-client</artifactId>
                <version>4.9.6</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.ovs.translate</groupId>
                <artifactId>ovs-translate-client</artifactId>
                <version>${ovs-client.version}</version>
            </dependency>
            <dependency>
                <groupId>com.typesafe</groupId>
                <artifactId>config</artifactId>
                <version>1.4.3</version>
            </dependency>
            <dependency>
                <groupId>org.apache.pekko</groupId>
                <artifactId>pekko-stream_2.13</artifactId>
                <version>${pekko.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.pekko</groupId>
                <artifactId>pekko-slf4j_2.13</artifactId>
                <version>${pekko.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- 所有模块都需要的单元测试相关依赖 -->
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk7</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-common</artifactId>
        </dependency>
        <dependency>
            <groupId>io.kotest</groupId>
            <artifactId>kotest-runner-junit5</artifactId>
        </dependency>
        <dependency>
            <groupId>io.kotest</groupId>
            <artifactId>kotest-assertions-core-jvm</artifactId>
        </dependency>
        <dependency>
            <groupId>io.kotest</groupId>
            <artifactId>kotest-property-jvm</artifactId>
        </dependency>
        <dependency>
            <groupId>io.mockk</groupId>
            <artifactId>mockk</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-test</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-plugin</artifactId>
                    <version>${kotlin.version}</version>
                    <configuration>
                        <compilerPlugins>
                            <plugin>lombok</plugin>
                        </compilerPlugins>
                        <!--                        <pluginOptions>-->
                        <!--                            <option>lombok:config=${project.basedir}/lombok.config</option>-->
                        <!--                        </pluginOptions>-->
                    </configuration>
                    <executions>
                        <execution>
                            <id>compile</id>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <sourceDirs>
                                    <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                                    <sourceDir>${project.basedir}/src/main/java</sourceDir>
                                </sourceDirs>
                            </configuration>
                        </execution>
                        <execution>
                            <id>test-compile</id>
                            <goals>
                                <goal>test-compile</goal>
                            </goals>
                            <configuration>
                                <sourceDirs>
                                    <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                                    <sourceDir>${project.basedir}/src/test/java</sourceDir>
                                </sourceDirs>
                            </configuration>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.jetbrains.kotlin</groupId>
                            <artifactId>kotlin-maven-lombok</artifactId>
                            <version>${kotlin.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${maven-antrun.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.taobao.pandora</groupId>
                    <artifactId>pandora-boot-maven-plugin</artifactId>
                    <version>${pandora-boot-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compile-plugin.version}</version>
                    <configuration>
                        <encoding>UTF-8</encoding>
                        <release>${maven.compiler.target}</release>
                        <annotationProcessorPaths>
                            <annotationProcessorPath>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </annotationProcessorPath>
                        </annotationProcessorPaths>
                    </configuration>

                    <executions>
                        <!-- Replacing default-compile as it is treated specially by maven -->
                        <execution>
                            <id>default-compile</id>
                            <phase>none</phase>
                        </execution>
                        <!-- Replacing default-testCompile as it is treated specially by maven -->
                        <execution>
                            <id>default-testCompile</id>
                            <phase>none</phase>
                        </execution>
                        <execution>
                            <id>java-compile</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>java-test-compile</id>
                            <phase>test-compile</phase>
                            <goals>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <!-- 这个argLine会报红,但不能删除,是jacoco插入代理用的占位符,对应jacoco插件里的propertyName-->
                        <argLine>
                            <!--							${argLine} -Xmx1024m -Dfile.encoding=UTF-8-->
                            --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
                            --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
                            --add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
                            --add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
                            --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
                            --add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
                            --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
                            --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
                            --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
                            --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
                            --add-opens java.base/java.lang=ALL-UNNAMED
                            --add-opens java.base/java.util.concurrent=ALL-UNNAMED
                            --add-opens java.base/java.util.concurrent.locks=ALL-UNNAMED
                            --add-opens java.base/java.text=ALL-UNNAMED
                            --add-opens java.base/java.net=ALL-UNNAMED
                            --add-opens java.base/java.util=ALL-UNNAMED
                            --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED
                            --add-opens java.base/java.util.regex=ALL-UNNAMED
                            --add-opens java.base/java.nio=ALL-UNNAMED
                            --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
                            --add-exports java.base/sun.net.www.protocol.https=ALL-UNNAMED
                            --add-exports java.base/sun.util.calendar=ALL-UNNAMED
                            --add-exports java.base/java.lang.reflect=ALL-UNNAMED
                            --add-opens java.base/sun.net.util=ALL-UNNAMED
                            --add-opens java.base/sun.nio.ch=ALL-UNNAMED
                            --add-opens java.base/java.math=ALL-UNNAMED
                            --add-opens java.base/sun.security.action=ALL-UNNAMED
                            --add-opens java.management/sun.management=ALL-UNNAMED
                            --add-opens java.sql/java.sql=ALL-UNNAMED
                        </argLine>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-plugin.version}</version>
                    <configuration>
                        <propertyName>argLine</propertyName>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default-prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>default-report</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                                <goal>report-aggregate</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.3.0</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <!-- 全局启用jacoco,子模块会继承父模块配置,如果只希望某些子模块启用,将父模块的删除,在特定子模块配置该项 -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

child-pom:

<?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>

    <parent>
        <groupId>com.alibaba.ultramax</groupId>
        <artifactId>ultra-mtop</artifactId>
        <version>1.0.3-SNAPSHOT</version>
    </parent>

    <groupId>com.alibaba.ultramax</groupId>
    <artifactId>ultra-mtop-jsonpath</artifactId>
    <version>1.0.3-SNAPSHOT</version>


    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.lihaoyi</groupId>
            <artifactId>fastparse_2.13</artifactId>
            <version>3.1.0</version>
            <exclusions>
                <exclusion>
                    <artifactId>scala-library</artifactId>
                    <groupId>org.scala-lang</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
        </dependency>
        <dependency>
            <groupId>com.github.ben-manes.caffeine</groupId>
            <artifactId>caffeine</artifactId>
        </dependency>
        <dependency>
            <groupId>io.vavr</groupId>
            <artifactId>vavr</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src/main/scala</sourceDirectory>
        <testSourceDirectory>src/test/scala</testSourceDirectory>

        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/java</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-test-source</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/test/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>4.9.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <scalaVersion>${scala.version}</scalaVersion>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <!-- 全局启用jacoco,子模块会继承父模块配置,如果只希望某些子模块启用,将父模块的删除,在特定子模块配置该项 -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

@slandelle
Copy link
Collaborator

slandelle commented Jun 6, 2024

@He-Pin That's not exactly a Minimal, Reproducible Example as described in my link above 😂

Could you please trim it down, make it completely standalone and push it on GitHub as a real project?

@He-Pin
Copy link
Author

He-Pin commented Jun 6, 2024

I will try it this weekend, sorry.

@He-Pin
Copy link
Author

He-Pin commented Jun 7, 2024

Updated:
I find after I change the [_: P] to [$: P] , it now compiles in maven, and I need update the Scala plugin to nightly in IDEA to make it works in IDEA.

scalac: 
  exception occurred while typechecking C:\Users\hepin\IdeaProjects\ultra-mtop\ultra-mtop-jsonpath\src\main\java\com\alibaba\ultramax\mtop\jsonpath\ast\JsonPathScope.java

  An unhandled exception was thrown in the compiler.
  Please file a crash report here:
  https://github.com/scala/scala3/issues/new/choose
  For non-enriched exceptions, compile with -Yno-enrich-error-messages.

     while compiling: C:\Users\hepin\IdeaProjects\ultra-mtop\ultra-mtop-jsonpath\src\main\java\com\alibaba\ultramax\mtop\jsonpath\ast\JsonPathScope.java
        during phase: typer
                mode: Mode(ImplicitsEnabled)
     library version: version 2.13.12
    compiler version: version 3.4.2
            settings: -classpath C:\Users\hepin\IdeaProjects\ultra-mtop\ultra-mtop-jsonpath\target\classes;C:\Users\hepin\.m2\repository\org\projectlombok\lombok\1.18.30\lombok-1.18.30.jar;C:\Users\hepin\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.17.1\jackson-databind-2.17.1.jar;C:\Users\hepin\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.17.1\jackson-annotations-2.17.1.jar;C:\Users\hepin\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.17.1\jackson-core-2.17.1.jar;C:\Users\hepin\.m2\repository\com\lihaoyi\fastparse_3\3.1.0\fastparse_3-3.1.0.jar;C:\Users\hepin\.m2\repository\com\lihaoyi\sourcecode_3\0.4.0\sourcecode_3-0.4.0.jar;C:\Users\hepin\.m2\repository\com\lihaoyi\geny_3\1.1.0\geny_3-1.1.0.jar;C:\Users\hepin\.m2\repository\org\scala-lang\scala3-library_3\3.3.1\scala3-library_3-3.3.1.jar;C:\Users\hepin\.m2\repository\org\scala-lang\scala-library\2.13.14\scala-library-2.13.14.jar;C:\Users\hepin\.m2\repository\com\github\ben-manes\caffeine\caffeine\3.1.8\caffeine-3.1.8.jar;C:\Users\hepin\.m2\repository\org\checkerframework\checker-qual\3.37.0\checker-qual-3.37.0.jar;C:\Users\hepin\.m2\repository\com\google\errorprone\error_prone_annotations\2.21.1\error_prone_annotations-2.21.1.jar;C:\Users\hepin\.m2\repository\io\vavr\vavr\0.10.4\vavr-0.10.4.jar;C:\Users\hepin\.m2\repository\io\vavr\vavr-match\0.10.4\vavr-match-0.10.4.jar;C:\Users\hepin\.m2\repository\org\apache\commons\commons-collections4\4.4\commons-collections4-4.4.jar;C:\Users\hepin\.m2\repository\org\apache\commons\commons-lang3\3.14.0\commons-lang3-3.14.0.jar;C:\Users\hepin\.m2\repository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;C:\Users\hepin\.m2\repository\ch\qos\logback\logback-classic\1.2.11\logback-classic-1.2.11.jar;C:\Users\hepin\.m2\repository\ch\qos\logback\logback-core\1.2.11\logback-core-1.2.11.jar;C:\Users\hepin\.ivy2\cache\org.scala-lang\scala3-library_3\jars\scala3-library_3-3.4.2.jar;C:\Users\hepin\.ivy2\cache\org.scala-lang\scala-library\jars\scala-library-2.13.12.jar -d C:\Users\hepin\IdeaProjects\ultra-mtop\ultra-mtop-jsonpath\target\classes


scalac: Error: assertion failed: illegal flagset combination: <permanent> and sealed abstract
java.lang.AssertionError: assertion failed: illegal flagset combination: <permanent> and sealed abstract
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.dotc.core.Flags$.$bar(Flags.scala:40)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.setFlag(SymDenotations.scala:83)
	at dotty.tools.dotc.typer.Namer.addEnumConstants(Namer.scala:497)
	at dotty.tools.dotc.typer.Namer.recur$1(Namer.scala:403)
	at dotty.tools.dotc.typer.Namer.indexExpanded(Namer.scala:411)
	at dotty.tools.dotc.typer.Namer.$anonfun$14(Namer.scala:711)
	at scala.collection.LinearSeqOps.foldLeft(LinearSeq.scala:183)
	at scala.collection.LinearSeqOps.foldLeft$(LinearSeq.scala:179)
	at scala.collection.immutable.List.foldLeft(List.scala:79)
	at dotty.tools.dotc.typer.Namer.index(Namer.scala:711)
	at dotty.tools.dotc.typer.Namer$ClassCompleter.completeConstructor(Namer.scala:1486)
	at dotty.tools.dotc.typer.Namer$ClassCompleter.completeInCreationContext(Namer.scala:1621)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:831)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:178)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:190)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:192)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:398)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:3084)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3109)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3220)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3298)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3302)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3324)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3370)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2947)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3171)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3221)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3298)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3302)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3413)
	at dotty.tools.dotc.typer.TyperPhase.typeCheck$$anonfun$1(TyperPhase.scala:47)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at dotty.tools.dotc.core.Phases$Phase.monitor(Phases.scala:477)
	at dotty.tools.dotc.typer.TyperPhase.typeCheck(TyperPhase.scala:53)
	at dotty.tools.dotc.typer.TyperPhase.$anonfun$4(TyperPhase.scala:99)
	at scala.collection.Iterator$$anon$6.hasNext(Iterator.scala:479)
	at scala.collection.Iterator$$anon$9.hasNext(Iterator.scala:583)
	at scala.collection.immutable.List.prependedAll(List.scala:155)
	at scala.collection.immutable.List$.from(List.scala:684)
	at scala.collection.immutable.List$.from(List.scala:681)
	at scala.collection.IterableOps$WithFilter.map(Iterable.scala:898)
	at dotty.tools.dotc.typer.TyperPhase.runOn(TyperPhase.scala:100)
	at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:315)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
	at dotty.tools.dotc.Run.runPhases$1(Run.scala:337)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:350)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:360)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:69)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:360)
	at dotty.tools.dotc.Run.compileSources(Run.scala:261)
	at dotty.tools.dotc.Run.compile(Run.scala:246)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:37)
	at dotty.tools.xsbt.CompilerBridgeDriver.run(CompilerBridgeDriver.java:141)
	at dotty.tools.xsbt.CompilerBridge.run(CompilerBridge.java:22)
	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91)
	at org.jetbrains.jps.incremental.scala.local.IdeaIncrementalCompiler.compile(IdeaIncrementalCompiler.scala:47)
	at org.jetbrains.jps.incremental.scala.local.LocalServer.doCompile(LocalServer.scala:50)
	at org.jetbrains.jps.incremental.scala.local.LocalServer.compile(LocalServer.scala:28)
	at org.jetbrains.jps.incremental.scala.remote.Main$.compileLogic(Main.scala:210)
	at org.jetbrains.jps.incremental.scala.remote.Main$.$anonfun$handleCommand$1(Main.scala:193)
	at org.jetbrains.jps.incremental.scala.remote.Main$.decorated$1(Main.scala:180)
	at org.jetbrains.jps.incremental.scala.remote.Main$.handleCommand(Main.scala:190)
	at org.jetbrains.jps.incremental.scala.remote.Main$.serverLogic(Main.scala:163)
	at org.jetbrains.jps.incremental.scala.remote.Main$.nailMain(Main.scala:103)
	at org.jetbrains.jps.incremental.scala.remote.Main.nailMain(Main.scala)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.facebook.nailgun.NGSession.runImpl(NGSession.java:312)
	at com.facebook.nailgun.NGSession.run(NGSession.java:198)

and

scalac: 
  unhandled exception while running MegaPhase{protectedAccessors, extmethods, uncacheGivenAliases, checkStatic, elimByName, hoistSuperArgs, forwardDepChecks, specializeApplyMethods, tryCatchPatterns, patternMatcher} on C:\Users\hepin\IdeaProjects\ultra-mtop\ultra-mtop-jsonpath\src\main\scala\com\alibaba\ultramax\mtop\jsonpath\JsonPathParser.scala

  An unhandled exception was thrown in the compiler.
  Please file a crash report here:
  https://github.com/scala/scala3/issues/new/choose
  For non-enriched exceptions, compile with -Yno-enrich-error-messages.

     while compiling: C:\Users\hepin\IdeaProjects\ultra-mtop\ultra-mtop-jsonpath\src\main\scala\com\alibaba\ultramax\mtop\jsonpath\JsonPathParser.scala
        during phase: MegaPhase{protectedAccessors, extmethods, uncacheGivenAliases, checkStatic, elimByName, hoistSuperArgs, forwardDepChecks, specializeApplyMethods, tryCatchPatterns, patternMatcher}
                mode: Mode(ImplicitsEnabled)
     library version: version 2.13.12
    compiler version: version 3.4.2
            settings: -classpath C:\Users\hepin\IdeaProjects\ultra-mtop\ultra-mtop-jsonpath\target\classes;C:\Users\hepin\.m2\repository\org\projectlombok\lombok\1.18.30\lombok-1.18.30.jar;C:\Users\hepin\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.17.1\jackson-databind-2.17.1.jar;C:\Users\hepin\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.17.1\jackson-annotations-2.17.1.jar;C:\Users\hepin\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.17.1\jackson-core-2.17.1.jar;C:\Users\hepin\.m2\repository\com\lihaoyi\fastparse_3\3.1.0\fastparse_3-3.1.0.jar;C:\Users\hepin\.m2\repository\com\lihaoyi\sourcecode_3\0.4.0\sourcecode_3-0.4.0.jar;C:\Users\hepin\.m2\repository\com\lihaoyi\geny_3\1.1.0\geny_3-1.1.0.jar;C:\Users\hepin\.m2\repository\org\scala-lang\scala3-library_3\3.3.1\scala3-library_3-3.3.1.jar;C:\Users\hepin\.m2\repository\org\scala-lang\scala-library\2.13.14\scala-library-2.13.14.jar;C:\Users\hepin\.m2\repository\com\github\ben-manes\caffeine\caffeine\3.1.8\caffeine-3.1.8.jar;C:\Users\hepin\.m2\repository\org\checkerframework\checker-qual\3.37.0\checker-qual-3.37.0.jar;C:\Users\hepin\.m2\repository\com\google\errorprone\error_prone_annotations\2.21.1\error_prone_annotations-2.21.1.jar;C:\Users\hepin\.m2\repository\io\vavr\vavr\0.10.4\vavr-0.10.4.jar;C:\Users\hepin\.m2\repository\io\vavr\vavr-match\0.10.4\vavr-match-0.10.4.jar;C:\Users\hepin\.m2\repository\org\apache\commons\commons-collections4\4.4\commons-collections4-4.4.jar;C:\Users\hepin\.m2\repository\org\apache\commons\commons-lang3\3.14.0\commons-lang3-3.14.0.jar;C:\Users\hepin\.m2\repository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;C:\Users\hepin\.m2\repository\ch\qos\logback\logback-classic\1.2.11\logback-classic-1.2.11.jar;C:\Users\hepin\.m2\repository\ch\qos\logback\logback-core\1.2.11\logback-core-1.2.11.jar;C:\Users\hepin\.ivy2\cache\org.scala-lang\scala3-library_3\jars\scala3-library_3-3.4.2.jar;C:\Users\hepin\.ivy2\cache\org.scala-lang\scala-library\jars\scala-library-2.13.12.jar -d C:\Users\hepin\IdeaProjects\ultra-mtop\ultra-mtop-jsonpath\target\classes

Sometimes, an error occurs when trying to run tests in IDEA with the latest version with the latest plugin.

@He-Pin
Copy link
Author

He-Pin commented Jun 7, 2024

@Kordyjan @SethTisue @slandelle @hamzaremmal Thank you all for this, I found the root cause when preparing a minimal reproducer. but now it seems like a toolchain problem.

@He-Pin
Copy link
Author

He-Pin commented Jun 7, 2024

it only compiles with Scala 3.4.2 but not 3.3.3 in maven, when using 3.3.3, it throw errors:

[INFO] compiling 1 Scala source and 63 Java sources to C:\Users\hepin\IdeaProjects\ultra-mtop\ultra-mtop-jsonpath\target\classes ...
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/JsonPathAST.java:12:14: illegal start of type declaration
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/Segment.java:8:14: illegal start of type declaration
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/Selection.java:14:14: illegal start of type declaration
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/Selector.java:11:14: illegal start of type declaration
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/Node.java:29:14: illegal start of type declaration
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/PathResult.java:15:14: illegal start of type declaration
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/JsonPath.java:3:58: value JsonPathAST is not a member of com.alibaba.ultramax.mtop.jsonpath.ast
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/JsonPath.java:57:18: Not found: type PathResult
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/JsonPath.java:63:18: Not found: type PathResult
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/JsonPath.java:68:18: Not found: type PathResult
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/JsonPath.java:80:18: Not found: type PathResult
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/JsonPath.java:92:18: Not found: type PathResult
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/JsonPathScope.java:8:37: Not found: type JsonPathAST
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/NormalizedPath.java:3:55: value Selector is not a member of com.alibaba.ultramax.mtop.jsonpath.ast
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/NormalizedPath.java:4:55: value Selector is not a member of com.alibaba.ultramax.mtop.jsonpath.ast
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/NormalizedPath.java:17:45: Not found: type JsonPathAST
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/NormalizedPathSegment.java:12:66: Not found: type JsonPathAST
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/NormalizedPath.java:20:18: Not found: type RootIdentifier
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/NormalizedPath.java:35:39: Not found: type Selector
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/NormalizedPathSegment.java:12:36: Not found: type Selector
exception caught when loading module class $: Cyclic reference involving module class $
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/Selection.java:3:55: value Selector is not a member of com.alibaba.ultramax.mtop.jsonpath.ast
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/ast/Selection.java:4:55: value Selector is not a member of com.alibaba.ultramax.mtop.jsonpath.ast
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/EvaluationContext.java:4:58: value Node is not a member of com.alibaba.ultramax.mtop.jsonpath.evaluation       
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryEvaluator.java:3:58: value JsonPathAST is not a member of com.alibaba.ultramax.mtop.jsonpath.ast  
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryEvaluator.java:7:55: value Selector is not a member of com.alibaba.ultramax.mtop.jsonpath.ast     
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryEvaluator.java:9:58: value Node is not a member of com.alibaba.ultramax.mtop.jsonpath.evaluation  
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:4:58: value JsonPathAST is not a member of com.alibaba.ultramax.mtop.jsonpath.ast  
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:5:54: value Segment is not a member of com.alibaba.ultramax.mtop.jsonpath.ast      
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:6:56: value Selection is not a member of com.alibaba.ultramax.mtop.jsonpath.ast    
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:7:56: value Selection is not a member of com.alibaba.ultramax.mtop.jsonpath.ast    
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:8:56: value Selection is not a member of com.alibaba.ultramax.mtop.jsonpath.ast    
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:9:55: value Selector is not a member of com.alibaba.ultramax.mtop.jsonpath.ast     
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:10:55: value Selector is not a member of com.alibaba.ultramax.mtop.jsonpath.ast    
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:11:55: value Selector is not a member of com.alibaba.ultramax.mtop.jsonpath.ast    
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:12:55: value Selector is not a member of com.alibaba.ultramax.mtop.jsonpath.ast    
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:28:60: Not found: type Selector
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:29:28: Not found: type Selector
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:34:43: Not found: type Selector
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:40:61: Not found: type Selection
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:41:29: Not found: type Selection
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:46:44: Not found: type Selection
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:124:108: Not found: type Segment
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/JsonPathQueryOptimizer.java:124:43: Not found: type Segment
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/NodeList.java:16:61: Not found: type Node
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/NodeList.java:16:28: Not found: type Node
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/NodeList.java:22:20: Not found: type Node
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/NodeList.java:44:11: Not found: type Node
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/NormalizedPathEvaluator.java:3:58: value JsonPathAST is not a member of com.alibaba.ultramax.mtop.jsonpath.ast 
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/NormalizedPathEvaluator.java:41:55: Not found: type Segment
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/NormalizedPathEvaluator.java:55:49: Not found: type Segment
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/NormalizedPathEvaluator.java:69:56: Not found: type Segment
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/NormalizedPathEvaluator.java:81:51: Not found: type Segment
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/NormalizedPathEvaluator.java:92:50: Not found: type Selector
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/evaluation/PathResult.java:3:58: value Node is not a member of com.alibaba.ultramax.mtop.jsonpath.evaluation
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/int
erpreter/JsonPathQueryInterpreter.java:3:58: value JsonPathAST is not a member of com.alibaba.ultramax.mtop.jsonpath.ast
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/int
erpreter/JsonPathQueryInterpreter.java:7:64: value PathResult is not a member of com.alibaba.ultramax.mtop.jsonpath.evaluation
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/interpreter/JsonPathQueryInterpreter.java:25:71: Not found: type PathResult
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/materializer/PathResultBytesMaterializer.java:11:65: Not found: type PathResult
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/materializer/PathResultStringMaterializer.java:11:66: Not found: type PathResult
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/interpreter/JsonPathQueryInterpreter.java:46:11: Not found: type PathResult
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/matcher/ParsedJsonPathMatchRule.java:3:58: value JsonPathAST is not a member of com.alibaba.ultramax.mtop.jsonpath.ast    
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/materializer/PathResultBytesMaterializer.java:18:36: Not found: type PathResult
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/materializer/PathResultStringMaterializer.java:18:36: Not found: type PathResult
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/serializer/NodeSerializer.java:4:58: value Node is not a member of com.alibaba.ultramax.mtop.jsonpath.evaluation
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/serializer/NodeSerializer.java:5:58: value Node is not a member of com.alibaba.ultramax.mtop.jsonpath.evaluation
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/serializer/NodeSerializer.java:17:50: Not found: type Node
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/serializer/NodeSerializer.java:23:26: Not found: type Node
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/serializer/PathResultSerializer.java:15:56: Not found: type PathResult
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/java/com/alibaba/ultramax/mtop/jsonpath/serializer/PathResultSerializer.java:21:26: Not found: type PathResult
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/scala/com/alibaba/ultramax/mtop/jsonpath/JsonPathParser.scala:3:46: value JsonPathAST is not a member of com.alibaba.ultramax.mtop.jsonpath.ast
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/scala/com/alibaba/ultramax/mtop/jsonpath/JsonPathParser.scala:4:46: value Segment is not a member of com.alibaba.ultramax.mtop.jsonpath.ast
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/scala/com/alibaba/ultramax/mtop/jsonpath/JsonPathParser.scala:5:46: value Selection is not a member of com.alibaba.ultramax.mtop.jsonpath.ast
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/scala/com/alibaba/ultramax/mtop/jsonpath/JsonPathParser.scala:6:46: value Selector is not a member of com.alibaba.ultramax.mtop.jsonpath.ast
[ERROR] C:/Users/hepin/IdeaProjects/ultra-mtop/ultra-mtop-jsonpath/src/main/scala/com/alibaba/ultramax/mtop/jsonpath/JsonPathParser.scala:60:31: Found:    (e : Any)
Required: Throwable
[ERROR] 74 errors found

@He-Pin
Copy link
Author

He-Pin commented Jun 7, 2024

 illegal start of type declaration

It compiles with 3.4.2 but not with 3.3.3

projects: https://github.com/He-Pin/scala3-maven-compile-demo

I will update the demo projects once the current issue has been fixed.

@slandelle @Kordyjan @hamzaremmal I have updated a demo project for the very first issue.

@hamzaremmal
Copy link

hamzaremmal commented Jun 7, 2024

I've cloned your project locally and it compiles with 3.4.2 as expected. When I tried with 3.3.3, I have the following error:
illegal start of type declaration (which is expected for 3.3.3)

~/Desktop/LAMP/playground/scala3-maven-compile-demo git:[master]
mvn clean compile
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.example:scala3-maven-compile >------------------
[INFO] Building scala3-maven-compile 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ scala3-maven-compile ---
[INFO] Deleting /Users/hamzaremmal/Desktop/LAMP/playground/scala3-maven-compile-demo/target
[INFO] 
[INFO] --- build-helper:3.5.0:add-source (add-source) @ scala3-maven-compile ---
[INFO] Source directory: /Users/hamzaremmal/Desktop/LAMP/playground/scala3-maven-compile-demo/src/main/java added.
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ scala3-maven-compile ---
[INFO] skip non existing resourceDirectory /Users/hamzaremmal/Desktop/LAMP/playground/scala3-maven-compile-demo/src/main/resources
[INFO] 
[INFO] --- compiler:3.11.0:compile (default-compile) @ scala3-maven-compile ---
[INFO] Changes detected - recompiling the module! :source
[INFO] Compiling 2 source files with javac [debug target 21] to target/classes
[INFO] 
[INFO] --- scala:4.9.1:compile (default) @ scala3-maven-compile ---
[INFO] compiling 1 Scala source and 2 Java sources to /Users/hamzaremmal/Desktop/LAMP/playground/scala3-maven-compile-demo/target/classes ...
[ERROR] /Users/hamzaremmal/Desktop/LAMP/playground/scala3-maven-compile-demo/src/main/java/org/example/JsonPathAST.java:13:14: illegal start of type declaration
[ERROR] one error found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.308 s
[INFO] Finished at: 2024-06-07T14:18:03+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:4.9.1:compile (default) on project scala3-maven-compile: Execution default of goal net.alchim31.maven:scala-maven-plugin:4.9.1:compile failed: Compilation failed: InterfaceCompileFailed -> [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/PluginExecutionException

@SethTisue
Copy link

ah, @He-Pin found scala/scala3#18533 about 2 minutes before I did :-)

@He-Pin
Copy link
Author

He-Pin commented Jun 7, 2024

@hamzaremmal yes, I just found that too, thanks for looks into it.
image

I think I can't use Scala 3.4.2 for now, because IDEA fails, and most of my team doesn't know Scala, and we need to run testing In IDEA during the development.

But with Scala 2.13.14, it works very well now.

@SethTisue
Copy link

SethTisue commented Jun 7, 2024

With sbt, I'd suggest seeing if the project can be compiled using CompileOrder.JavaThenScala; many projects with some Java sources don't actually need mixed compilation. (It's only under mixed compilation that Java sources are passed to the Scala compiler.) Not sure if the Maven plugin offers an equivalent of this.

@He-Pin
Copy link
Author

He-Pin commented Jun 7, 2024

The AST is defined in Java 21's sealed trait because the other team just know Java, and only the parser is written in Scala, so that a mixed :(

image

@He-Pin
Copy link
Author

He-Pin commented Jun 7, 2024

I think we can close this issue now, because the projects does compile with Scala 3.4.2. I need change the [_: P] to [$: P]. it was very misleading when it was [_: P]

@SethTisue
Copy link

SethTisue commented Jun 7, 2024

The AST is defined in Java 21's sealed trait because the other team just know Java, and only the parser is written in Scala, so that a mixed

Are you sure? You only need mixed compilation if there are dependencies between the two languages going in both directions. From what you've said so far, it sounds like the Scala code depends on the Java, but perhaps the Java code doesn't depend on the Scala? In that scenario, JavaThenScala is sufficient.

@He-Pin
Copy link
Author

He-Pin commented Jun 7, 2024

The other part is written in Java, do you mean if two classes is not not bidirectional depending each other, then can use JavaThenScala?

@SethTisue
Copy link

SethTisue commented Jun 9, 2024

in order for JavaThenScala to work, none of the Java sources can depend on any of the Scala sources (within each subproject, I mean; between subprojects, it doesn't matter)

@He-Pin
Copy link
Author

He-Pin commented Jun 11, 2024

@SethTisue Thanks, I see, that will require it to be a pure scala module.

@slandelle
Copy link
Collaborator

Closing as invalid. Please chime in otherwise. Thanks @SethTisue for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants