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

Add plugin dir to developer jetty:run classpath for plugin dev #8033

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@
<webAppSourceDirectory>${project.build.directory}/classes/META-INF/webapp/</webAppSourceDirectory>
<webApp>
<contextPath>/client</contextPath>
<extraClasspath>${project.build.directory}/conf/;${project.build.directory}/common;${project.build.directory}/utilities/scripts/db/;${project.build.directory}/utilities/scripts/db/db/;${project.build.directory}/cloud-client-ui-${project.version}.jar</extraClasspath>
<extraClasspath>${project.build.directory}/conf/;${project.build.directory}/common;${project.build.directory}/utilities/scripts/db/;${project.build.directory}/utilities/scripts/db/db/;${project.build.directory}/plugins/*</extraClasspath>
<webInfIncludeJarPattern>.*/cloud.*jar$|.*/classes/.*</webInfIncludeJarPattern>
</webApp>
<systemProperties>
Expand Down Expand Up @@ -729,6 +729,7 @@
<exclude name="*.in" />
</fileset>
</copy>
<mkdir dir="${project.build.directory}/plugins" />
</target>
</configuration>
</execution>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<cs.jaxws.version>2.3.2-1</cs.jaxws.version>
<cs.jersey-client.version>2.26</cs.jersey-client.version>
<cs.jetty.version>9.4.51.v20230217</cs.jetty.version>
<cs.jetty-maven-plugin.version>9.4.27.v20200227</cs.jetty-maven-plugin.version>
<cs.jetty-maven-plugin.version>9.4.51.v20230217</cs.jetty-maven-plugin.version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 9.4.27 was a known/working version, I'm not sure if with more recent working the jetty-maven-plugin works @mlsorensen have you tested it locally (see most Github actions jobs are failing)

Copy link
Contributor Author

@mlsorensen mlsorensen Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It worked locally, and it's the version of jetty that is bundled with the production cloudstack, but perhaps it is incompatible with the testing/PR process in some way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the new versions of jetty may be more aggressive at scanning? I see more duplicate classes found, seems to be searching current directory as well as finding them in client/target/cloud-client-ui jar. Will try a few things...

Copy link
Contributor Author

@mlsorensen mlsorensen Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I think maybe I found the issue @rohityadavcloud. Newer jetty-maven-plugin versions add the pom dependencies to classpath automatically, with older jetty we have defined extraClasspath and add a built cloud-client-ui.jar location. This results in a lot of duplicate classes discovered. Also notice that due to using the pom dependencies for building classpath, without specifying -Psimulator the jetty:run doesn't have simulator available which breaks the simulator CI build.

We can add explicit simulator dependency for the jetty-maven-plugin, or we can add -Psimulator to the CI (but I don't know how to do the latter).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, I'm not confident that I know exactly what's going on here, but I think the same PR in jetty that I need for this feature is probably the same one that cloudstack's use of jetty:run is incompatible with. Or certainly the very next release after this.

May need to resolve the underlying reason why we can't upgrade to newer jetty-maven-plugin before we consider adding a plugin dir for devs.

<cs.jna.version>5.5.0</cs.jna.version>
<cs.joda-time.version>2.12.5</cs.joda-time.version>
<cs.jpa.version>2.2.1</cs.jpa.version>
Expand Down