-
Notifications
You must be signed in to change notification settings - Fork 453
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
Multi-module Maven project does not work #1248
Comments
I can't reproduce the issue. |
Attached the server log. |
@snjeza It looks like clearing the workspaceStorage fixed my issue. Does this deserve a close? |
@hashdelta yes, you can close the issue. |
@snjeza Revisiting this. What is the proper way to initialize a new maven sub module in VSCode? I am manually creating the POM and folder hierarchy, and VSCode does not recognize it unless I clear the workspaceStorage directory, which is a non-solution. |
Related to eclipse-jdtls/eclipse.jdt.ls#901 |
I have the same problem. What can I do to solve it is to reopen the root folder again after create a new sub module. Btw, I think the vscode should refresh the project automatically. |
Me too. Open multi-module project will have a lot of error |
Facing issue too with the microsoft/gctoolkit project (multi-module, and each has its own module-info.java). |
Hi, I am just facing same issue, kindof no idea how to make vs code recognize the project folder and all sub folders and files as a multi-module maven project, |
It appears this issue hasn't received prioritization needed for resolution. I'm working on a project that requires the building of such a repo with nested modules and there isn't a viable solution to develop with intellisense intact. Is there any plans to work in this issue in the near future? |
For me, source folders from submodules doesn´t appear after added a java project multi modules. |
I have all my code in a mono-repo. All my Java code is in modules in a sub-directory called java. Despite the mono-repo I've been using Eclipse for all my Java dev and VSCode for everything else. BUT I want to consolidate it all under VSCode but I just can't get the Java code to work right. There is a single parent BUT I can't figure out how to get VSCode to recognize the java and maven code if I open the full repo. Does this just not work? |
@crowmagnumb Could you show this pom.xml? |
@snjeza Here is my parent pom.xml <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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.animalus</groupId>
<artifactId>auroot-parent</artifactId>
<version>2.0.0</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Skipping javadoc by default. If you want to run the javadoc run...
mvn -Dmaven.javadoc.skip=false javadoc:javadoc -->
<maven.javadoc.skip>true</maven.javadoc.skip>
<flyway.version>9.21.1</flyway.version>
<jackson.version>2.15.2</jackson.version>
<!-- <shiro.version>1.12.0</shiro.version> -->
<shiro.version>2.0.0-alpha-3</shiro.version>
<junit.version>5.10.0</junit.version>
<!-- upgrade these together depending on which version of springframework
is used by the version of springboot or else you may get duplicate
libraries in the final packaged jar. Annoyingly springsession is
on a different schedule, so just bump to its latest I guess -->
<!-- <springcore.version>5.3.21</springcore.version> -->
<springboot.version>3.1.2</springboot.version>
<springsession.version>3.1.1</springsession.version>
</properties>
<modules>
<module>auroot-core</module>
<module>auroot-http</module>
<module>autravel</module>
<module>autravel-http</module>
<module>critterspot-core</module>
<module>critterspot-admin</module>
<module>critterspot-http</module>
<module>critterspot-server</module>
<module>crowdb</module>
<module>crowjson</module>
<module>crowlang</module>
<module>auhttp</module>
<module>auzooniverse</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<configuration> <reportOutputDirectory>${project.basedir}/target/${project.artifactId}-${project.version}</reportOutputDirectory>
<destDir>javadoc</destDir>
<show>private</show>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>javadoc</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<release>17</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<argLine>--illegal-access=permit</argLine>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>${flyway.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<argLine>--illegal-access=permit</argLine>
</configuration>
</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>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.16.0</version>
<configuration>
<generateBackupPoms>false</generateBackupPoms>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.2.5</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
</plugins>
</build>
</project> Note: The Java/Maven plugins recognize this as a java project (it shows up in the java projects list) BUT the sub-projects (modules) and their poms are not recognized. |
Could you show your workspace and user settings.json and your logs - Enable Logging? |
@snjeza Thank you! I didn't know how to set the logs to debug nor read them. Through the logs I found out that all of my |
I created a multi-module Maven project and tried to open the root folder in Visual Studio Code. When I try to work with any of the sub-modules, I do not get any linting, formatting, refactoring, etc... I tried
Add Folder to Java Source Path
but that does not work either. I have no issues working with this project in other IDE's, including Eclipse.Environment
Steps To Reproduce
git clone https://github.com/hashdelta/stix-pattern-evaluator-examples.git cd stix-pattern-evaluator-examples git checkout develop
Current Result
The plugin does not recognize the children modules, thus does not provide any kind of Java semantics support - no linting, formatting, refactoring, etc...
Expected Result
You should be able to get semantics support for any Java class when you open the parent. It should be one cohesive project.
Additional Informations
The only way to work with the sub modules is by opening the module in its own VSCode instance. This does not work for me, as one of my projects consists of over 20+ modules.
I have verified in Eclipse, NetBeans, and IntelliJ that the GitHub project has no issues.
The text was updated successfully, but these errors were encountered: