Re: Remove Artifact Commons-Lang Dependency?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Remove Artifact Commons-Lang Dependency?

Nick_S
I think he is talking about Maven Artifact [1], which has a dependency on
commons-lang [2].

[1] http://maven.apache.org/ref/3.6.2/maven-artifact/
[2] http://maven.apache.org/ref/3.6.2/maven-artifact/dependencies.html

Nick Stolwijk

~~~ Try to leave this world a little better than you found it and, when
your turn comes to die, you can die happy in feeling that at any rate you
have not wasted your time but have done your best ~~~

Lord Baden-Powell


On Mon, Nov 25, 2019 at 7:01 PM Karl Heinz Marbaise <[hidden email]>
wrote:

> Hi Mark,
>
> can you tell us on which part of Maven you are referencing? Or do you
> reference your own project?
>
> Maven Core ? a particular plugin ?
>
> Kind regards
> Karl Heinz Marbaise
>
> On 25.11.19 03:08, Mark James wrote:
> > Hello,
> >
> > Is there any chance of removing the dependency of Artifact on
> Commons-Lang?
> > Something nine times bigger is pulled in just to reference the String
> utility
> > functions isNotEmpty, notBlank, and isNumeric.
> >
> > I understand the advantages of libraries, but this comes at more of a
> cost in
> > Java because common Java libraries are less likely to be on the system
> than
> > native libraries, and so must be either specified as a dependency (that
> must be
> > downloaded and added to build and class paths), distributed with the
> using JAR
> > (requiring an installation expansion), or embedded into using JARs
> (defeating
> > the space-saving advantage). Semi-automated dependency resolution
> probably makes
> > this easier, but many such as myself aren't familiar with it.
> >
> > I'd like to be able to distribute my package as a single JAR, with
> Artifact but
> > not Commons-Lang embedded. But this currently needs the following
> changes:
> >
> > 1. Replacing StringUtils.isNotEmpty in DefaultArtifact with a not-null +
> > positive-length test.
> >
> > 2. In ArtifactUtils.notBlank, replacing
> >
> >          Validate.notBlank( str, message );
> >
> >      with
> >
> >          for (int i=0; i < str.length(); i++) if
> >          (!Character.isWhitespace(str.charAt(i))) return;
> >          throw new IllegalArgumentException(message);
> >
> >      or, using Java 8 code,
> >
> >          if (str.chars().allMatch(Character::isWhitespace)) throw new
> >          IllegalArgumentException(message);
> >
> > and 3. Copying StringUtils.isNumeric as DefaultArtifact.isDigits.
> >
> > It would be nice if Java had a directive to do such copies at build-time,
> > removing run-time dependencies while preventing code duplication.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>