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

The same build fails on the second run #561

Open
suninformation opened this issue Jan 4, 2022 · 12 comments
Open

The same build fails on the second run #561

suninformation opened this issue Jan 4, 2022 · 12 comments
Labels
waiting for feedback Waiting for feedback

Comments

@suninformation
Copy link

The same command is executed successfully for the first time but is abnormal when it is executed again.
Two command execution console outputs are as follows:

➜  goldenriver-drc git:(master) ✗ mvnd clean compile ymate:entity -DshowOnly=true
[INFO] Processing build on daemon 120445ee
[INFO] Scanning for projects...
[INFO] BuildTimeEventSpy is registered.
[INFO]
[INFO] Using the SmartBuilder implementation with a thread count of 3
[INFO] Task segments : [clean, compile, ymate:entity]
[INFO] Build maximum degree of concurrency is 3
[INFO] Total number of projects is 1
[INFO]
[INFO] ------------------< com.goldenriver:goldenriver-drc >-------------------
[INFO] Building goldenriver-drc 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ goldenriver-drc ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ goldenriver-drc ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ goldenriver-drc ---
[INFO] Compiling 19 source files to /Users/suninformation/IdeaProjects/YMP_2019/goldenriver-drc-parent/goldenriver-drc/target/classes
[INFO]
[INFO] --- ymate-maven-plugin:1.0.0:entity (default-cli) @ goldenriver-drc ---
[INFO] Found and load the config file: /Users/suninformation/IdeaProjects/YMP_2019/goldenriver-drc-parent/goldenriver-drc/src/main/resources/ymp-conf.properties
[INFO]
__  __ __  ___ ___
\ \/ //  |/  // _ \
 \  // /|_/ // ___/
 /_//_/  /_//_/  www.ymate.net
[INFO] Initializing ymate-platform-core-2.1.0-Release build-2022-01-04T16:31:32Z - debug:true - env:dev - PID:50137
[INFO] Initializing ymate-platform-persistence-jdbc-2.1.0-Release build-2022-01-04T16:31:32Z
[INFO] RecycleHelper has registered the number of resources to be recycled: 0
[INFO] Initialization completed, Total time: 63ms
[INFO] Using Transaction class [net.ymate.platform.persistence.jdbc.transaction.impl.DefaultTransaction].
[INFO] [SHOW FULL TABLES WHERE table_type = ?]["BASE TABLE"][1][14ms]
[INFO] [stdout] TABLE_NAME: ApkCheckRule
[INFO] [stdout] COMMENT:
[INFO] [stdout] +----------------+-------------------+-------------+----------------+--------+-----------+-------+----------+---------+---------+
[INFO] [stdout] | COLUMN_NAME    | COLUMN_CLASS_NAME | PRIMARY_KEY | AUTO_INCREMENT | SIGNED | PRECISION | SCALE | NULLABLE | DEFAULT | REMARKS |
[INFO] [stdout] +----------------+-------------------+-------------+----------------+--------+-----------+-------+----------+---------+---------+
[INFO] [stdout] | apkversion     | java.lang.String  | TRUE        | FALSE          | FALSE  | 64        | 0     | FALSE    | NULL    |         |
[INFO] [stdout] | apkpackagename | java.lang.String  | TRUE        | FALSE          | FALSE  | 128       | 0     | FALSE    | NULL    |         |
[INFO] [stdout] | apkdigest      | java.lang.String  | FALSE       | FALSE          | FALSE  | 128       | 0     | FALSE    | NULL    |         |
[INFO] [stdout] | configfiles    | java.lang.String  | FALSE       | FALSE          | FALSE  | 8192      | 0     | FALSE    | NULL    |         |
[INFO] [stdout] +----------------+-------------------+-------------+----------------+--------+-----------+-------+----------+---------+---------+
[INFO] [stdout]
[INFO] Segment walltime 2 s, segment projects service time 2 s, effective/maximum degree of concurrency 1.00/3
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.475 s (Wall Clock)
[INFO] Finished at: 2022-01-05T00:32:03+08:00
[INFO] ------------------------------------------------------------------------
➜  goldenriver-drc git:(master) ✗ mvnd clean compile ymate:entity -DshowOnly=true
[INFO] Processing build on daemon 120445ee
[INFO] Scanning for projects...
[INFO] BuildTimeEventSpy is registered.
[INFO]
[INFO] Using the SmartBuilder implementation with a thread count of 3
[INFO] Task segments : [clean, compile, ymate:entity]
[INFO] Build maximum degree of concurrency is 3
[INFO] Total number of projects is 1
[INFO]
[INFO] ------------------< com.goldenriver:goldenriver-drc >-------------------
[INFO] Building goldenriver-drc 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ goldenriver-drc ---
[INFO] Deleting /Users/suninformation/IdeaProjects/YMP_2019/goldenriver-drc-parent/goldenriver-drc/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ goldenriver-drc ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ goldenriver-drc ---
[INFO] Compiling 19 source files to /Users/suninformation/IdeaProjects/YMP_2019/goldenriver-drc-parent/goldenriver-drc/target/classes
[INFO]
[INFO] --- ymate-maven-plugin:1.0.0:entity (default-cli) @ goldenriver-drc ---
[INFO] Found and load the config file: /Users/suninformation/IdeaProjects/YMP_2019/goldenriver-drc-parent/goldenriver-drc/src/main/resources/ymp-conf.properties
[INFO] Initializing ymate-platform-core-2.1.0-Release build-2022-01-04T16:31:32Z - debug:true - env:dev - PID:50137
[INFO] Initializing ymate-platform-persistence-jdbc-2.1.0-Release build-2022-01-04T16:31:32Z
[INFO] RecycleHelper has registered the number of resources to be recycled: 0
[INFO] Initialization completed, Total time: 3ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.750 s (Wall Clock)
[INFO] Finished at: 2022-01-05T00:32:24+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.ymate.maven.plugins:ymate-maven-plugin:1.0.0:entity (default-cli) on project goldenriver-drc: No suitable driver found for jdbc:mysql://localhost:3306/drc?useUnicode=true&useSSL=false&characterEncoding=UTF-8 -> [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/MojoExecutionException
➜  goldenriver-drc git:(master) ✗

The Mojo configuration is as follows:

@Mojo(name = "entity", requiresDependencyResolution = ResolutionScope.RUNTIME, requiresDependencyCollection = ResolutionScope.RUNTIME)
public class EntityMojo extends AbstractPersistenceMojo {
    ........
}

Use the MVN command to execute successfully.

It can be seen from the error message that the runtime dependent package is not loaded normally.

The following is debug information:

➜  goldenriver-drc git:(master) ✗ mvnd ymate:entity -DshowOnly=true -X
mvnd native client 0.7.1-darwin-amd64 (97c587c11383a67b5bd0ff8388bd94c694b91c1e)
Terminal: org.jline.terminal.impl.PosixSysTerminal with pty org.jline.terminal.impl.jansi.osx.OsXNativePty
[DEBUG] Reading global settings from settings.xml
[DEBUG] Reading user settings from /Users/suninformation/.m2/settings.xml
Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
Maven home: /Users/suninformation/.sdkman/candidates/mvnd/current/mvn
Java version: 1.8.0_271, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.7", arch: "x86_64", family: "mac"
[DEBUG] Reading global toolchains from toolchains.xml
[DEBUG] Reading user toolchains from /Users/suninformation/.m2/toolchains.xml
[INFO] Error stacktraces are turned on.
[DEBUG] Message scheme: color
[DEBUG] Message styles: debug info warning error success failure strong mojo project
[INFO] Processing build on daemon 120445ee
[DEBUG] Using local repository at /Users/suninformation/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /Users/suninformation/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project com.goldenriver:goldenriver-drc:jar:1.0-SNAPSHOT: (none)
[DEBUG] Looking up lifecycle mappings for packaging jar from ClassRealm[maven.ext, parent: ClassRealm[plexus.core, parent: null]]
[DEBUG] Extension realms for project com.goldenriver:goldenriver-drc-parent:pom:1.0-SNAPSHOT: (none)
[DEBUG] Looking up lifecycle mappings for packaging pom from ClassRealm[maven.ext, parent: ClassRealm[plexus.core, parent: null]]
[INFO] BuildTimeEventSpy is registered.
[DEBUG] Resolving plugin prefix ymate from [org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Resolved plugin prefix ymate to net.ymate.maven.plugins:ymate-maven-plugin from POM com.goldenriver:goldenriver-drc:jar:1.0-SNAPSHOT
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: com.goldenriver:goldenriver-drc:jar:1.0-SNAPSHOT
[DEBUG] Tasks:   [ymate:entity]
[DEBUG] Style:   Regular
[DEBUG] =======================================================================
[INFO]
[INFO] Using the SmartBuilder implementation with a thread count of 3
[INFO] Task segments : [ymate:entity]
[INFO] Build maximum degree of concurrency is 3
[INFO] Total number of projects is 1
[DEBUG] Ready com.goldenriver:goldenriver-drc
[DEBUG] STARTED build of project com.goldenriver:goldenriver-drc
[INFO]
[INFO] ------------------< com.goldenriver:goldenriver-drc >-------------------
[INFO] Building goldenriver-drc 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[DEBUG] Resolving plugin prefix ymate from [org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Resolved plugin prefix ymate to net.ymate.maven.plugins:ymate-maven-plugin from POM com.goldenriver:goldenriver-drc:jar:1.0-SNAPSHOT
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project:       com.goldenriver:goldenriver-drc:1.0-SNAPSHOT
[DEBUG] Dependencies (collect): [runtime]
[DEBUG] Dependencies (resolve): [runtime]
[DEBUG] Repositories (dependencies): [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] Repositories (plugins)     : [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          net.ymate.maven.plugins:ymate-maven-plugin:1.0.0:entity (default-cli)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <apidocs>${apidocs}</apidocs>
  <basedir default-value="${basedir}"/>
  <beanOnly>${beanOnly}</beanOnly>
  <cfgFile>${cfgFile}</cfgFile>
  <dataSource default-value="default">${dataSource}</dataSource>
  <dev>${dev}</dev>
  <format default-value="table">${format}</format>
  <mavenProject default-value="${project}"/>
  <overwrite>${overwrite}</overwrite>
  <packageName default-value="${project.groupId}">${packageName}</packageName>
  <projectName default-value="${project.artifactId}"/>
  <showOnly>${showOnly}</showOnly>
  <version default-value="${project.version}"/>
  <view>${view}</view>
</configuration>
[DEBUG] =======================================================================
[DEBUG] Dependency collection stats {ConflictMarker.analyzeTime=293174, ConflictMarker.markTime=112056, ConflictMarker.nodeCount=51, ConflictIdSorter.graphTime=57698, ConflictIdSorter.topsortTime=65607, ConflictIdSorter.conflictIdCount=43, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=513627, ConflictResolver.conflictItemCount=50, DefaultDependencyCollector.collectTime=148915881, DefaultDependencyCollector.transformTime=1138934}
[DEBUG] com.goldenriver:goldenriver-drc:jar:1.0-SNAPSHOT
[DEBUG]    junit:junit:jar:4.13.1:test
[DEBUG]       org.hamcrest:hamcrest-core:jar:1.3:test
[DEBUG]    com.nimbusds:nimbus-jose-jwt:jar:9.15.2:compile
[DEBUG]       com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile
[DEBUG]    org.bouncycastle:bcprov-jdk15on:jar:1.70:compile
[DEBUG]    org.bouncycastle:bcpkix-jdk15on:jar:1.70:compile
[DEBUG]       org.bouncycastle:bcutil-jdk15on:jar:1.70:compile
[DEBUG]    com.google.flatbuffers:flatbuffers-java:jar:2.0.3:compile
[DEBUG]    com.google.crypto.tink:tink:jar:1.6.1:compile
[DEBUG]       com.google.protobuf:protobuf-java:jar:3.14.0:compile
[DEBUG]       com.google.code.gson:gson:jar:2.8.6:compile
[DEBUG]    org.pkcs11:jacknji11:jar:1.2-SNAPSHOT:compile
[DEBUG]       net.java.dev.jna:jna:jar:5.6.0:compile
[DEBUG]       com.github.jnr:jnr-ffi:jar:0.6.0:compile
[DEBUG]          com.github.jnr:jffi:jar:1.0.11:compile
[DEBUG]          com.github.jnr:jffi:jar:native:1.0.11:runtime
[DEBUG]          asm:asm:jar:3.2:compile
[DEBUG]          asm:asm-commons:jar:3.2:compile
[DEBUG]          asm:asm-analysis:jar:3.2:compile
[DEBUG]          asm:asm-tree:jar:3.2:compile
[DEBUG]          asm:asm-util:jar:3.2:compile
[DEBUG]          com.github.jnr:jnr-x86asm:jar:1.0.1:compile
[DEBUG]    io.micrometer:micrometer-registry-prometheus:jar:1.8.1:compile
[DEBUG]       io.micrometer:micrometer-core:jar:1.8.1:compile
[DEBUG]          org.hdrhistogram:HdrHistogram:jar:2.1.12:compile
[DEBUG]          org.latencyutils:LatencyUtils:jar:2.0.3:runtime
[DEBUG]       io.prometheus:simpleclient_common:jar:0.12.0:compile
[DEBUG]          io.prometheus:simpleclient:jar:0.12.0:compile
[DEBUG]             io.prometheus:simpleclient_tracer_otel:jar:0.12.0:compile
[DEBUG]                io.prometheus:simpleclient_tracer_common:jar:0.12.0:compile
[DEBUG]             io.prometheus:simpleclient_tracer_otel_agent:jar:0.12.0:compile
[DEBUG]    net.ymate.platform:ymate-platform-persistence-jdbc:jar:2.1.0:compile
[DEBUG]       com.github.jsqlparser:jsqlparser:jar:4.3:compile
[DEBUG]       net.ymate.platform:ymate-platform-core:jar:2.1.0:compile (version managed from 2.1.0)
[DEBUG]          cglib:cglib:jar:3.3.0:compile
[DEBUG]             org.ow2.asm:asm:jar:7.1:compile
[DEBUG]          net.ymate.platform:ymate-platform-commons:jar:2.1.0:compile
[DEBUG]             commons-logging:commons-logging:jar:1.2:compile
[DEBUG]             org.apache.commons:commons-lang3:jar:3.12.0:compile
[DEBUG]             commons-io:commons-io:jar:2.11.0:compile
[DEBUG]             commons-codec:commons-codec:jar:1.15:compile
[DEBUG]             com.alibaba:fastjson:jar:1.2.79:compile
[DEBUG]             com.thoughtworks.paranamer:paranamer:jar:2.8:compile
[INFO]
[INFO] --- ymate-maven-plugin:1.0.0:entity (default-cli) @ goldenriver-drc ---
[DEBUG] Configuring mojo net.ymate.maven.plugins:ymate-maven-plugin:1.0.0:entity from plugin realm ClassRealm[plugin>net.ymate.maven.plugins:ymate-maven-plugin:1.0.0, parent: org.mvndaemon.mvnd.common.MavenDaemon$1@6f539caf]
[DEBUG] Configuring mojo 'net.ymate.maven.plugins:ymate-maven-plugin:1.0.0:entity' with basic configurator -->
[DEBUG]   (f) basedir = /Users/suninformation/IdeaProjects/YMP_2019/goldenriver-drc-parent/goldenriver-drc
[DEBUG]   (f) dataSource = default
[DEBUG]   (f) format = table
[DEBUG]   (f) mavenProject = MavenProject: com.goldenriver:goldenriver-drc:1.0-SNAPSHOT @ /Users/suninformation/IdeaProjects/YMP_2019/goldenriver-drc-parent/goldenriver-drc/pom.xml
[DEBUG]   (f) packageName = com.goldenriver
[DEBUG]   (f) projectName = goldenriver-drc
[DEBUG]   (f) showOnly = true
[DEBUG]   (f) version = 1.0-SNAPSHOT
[DEBUG] -- end configuration --
[INFO] Found and load the config file: /Users/suninformation/IdeaProjects/YMP_2019/goldenriver-drc-parent/goldenriver-drc/src/main/resources/ymp-conf.properties
[INFO] Initializing ymate-platform-core-2.1.0-Release build-2022-01-04T16:31:32Z - debug:true - env:dev - PID:50137
[INFO] Initializing ymate-platform-persistence-jdbc-2.1.0-Release build-2022-01-04T16:31:32Z
[INFO] RecycleHelper has registered the number of resources to be recycled: 0
[INFO] Initialization completed, Total time: 8ms
[DEBUG] FAILURE build of project com.goldenriver:goldenriver-drc
[DEBUG] Builder state: blocked=0 finished=1 ready-or-running=0
[DEBUG] ------------------------------------------------------------------------
[DEBUG] Build Time Summary:
[DEBUG] ------------------------------------------------------------------------
[DEBUG] goldenriver-drc [0.027s]
[DEBUG]   ymate-maven-plugin:entity (default-cli) .................. [0.027s]
[DEBUG] ------------------------------------------------------------------------
[DEBUG]   ymate-maven-plugin:entity (default-cli) .................. [0.027s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.220 s (Wall Clock)
[INFO] Finished at: 2022-01-05T00:37:10+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.ymate.maven.plugins:ymate-maven-plugin:1.0.0:entity (default-cli) on project goldenriver-drc: No suitable driver found for jdbc:mysql://localhost:3306/drc?useUnicode=true&useSSL=false&characterEncoding=UTF-8 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.ymate.maven.plugins:ymate-maven-plugin:1.0.0:entity (default-cli) on project goldenriver-drc: No suitable driver found for jdbc:mysql://localhost:3306/drc?useUnicode=true&useSSL=false&characterEncoding=UTF-8
	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:274)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:196)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:160)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.mvndaemon.mvnd.builder.SmartBuilderImpl.buildProject(SmartBuilderImpl.java:178)
	at org.mvndaemon.mvnd.builder.SmartBuilderImpl$ProjectBuildTask.run(SmartBuilderImpl.java:198)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.maven.plugin.MojoExecutionException: No suitable driver found for jdbc:mysql://localhost:3306/drc?useUnicode=true&useSSL=false&characterEncoding=UTF-8
	at net.ymate.maven.plugins.EntityMojo.execute(EntityMojo.java:87)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:271)
	... 11 common frames omitted
Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/drc?useUnicode=true&useSSL=false&characterEncoding=UTF-8
	at java.sql.DriverManager.getConnection(DriverManager.java:689)
	at java.sql.DriverManager.getConnection(DriverManager.java:247)
	at net.ymate.platform.persistence.jdbc.impl.DefaultDataSourceAdapter.getConnection(DefaultDataSourceAdapter.java:45)
	at net.ymate.platform.persistence.jdbc.impl.DefaultDataSourceAdapter.getConnection(DefaultDataSourceAdapter.java:31)
	at net.ymate.platform.persistence.jdbc.impl.DefaultDatabaseConnectionHolder.<init>(DefaultDatabaseConnectionHolder.java:41)
	at net.ymate.platform.persistence.jdbc.JDBC.getConnectionHolder(JDBC.java:246)
	at net.ymate.platform.persistence.jdbc.JDBC.openSession(JDBC.java:278)
	at net.ymate.platform.persistence.jdbc.scaffold.Scaffold.getTables(Scaffold.java:236)
	at net.ymate.maven.plugins.EntityMojo.doCreateEntityClassFiles(EntityMojo.java:92)
	at net.ymate.maven.plugins.EntityMojo.execute(EntityMojo.java:85)
	... 13 common frames omitted
[ERROR]
[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/MojoExecutionException
➜  goldenriver-drc git:(master) ✗
@gnodet
Copy link
Contributor

gnodet commented Jan 4, 2022

Could you provide a project to reproduce the problem ?

@suninformation
Copy link
Author

Could you provide a project to reproduce the problem ?

@gnodet OK, I'll get you a project. It will take some time.

@gnodet
Copy link
Contributor

gnodet commented Jan 4, 2022

@suninformation you may want to try excluding the ymate-maven-plugin from the plugin cache using the plugin eviction pattern specified at https://github.com/gnodet/mvnd/blob/91ef6cc29bfc3d28aaf3b31975d830fc46d0abf0/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java#L253-L264

If it fixes the problem, it means the ymate maven plugin does not support being reused because persists some data across invocations and you should fix it.

@suninformation
Copy link
Author

@gnodet You're right. When execute the following command, it's right for a period of time.

mvnd ymate:entity -DshowOnly=true -Dmvnd.pluginRealmEvictPattern=mvn:net.ymate.maven.plugins:ymate-maven-plugin

I don't quite understand how to support reuse? How can I prevent such problems from happening? Can you give me some advice?

@gnodet
Copy link
Contributor

gnodet commented Jan 5, 2022

@gnodet You're right. When execute the following command, it's right for a period of time.

mvnd ymate:entity -DshowOnly=true -Dmvnd.pluginRealmEvictPattern=mvn:net.ymate.maven.plugins:ymate-maven-plugin

I don't quite understand how to support reuse? How can I prevent such problems from happening? Can you give me some advice?

To be honest, I wasn't really expecting the plugin eviction to work, as this looks more like a classloading issue. I suspect the thread's ContextClassLoader is not correctly set the second time. Could you debug the plugin execution and check the TTCL's value ?

@gnodet
Copy link
Contributor

gnodet commented Jan 5, 2022

@gnodet You're right. When execute the following command, it's right for a period of time.

mvnd ymate:entity -DshowOnly=true -Dmvnd.pluginRealmEvictPattern=mvn:net.ymate.maven.plugins:ymate-maven-plugin

I don't quite understand how to support reuse? How can I prevent such problems from happening? Can you give me some advice?

To be honest, I wasn't really expecting the plugin eviction to work, as this looks more like a classloading issue. I suspect the thread's ContextClassLoader is not correctly set the second time. Could you debug the plugin execution and check the TTCL's value ?

It may also be related to the concurrency issue found in maven https://issues.apache.org/jira/browse/MNG-7156 and https://issues.apache.org/jira/browse/MNG-7285 that should be fixed in maven 3.8.5. It was included with #523 but I think I should have removed the custom MavenProject included in mvnd. I think that's the cause of the problem.

@suninformation
Copy link
Author

@gnodet You're right. When execute the following command, it's right for a period of time.

mvnd ymate:entity -DshowOnly=true -Dmvnd.pluginRealmEvictPattern=mvn:net.ymate.maven.plugins:ymate-maven-plugin

I don't quite understand how to support reuse? How can I prevent such problems from happening? Can you give me some advice?

To be honest, I wasn't really expecting the plugin eviction to work, as this looks more like a classloading issue. I suspect the thread's ContextClassLoader is not correctly set the second time. Could you debug the plugin execution and check the TTCL's value ?

It may also be related to the concurrency issue found in maven https://issues.apache.org/jira/browse/MNG-7156 and https://issues.apache.org/jira/browse/MNG-7285 that should be fixed in maven 3.8.5. It was included with #523 but I think I should have removed the custom MavenProject included in mvnd. I think that's the cause of the problem.

That's good news. Now we can only wait for maven 3.8.5 to be released before problem verification. Is there any other way? I can try.

gnodet added a commit to gnodet/mvnd that referenced this issue Jan 5, 2022
@gnodet
Copy link
Contributor

gnodet commented Jan 5, 2022

That's good news. Now we can only wait for maven 3.8.5 to be released before problem verification. Is there any other way? I can try.

Yes. Could you build #566 and see if you can build your project correctly ?

@suninformation
Copy link
Author

@gnodet I download and switch i561 branches from https://github.com/gnodet/mvnd.git.
The result of running after compilation is still wrong, and the problem has not been solved.

suninformation@mintlinux:~/Workspace/goldenriver-drc-parent/goldenriver-drc$ mvnd ymate:entity
[INFO] Processing build on daemon a8dbc4c2
[INFO] Scanning for projects...
[INFO] BuildTimeEventSpy is registered.
[INFO] Task segments : [ymate:entity]
[INFO] Build maximum degree of concurrency is 1
[INFO] Total number of projects is 1
[INFO] 
[INFO] ------------------< com.goldenriver:goldenriver-drc >-------------------
[INFO] Building goldenriver-drc 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- ymate-maven-plugin:1.0.0:entity (default-cli) @ goldenriver-drc ---
[INFO] Found and load the config file: /home/suninformation/Workspace/goldenriver-drc-parent/goldenriver-drc/src/main/resources/ymp-conf.properties
[INFO] Initializing ymate-platform-core-2.1.0-Release build-2022-01-05T16:55:24Z - debug:true - env:dev - PID:13398
[INFO] Initializing ymate-platform-persistence-jdbc-2.1.0-Release build-2022-01-05T16:55:24Z 
[INFO] RecycleHelper has registered the number of resources to be recycled: 0
[INFO] Initialization completed, Total time: 1ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.215 s
[INFO] Finished at: 2022-01-06T02:27:08+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.ymate.maven.plugins:ymate-maven-plugin:1.0.0:entity (default-cli) on project goldenriver-drc: No suitable driver found for jdbc:mysql://192.168.3.6:3306/drc?useUnicode=true&useSSL=false&characterEncoding=UTF-8 -> [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/MojoExecutionException

suninformation@mintlinux:~/Workspace/goldenriver-drc-parent/goldenriver-drc$ mvnd -version
mvnd native client 0.7.2-SNAPSHOT-linux-amd64 (f81c974b881903465bd415d801cca1e82ce1ec0a)
Terminal: org.jline.terminal.impl.PosixSysTerminal with pty org.jline.terminal.impl.jansi.linux.LinuxNativePty
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /home/suninformation/Workspace/mvnd/dist/target/mvnd-0.7.2-SNAPSHOT-linux-amd64/mvn
Java version: 11.0.13, vendor: GraalVM Community, runtime: /home/suninformation/Downloads/graalvm-ce-java11-21.3.0
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-92-generic", arch: "amd64", family: "unix"

@gnodet
Copy link
Contributor

gnodet commented Jan 7, 2022

@gnodet I download and switch i561 branches from https://github.com/gnodet/mvnd.git. The result of running after compilation is still wrong, and the problem has not been solved.

Did you make sure you're using the mvnd version you built and not the 0.7.1 ?
I can't do much more without a way to reproduce the problem unfortunately...

@gnodet gnodet changed the title Exception when the same command is executed again. The same build fails on the second run Jan 7, 2022
@suninformation
Copy link
Author

Did you make sure you're using the mvnd version you built and not the 0.7.1 ? I can't do much more without a way to reproduce the problem unfortunately...

@gnodet I tested by recompiling the mvnd version in a new environment built on a new virtual machine.
I try to build a project that can reproduce the problem.

Thank you very much for your help!

@suninformation
Copy link
Author

@gnodet I created a project to reproduce #561 problems, please visit https://github.com/suninformation/maven-mvnd-demo-561
I hope I can get your help, thank you!

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

No branches or pull requests

2 participants