-
Notifications
You must be signed in to change notification settings - Fork 155
Dev profile to update modules without building the whole GlassFish distribution #24985
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
Conversation
Shouldn't it be already possible just with
It is quite standard without additional custom magic which we want to avoid in the future. |
No. With -amd, maven will also build tests and everything that somehow depends on the module, not just GlassFish distribution. I tried it and the build fails on a missing dependency, because some test module dependency isn't built with this command. Even if it's fixed, this command takes 2 minutes on my computer. With this new
The fastest I can get with a standard maven build is in 2 steps with:
It still takes around 1 minutes and 20 seconds compared to 10 seconds with the |
I tried to do what I want even without changes in this PR. It's possible but if the path to the file in the GlassFish distirbution is different than usual, it's necessary to provide it manually. What I did is:
If the path is not standard, then I would create a different profile in settings.xml or specify the property on command line. The benefit of having the configuration in sources is that no separate configuration in settings.xml is needed, and paths for each module are already defined in the repository. |
Update console-core module in GlassFish distribution after build Signed-off-by:Ondro Mihalyi <[email protected]>
Update more modules in GlassFish distribution after build Signed-off-by:Ondro Mihalyi <[email protected]>
Remove findbugs that was removed in the master meanwhile
Move execution to the install phase, mainly becuase some modules (e.g. microprofile-config) run plugins (bundle plugin) to modify the JAR file in package phase. The copy-file goal was being executed before those plugins, and thus copied the file before it was finalized.
25e702e
to
1deaf2d
Compare
I released the 4.1.0 version of glassfish-build-maven-plugin that provides the copy-file goal. I added configurations for a few more modules that I worked on in the past and used this dev mode on them locally. Please review, and if OK, we can merge. The intention is to raise other PRs later to add support for more modules as we work on them. |
This will allow to build a single module and quickly update the GlassFish distribution in
appserver/distributions/glassfish/target/stage/glassfish7/glassfish
so that GlassFish can be started quickly with the code changes applied.To apply changes in a specific module that suppots the
dev
profile:mvn -Pdev install
appserver/distributions/glassfish/target/stage/glassfish7/glassfish
GlassFish distribution module must be first built by building the GlassFish project as usual.
To add support for the
dev
profile in other modules:copy.modules.to.distribution.skip
property tofalse
(if the module is 3 nested directories below root, i.e. the root directory is at../../..
)copy.modules.to.distribution.path.to.root
property to the root directory (e.g.copy.modules.to.distribution.path.to.root=../../../..
). An example is in thenucleus/admin/rest/rest-service/pom.xml
file.modules/${project.build.finalName}.jar
, then setcopy.modules.to.distribution.destFile
to point to the destination file, e.g.copy.modules.to.distribution.destFile=${basedir}/../../..//${glassfish.distribution.dir}/lib/somefileinlib.jar
. You can use the${glassfish.distribution.dir}
property which points to theglassfish7/glassfish
folder relative to the project root. An example is in theappserver/admingui/core/pom.xml
fileNote: This depends on the new 4.1.0 version of the
glassfish-build-maven-plugin
with this: eclipse-ee4j/glassfish-build-maven-plugin#204.