I'm trying to automate my deploying system to my website, but I need to know the actual name of the artifact. I'm using Github Pages, so I don't have backend script possibilities to search for the file extensions, name string contains etc.
I'm about to create a Maven Plugin, and export the final artifact name during the build.
To achieve my solution, I have to access the placeholders during the build lifecycle. However, I couldn't find any resource about doing so.
How can I access Maven build lifecycle placeholders from a Maven Plugin?
You don't have to develop an own plugin to deploy a project to...wherever. You can use the Wagon Maven Plugin :
It allows you to upload resources from your build to a remote location using wagon.
See Maven Wagon for the supported transports.
Within its <configuration>
you can use <includes>**/${project.build.finalName}*</includes>
(default: ${artifactId}-${version}
) which is an element of the build
element . Be aware of:
The term "finalName" is kind of a misnomer, [...]. For example, if the
maven-jar-plugin
is configured to give a jar aclassifier
oftest
, then the actual jar defined above will be built asmy-project-1.0-test.jar
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.