Re: [massembly] code question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [massembly] code question

Romain Manni-Bucau
@Mark: likely studid but do you get the debug insight removing it on a
project without dependencies?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le jeu. 19 déc. 2019 à 14:39, Mark Struberg <[hidden email]> a
écrit :

> Hi!
>
> Feeling a bit rusty, so I thought I better ask for a 2nd opinion.
>
> To me it looks like the following code block is really obsolete and did
> not make anything useful ever since
>
>
> https://github.com/apache/maven-assembly-plugin/blob/master/src/main/java/org/apache/maven/plugins/assembly/archive/task/AddDependencySetsTask.java#L112
>
> > final List<Dependency> deps = project.getDependencies();
> > if ( ( deps == null ) || deps.isEmpty() )
> > {
> >     logger.debug( "Project " + project.getId() + " has no dependencies.
> Skipping dependency set addition." );
> > }
>
> 'deps' is never used. And it's just a logging.
> Plus all ITs plus a big custom project still fully pass if I remove the
> block.
>
> Any reason not to remove it?
>
> LieGrue,
> strub
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [massembly] code question

Mark Struberg-2
Well, the project dependencies may or may not be used depending on your assembly setup.
The only data which is used in this scenario is List<DependencySet> dependencySets;
So it might probably be fine to add a logging if the dependencySets is empty.

The only part where the project dependencies are really used is the RepositoryAssembler. And there is already a warning if it is empty:

https://github.com/apache/maven-assembly-plugin/blob/master/src/main/java/org/apache/maven/plugins/assembly/repository/DefaultRepositoryAssembler.java#L83


LieGrue,
strub


> Am 19.12.2019 um 15:59 schrieb Romain Manni-Bucau <[hidden email]>:
>
> @Mark: likely studid but do you get the debug insight removing it on a
> project without dependencies?
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <https://www.packtpub.com/application-development/java-ee-8-high-performance>
>
>
> Le jeu. 19 déc. 2019 à 14:39, Mark Struberg <[hidden email]> a
> écrit :
>
>> Hi!
>>
>> Feeling a bit rusty, so I thought I better ask for a 2nd opinion.
>>
>> To me it looks like the following code block is really obsolete and did
>> not make anything useful ever since
>>
>>
>> https://github.com/apache/maven-assembly-plugin/blob/master/src/main/java/org/apache/maven/plugins/assembly/archive/task/AddDependencySetsTask.java#L112
>>
>>> final List<Dependency> deps = project.getDependencies();
>>> if ( ( deps == null ) || deps.isEmpty() )
>>> {
>>>    logger.debug( "Project " + project.getId() + " has no dependencies.
>> Skipping dependency set addition." );
>>> }
>>
>> 'deps' is never used. And it's just a logging.
>> Plus all ITs plus a big custom project still fully pass if I remove the
>> block.
>>
>> Any reason not to remove it?
>>
>> LieGrue,
>> strub
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [massembly] code question

Romain Manni-Bucau
In reply to this post by Romain Manni-Bucau
If we can still log included deps are empty (agree it should be real deps
and not these ones) elsewhere +1 (think otherwise it looks something went
wrong in debug mode, no log does not mean empty if you follow me)

Le jeu. 19 déc. 2019 à 16:43, Anders Hammar <[hidden email]> a écrit :

> I agree. It's strange and the debug log output is actually
> technically wrong. So I'd say remove it.
>
> /Anders
>
> On Thu, Dec 19, 2019 at 2:39 PM Mark Struberg <[hidden email]>
> wrote:
>
> > Hi!
> >
> > Feeling a bit rusty, so I thought I better ask for a 2nd opinion.
> >
> > To me it looks like the following code block is really obsolete and did
> > not make anything useful ever since
> >
> >
> >
> https://github.com/apache/maven-assembly-plugin/blob/master/src/main/java/org/apache/maven/plugins/assembly/archive/task/AddDependencySetsTask.java#L112
> >
> > > final List<Dependency> deps = project.getDependencies();
> > > if ( ( deps == null ) || deps.isEmpty() )
> > > {
> > >     logger.debug( "Project " + project.getId() + " has no dependencies.
> > Skipping dependency set addition." );
> > > }
> >
> > 'deps' is never used. And it's just a logging.
> > Plus all ITs plus a big custom project still fully pass if I remove the
> > block.
> >
> > Any reason not to remove it?
> >
> > LieGrue,
> > strub
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>