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

Dev mode does not show errors if upstream module already installed in .m2 #1201

Closed
ericglau opened this issue Jul 15, 2021 · 1 comment · Fixed by #1207
Closed

Dev mode does not show errors if upstream module already installed in .m2 #1201

ericglau opened this issue Jul 15, 2021 · 1 comment · Fixed by #1207

Comments

@ericglau
Copy link
Contributor

ericglau commented Jul 15, 2021

  1. Use this project: https://github.com/OpenLiberty/guide-maven-multimodules/tree/master/finish
  2. Run mvn install to install the project to ~/.m2
  3. Delete jar/src/main/java/io/openliberty/guides/multimodules/lib/Converter.java
  4. Run mvn clean io.openliberty.tools:liberty-maven-plugin:3.3.5-M3-SNAPSHOT:dev
  5. Dev mode should give an error at this point because the war module has Java code that depends on the deleted class in the jar module. However, dev mode has no error because the compilation dependency was found in ~/.m2. But when you go to http://localhost:9080/converter/ and enter a value and click Submit, it gets a NoClassDefFoundError at runtime:
...
Caused by: java.lang.NoClassDefFoundError: io.openliberty.guides.multimodules.lib.Converter

Consider using something like https://maven.apache.org/plugins/maven-dependency-plugin/purge-local-repository-mojo.html to remove each module from ~/.m2 before running its build lifecycle in dev mode, so that if a downstream module depends on it, it should fail. But do not purge ear projects (so that #1176 will still work.)

@scottkurz
Copy link
Member

The #1570 fix addresses this problem without adding/purging from the local .m2 repository.

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

Successfully merging a pull request may close this issue.

2 participants