> With all due respect, this is horrible. It is not just a scripted build
I respectfully shared a pragmatic and to paraphrase myself "easily made
into a windows- specific powershell or cmd file" approach after having
written off shade and assembly plugins. whatever your personal views on
purity
As promised, some more feedback: Thomas is right, I was wrong. Maven
Shade does attach the DRP, I just did not use it because it is created
by default in the base directory, not in the build directory, which
causes extra hoops to jump through concerning Maven Clean and
.gitignore. The output
> I doubt that uberjars should be used as dependencies at all
I disagree. There are tons of valid usage scenarios. Look at AspectJ
runtime, AspectJ tools (compiler), AspectJ weaver, dozens of Java agents
which might contain relocated classes from ASM and/or Byte Buddy etc.
You want to use those,
With all due respect, this is horrible. It is not just a scripted build
and like Ant through the back door, but also shell- and
platform-specific (unless you happen to have Git Bash or so installe on
Windows).
Furthermore, it does not even relate to my question.
--
Alexander Kriegisch
For executable JARs I do this as well.
Sometimes for simpler projects, I'll add:
true
lib/
to the JAR plugin. I use the assembly plugin to place everything in its
proper place.
That way I can just ship a tar.gz or zip file with all of the bits.
Unzip / untar
I second this approach. It's much more simple, maintainble and you retain
the ability to monkeypatch production deployments. You can later chain it
into assembly plugin to produce an archive that contains your launch
scripts, dependencies, configurations, and perhaps even the JDK itself. If
youre
there's nothing that really painlessly replaced the first
maven fatjar since it became outmoded.
that said, i use dependency plugin to dump a lib/ dir even for reactor
builds, and then a shell script that uses that classpath syntax to load a
directory at a time.
this happens with maven exec
Last time I checked, Maven Shade did *not* attach the dependency-reduced
POM, but that was a while ago and the project I am contributing to uses
Maven Assembly. I am certainly going to try again later today or
tomorrow when I back at my desk and have access to my computer. I shall
report back
Those artifacts go to Maven Central in case of a release. Even for
snapshots I need to "fret over" them, because if another Maven project
depends on such an artifact, it gets unnecessary transitive
dependencies. You can trust that I am not raising a non-issue here, but
thanks for the comment.
--
Well, maven-shade-plugin does "attach" the dependency-reduced POM:
https://github.com/apache/maven-shade-plugin/blob/768092f38b0b1650217642cf10b7b0c381cbf707/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java#L1191
At least when you install or deployed, that POM gets
POM is only relevant if you're deploying that archive to a repository.
I wouldn't fret myself over it if you're not deploying the uberjars to
nexus.
On Sun, Apr 25, 2021 at 2:09 AM Alexander Kriegisch
wrote:
>
> I am sorry if I am asking a question the answer to which might be obious
> to
I am sorry if I am asking a question the answer to which might be obious
to others, but for a long time I have wondered why I do not find any
examples for the following use case which IMO is probably quite common:
** I build an uber JAR containing some module dependencies, possibly
also
12 matches
Mail list logo