vscode-maven icon indicating copy to clipboard operation
vscode-maven copied to clipboard

Maven Projects does not list the plugins even after refresh

Open sekarbala123 opened this issue 4 years ago • 7 comments

Issue Type: Bug

  1. Open a existing maven pom.xml project
  2. once the java server started and every background activity is completed.
  3. Select the Maven Projects in the Explorer view.
  4. I am able to see the project. Then expanding it by clicking on > shows me plugins. However further clicking on the Plugins displays nothing.

Extension version: 0.21.1 VS Code version: Code 1.43.1 (fe22a9645b44368865c0ba92e2fb881ff1afce94, 2020-03-18T07:01:20.184Z) OS version: Windows_NT x64 10.0.18363

System Info
Item Value
CPUs Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz (4 x 2496)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 7.86GB (0.75GB free)
Process Argv
Screen Reader no
VM 0%

sekarbala123 avatar Mar 20 '20 07:03 sekarbala123

image

sekarbala123 avatar Mar 20 '20 07:03 sekarbala123

It's possible that effective pom was not succesfully calculated. You can open: Output -> Maven for Java , there will be detailed log where we can find clues.

Eskibear avatar Mar 20 '20 08:03 Eskibear

"local repository not specified in maven settings" after which Spawn {"command":" is there. I tried setting up path to settings.xml and that does not resolve the issue. No other information found on the output > Maven for Java

sekarbala123 avatar Mar 21 '20 06:03 sekarbala123

The “local repository” one is just a warning. Following the “spawn” one, there should be detailed output of the command, see if it’s successfully executed?

Eskibear avatar Mar 23 '20 01:03 Eskibear

I'm also having this issue.

This is my pom.xml
<?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>dev.simsek</groupId>
  <artifactId>demo</artifactId>
  <version>1.0-SNAPSHOT</version>

  <name>demo</name>

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

  <dependencies>
    <dependency>
      <artifactId>javaee-api</artifactId>
      <groupId>javax</groupId>
      <version>7.0</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.wildfly.plugins</groupId>
          <artifactId>wildfly-maven-plugin</artifactId>
          <version>2.1.0.Beta1</version>
          </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
This is the output of the extensions:
localRepository not specified in Maven Settings.
Spawn {"command":"mvn","args":["help:effective-pom","-Doutput=\"c:\\Users\\foo\\AppData\\Roaming\\Code\\User\\workspaceStorage\\4f8b31b3118d9c5498424702d4fc2a48\\vscjava.vscode-maven\\ac940065cf6815cf0306f5943e2bf7f4\"","-f","\"c:\\sources\\demo\\pom.xml\""]}
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------------< dev.simsek:demo >---------------------------
[INFO] Building demo 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-help-plugin:3.2.0:effective-pom (default-cli) @ demo ---
[INFO] Effective-POM written to: c:\Users\foo\AppData\Roaming\Code\User\workspaceStorage\4f8b31b3118d9c5498424702d4fc2a48\vscjava.vscode-maven\ac940065cf6815cf0306f5943e2bf7f4
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.532 s
[INFO] Finished at: 2020-04-21T18:43:05+02:00
[INFO] ------------------------------------------------------------------------
I expect that the wildfly plugin is shown in the panel, but it is not...

Plugin Version: 0.21.2 Java: Openjdk 13 VsCode: 1.44.2 Maven: 3.6.3

Update:

Just looked into the path c:\Users\foo\AppData\Roaming\Code\User\workspaceStorage\4f8b31b3118d9c5498424702d4fc2a48\vscjava.vscode-maven\ac940065cf6815cf0306f5943e2bf7f4. It's empty

cheers flash :zap:

flash-me avatar Apr 21 '20 16:04 flash-me

I was able to solve this "issue". I removed the "pluginmanagement" xml node and now it is able to list the wildfly plugin.

  <build>
    <plugins>
      <plugin>
        <groupId>org.wildfly.plugins</groupId>
        <artifactId>wildfly-maven-plugin</artifactId>
        <version>2.1.0.Beta1</version>
        </plugin>
    </plugins>
  </build>

cheers flash :zap:

flash-me avatar Apr 21 '20 17:04 flash-me

I had a similar problem

When calling maven, I need to use -gs settings/xml -s settings.xml as per our local standards. This works fine - except that the maven invocation to calculate the effective pom runs in the Maven bin directory, and not the top level folder of the project. Since there isn't a settings.xml file there, it fails.

I added a settings.xml to the bin directory, but that's a hack. This extension should run the Maven to calculate the POM in the same folder as it runs all other maven commands

phudson avatar Aug 08 '20 14:08 phudson

I was able to solve this "issue". I removed the "pluginmanagement" xml node and now it is able to list the wildfly plugin.

  <build>
    <plugins>
      <plugin>
        <groupId>org.wildfly.plugins</groupId>
        <artifactId>wildfly-maven-plugin</artifactId>
        <version>2.1.0.Beta1</version>
        </plugin>
    </plugins>
  </build>

cheers flash ⚡

It works! Thank you very much!

minskiter avatar Nov 05 '22 11:11 minskiter

  <build>
    <plugins>
      <plugin>
        <groupId>org.wildfly.plugins</groupId>
        <artifactId>wildfly-maven-plugin</artifactId>
        <version>2.1.0.Beta1</version>
        </plugin>
    </plugins>
  </build>

Can confirm that this works +1 . Thank you!

HammadB avatar Mar 29 '23 03:03 HammadB

I'm not able to reproduce the issue with pom.xml given in https://github.com/microsoft/vscode-maven/issues/480#issuecomment-617283035 , it simply lists all default plugins, which is expected.

As for https://github.com/microsoft/vscode-maven/issues/480#issuecomment-617296635 , yes, if you want to introduce a plugin, you should add it into plugins node directly under build instead of pluginManagement. pluginManagement is used to manage version of plugins.

I'm interested in the fact that many of you have the same case. How do you scaffold the project, is there a wrong wildfly template?

Eskibear avatar Mar 29 '23 03:03 Eskibear

In my case, the scaffold was created with

mvn -B archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4

From the maven getting started guide https://maven.apache.org/guides/getting-started/index.html.

I think this is just user error and the default maven docs being a bit confusing.

HammadB avatar Mar 29 '23 04:03 HammadB

Thanks for the info.

I'm closing this issue as no further logs provided by the original author.

Eskibear avatar Mar 29 '23 05:03 Eskibear