Skip to content
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

For Maven Plugin 0.9.20, the native:metadata-copy task cannot be executed normally #403

Closed
linghengqian opened this issue Feb 16, 2023 · 3 comments · Fixed by #407
Closed
Assignees
Labels
bug Something isn't working maven-plugin Related to Maven plugin

Comments

@linghengqian
Copy link
Contributor

linghengqian commented Feb 16, 2023

Before reporting

  • This repository should be used to report issues on the Maven or Gradle plugins for GraalVM.
  • Please report issues which are specific to the Spring Framework or the Micronaut framework to their specific repositories.
  • Do not report issues with building your specific application, e.g errors which happen at image build time like classes initialized at build time, or missing classes as run time: those are not related to the plugins but problems with configuration. You can refer to the GraalVM native image documentation for available options and the plugins documentation for how to use them with the plugin.

Describe the bug
A clear and concise description of what the bug is.
Make sure that you have read the documentation and that you are using the latest plugin version.

  • For Maven Plugin 0.9.20, the native:metadata-copy task cannot be executed normally. Although there is no error in the log, the final json file is not output to the custom outputDirectory.
  • image

To Reproduce

When possible, provide a link to a repository which reproduces the issue, with instructions on how to use.
The reproducer must make use of either the Maven or Gradle plugin.

Steps to reproduce the behavior:

sudo apt install unzip zip curl sed -y
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java 22.3.1.r17-grl
sdk use java 22.3.1.r17-grl
gu install native-image
sudo apt-get install build-essential libz-dev zlib1g-dev -y

git clone [email protected]:linghengqian/maven-v0920-metadatacopy-test.git
cd ./maven-v0920-metadatacopy-test/
./mvnw -Pnative -Dagent=true clean test native:metadata-copy

Please use backticks to properly format code.
If possible please attach a complete reproducer here (either as a zip file or as a link to public repository/branch).

Expected behavior
A clear and concise description of what you expected to happen.

Logs
Add logs to help explain your problem.
Please use backticks to properly format big logs. Example:

[INFO] Scanning for projects...
[INFO] Found GraalVM installation from JAVA_HOME variable.
[INFO] 
[INFO] --------------< com.lingh:maven-v0920-metadatacopy-test >---------------
[INFO] Building maven-v0920-metadatacopy-test 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ maven-v0920-metadatacopy-test ---
[INFO] Deleting /home/linghengqian/TwinklingLiftWorks/git/public/maven-v0920-metadatacopy-test/target
[INFO] 
[INFO] --- resources:3.3.0:resources (default-resources) @ maven-v0920-metadatacopy-test ---
[INFO] skip non existing resourceDirectory /home/linghengqian/TwinklingLiftWorks/git/public/maven-v0920-metadatacopy-test/src/main/resources
[INFO] 
[INFO] --- compiler:3.10.1:compile (default-compile) @ maven-v0920-metadatacopy-test ---
[INFO] No sources to compile
[INFO] 
[INFO] --- resources:3.3.0:testResources (default-testResources) @ maven-v0920-metadatacopy-test ---
[INFO] Copying 1 resource
[INFO] 
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ maven-v0920-metadatacopy-test ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /home/linghengqian/TwinklingLiftWorks/git/public/maven-v0920-metadatacopy-test/target/test-classes
[INFO] 
[INFO] --- surefire:3.0.0-M8:test (default-test) @ maven-v0920-metadatacopy-test ---
[WARNING] Parameter 'systemProperties' is deprecated: Use systemPropertyVariables instead.
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.apache.shardingsphere.db.protocol.netty.ChannelAttrInitializerTest
15:55:12.115 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory - Using SLF4J as the default logging framework
15:55:12.122 [main] DEBUG io.netty.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
15:55:12.123 [main] DEBUG io.netty.util.internal.PlatformDependent0 - Java version: 17
15:55:12.124 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
15:55:12.124 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
15:55:12.125 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.storeFence: available
15:55:12.126 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
15:55:12.137 [main] DEBUG io.netty.util.internal.PlatformDependent0 - direct buffer constructor: unavailable: Unable to make private java.nio.DirectByteBuffer(long,int) accessible: module java.base does not "opens java.nio" to unnamed module @131276c2
15:55:12.139 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: unavailable, true, Unable to make static boolean java.nio.Bits.unaligned() accessible: module java.base does not "opens java.nio" to unnamed module @131276c2
15:55:12.140 [main] DEBUG io.netty.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable: class io.netty.util.internal.PlatformDependent0$7 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @131276c2
15:55:12.141 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, int): unavailable
15:55:12.142 [main] DEBUG io.netty.util.internal.PlatformDependent - sun.misc.Unsafe: available
15:55:12.143 [main] DEBUG io.netty.util.internal.PlatformDependent - maxDirectMemory: 3401580544 bytes (maybe)
15:55:12.144 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.tmpdir: /tmp (java.io.tmpdir)
15:55:12.144 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
15:55:12.145 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.maxDirectMemory: -1 bytes
15:55:12.145 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.uninitializedArrayAllocationThreshold: -1
15:55:12.147 [main] DEBUG io.netty.util.internal.CleanerJava9 - java.nio.ByteBuffer.cleaner(): available
15:55:12.150 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.582 s - in org.apache.shardingsphere.db.protocol.netty.ChannelAttrInitializerTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- native:0.9.20:metadata-copy (default-cli) @ maven-v0920-metadatacopy-test ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.028 s
[INFO] Finished at: 2023-02-16T15:55:12+08:00
[INFO] ------------------------------------------------------------------------

System Info (please complete the following information):

  • OS: [e.g. Windows] Linux
  • GraalVM Version [e.g. 22.0 CE] 22.3.1 CE
  • Java Version [e.g. 17] 17
  • Plugin version [e.g. native-gradle-plugin:0.9.10] native-maven-plugin:0.9.20

Additional context
Add any other context about the problem here.

@linghengqian linghengqian added the bug Something isn't working label Feb 16, 2023
@alvarosanchez alvarosanchez added the maven-plugin Related to Maven plugin label Feb 16, 2023
@linghengqian
Copy link
Contributor Author

@alvarosanchez Is there any additional information I need to provide?

@dnestoro
Copy link
Collaborator

dnestoro commented Feb 21, 2023

@linghengqian can you please provide the whole profile block you used to setup agent (from pom.xml) as a comment here, so we can check (same as you pasted console log)

@linghengqian
Copy link
Contributor Author

@dnestoro Hi, this is located at https://github.com/linghengqian/maven-v0920-metadatacopy-test/blob/master/pom.xml which I mentioned above.

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

    <groupId>com.lingh</groupId>
    <artifactId>maven-v0920-metadatacopy-test</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-db-protocol-core</artifactId>
            <version>5.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>4.11.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <version>5.9.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.26</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.2.11</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M8</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>native</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <version>0.9.20</version>
                        <extensions>true</extensions>
                        <configuration>
                            <agent>
                                <defaultMode>Conditional</defaultMode>
                                <modes>
                                    <conditional>
                                        <userCodeFilterPath>${project.basedir}/user-code-filter.json</userCodeFilterPath>
                                        <parallel>true</parallel>
                                    </conditional>
                                </modes>
                                <metadataCopy>
                                    <disabledStages>
                                        <stage>main</stage>
                                    </disabledStages>
                                    <merge>false</merge>
                                    <outputDirectory>${project.basedir}/src/test/resources/test-output-dir</outputDirectory>
                                </metadataCopy>
                            </agent>
                            <metadataRepository>
                                <enabled>true</enabled>
                            </metadataRepository>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working maven-plugin Related to Maven plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants