-
Notifications
You must be signed in to change notification settings - Fork 454
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
[Plugins] Adding plugins to pom.xml fail to build io.quarkus.platform:quarkus-maven-plugin:2.15.0.Final:generate-code-tests
#2889
Comments
spotless-maven-plugin
with prettier config bound to an execution creates Header must provide a Content-Length property.
Plugins
that run external commands fail
Plugins
that run external commands failPlugins
that run external commands fail to build io.quarkus.platform:quarkus-maven-plugin:2.15.0.Final:generate-code-tests
Plugins
that run external commands fail to build io.quarkus.platform:quarkus-maven-plugin:2.15.0.Final:generate-code-tests
Plugins
adding fail to build io.quarkus.platform:quarkus-maven-plugin:2.15.0.Final:generate-code-tests
Plugins
adding fail to build io.quarkus.platform:quarkus-maven-plugin:2.15.0.Final:generate-code-tests
io.quarkus.platform:quarkus-maven-plugin:2.15.0.Final:generate-code-tests
More logs and my vscode config for this plugin when chaning the plugin to ConfigVscode config also running only java plugin {
"java.completion.importOrder": ["#"],
"java.trace.server":"verbose",
"java.format.enabled": false,
"java.quickfix.showAt": "problem",
"java.autobuild.enabled": true,
"java.maven.downloadSources": true,
"java.eclipse.downloadSources": true,
"java.codeGeneration.useBlocks": true,
"java.compile.nullAnalysis.mode":"automatic",
"java.referencesCodeLens.enabled": true,
"java.saveActions.organizeImports": false,
"java.jdt.ls.androidSupport.enabled": "off",
"java.codeGeneration.insertionLocation": "lastMember",
"java.signatureHelp.description.enabled": true,
"java.inlayHints.parameterNames.enabled": "literals",
"java.codeGeneration.toString.codeStyle": "STRING_BUILDER_CHAINED",
"java.configuration.maven.globalSettings": "/home/eriase/.m2/settings.xml",
"java.configuration.updateBuildConfiguration": "automatic",
"java.symbols.includeSourceMethodDeclarations": true,
"java.codeGeneration.hashCodeEquals.useInstanceof": true,
"java.codeGeneration.hashCodeEquals.useJava7Objects": true
} LogsLanguage server
Vscode developer tools
With <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
</plugin> and <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bash</executable>
<commandlineArgs>npx --prefix ${project.basedir} pretty-quick</commandlineArgs>
</configuration>
</execution>
</executions>
</plugin> Java Build status log
|
This keeps happening every time I change the plugin or add a plugin, so I'm going back to version 1.13.0 which does not have these issues. |
There are two issues:
I suppose it is a bug in m2e since it works from the maven command line.
A workaround for VS Code 1.14.0
A related m2e commit @agreedSkiing you can also try https://github.com/snjeza/vscode-test/raw/master/java-1.15.2.vsix . It fixes both issues. I will try to find the reason why maven-spotless-plugin freezes VS Code. |
@snjeza Freezing of VS code it new to me and I only notice it when adding the |
@agreedSkiing Could you show an example? |
The spottless plugin runs the npm command and doesn't read the output stream - https://github.com/diffplug/spotless/blob/0fd20bb80c6c426d20e0a3157c3c2b89317032da/lib/src/main/java/com/diffplug/spotless/npm/NpmProcess.java#L49
This plugin has been ignored in VS Code <= 1.13.0 by default. |
... when using a newer m2e version. See eclipse-m2e/m2e-core#1150 (comment) |
The issue related to the spottles plugin has been fixed. |
Using the wrong word... but the "Opening Java Projects: check details" notification did not disappear when changing to use <plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<executions>
<execution>
<?m2e execute onConfiguration,onIncremental?>
<goals>
<goal>apply</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
<configuration>
<java>
<removeUnusedImports />
<includes>
<include>src/**/java/**/*.java</include>
</includes>
<prettier>
<devDependencyProperties>
<prettier>${prettier.version}</prettier>
<prettier-plugin-java>
${prettier.java.version}
</prettier-plugin-java>
</devDependencyProperties>
<configFile>${project.basedir}/.prettierrc</configFile>
</prettier>
</java>
</configuration>
</plugin> VsCode developer tools console logs
|
@agreedSkiing You can try the
and
|
@snjeza Doing a snapshot build of the up and coming release solves the "freezing" issue |
@snjeza Regarding your reference to https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Process.html: And as the documentation states, this "Sets the source and destination for subprocess standard I/O to be the same as those of the current Java process." With that said, the following statement does not hold IMHO:
Spotless redirects I/O of the npm process to that of the java process (maven). So it rather seems that merging our change in diffplug/spotless#1511 did not "fix a bug in spotless" but just covered an underlying problem in the way the maven process is triggered here? |
@simschla Java LS redirects System.out/in/err - See https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JavaLanguageServerPlugin.java#L487 |
@snjeza I'm sure the PR fixes the issue for you, but it just "covers" the underlying problem you must be having here. I've made a gist showcasing this: The process triggered using Nevertheless, I'm glad that my PR fixes your issue for now. |
The issue has been fixed in spotless 2.33.0 - https://github.com/diffplug/spotless/tags |
When the maven-spotless-plugin with prettier config is bound to an execution or not the plugin does not compile the code.
Same when just adding org.codehaus.mojo:exec-maven-plugin:3.1.0 that launches
Environment
Operating System: WSL
JDK version:
Visual Studio Code version:
My local install
Colleagues install
Java extension version:
Steps To Reproduce
Create maven quarkus project
Write some java code
Add spotless plugin with prettier configuration and bind to execution
Clean java language server pack and reload
Stuck at compiling and runetime errors in plugin
Sample project
Sample project reproducing the error
NOTE: The branch in the sample project needs nodejs and npm for the prettier spotless configuration
Logs
Developer Tools log
Full log file
Java Language Server's workspace logs
Current Result
Stuck att XX% out of a 100%
Expected Result
Build java code base
Additional Informations
This works fine with the 1.13.0 verison
Also tried to add
-Xlog:jni+resolve=off
to"java.jdt.ls.vmargs"
I can run the maven command (
mvn io.quarkus.platform:quarkus-maven-plugin:2.15.0.Final:generate-code-tests
) in the project directly from my maven installation, and everthing build fine withmvn clean test
andmvn clean package
.Also this happens when changing the spotless-maven-plugin to maven-exec-plugin with no configuration
The text was updated successfully, but these errors were encountered: