maven enforcer ensure javadoc attached

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

maven enforcer ensure javadoc attached

Jon Harper
Hi list,

I would like to use maven-enforcer-plugin to ensure that javadocs are
attached in release mode before installing. That's because I use
$ mvn package javadoc:aggregate-jar deploy
to build, so if someone forgets to call the aggregate-jar goal, the
release will be missing the javadoc.

I don't see any rule to enforce this (the closest I found is
https://github.com/elastic/attached-artifact-enforcer which does the
opposite, ensure that something is not attached).

Is it possible to do what I want using the standard rules ? If not,
would you consider to add new rules for this ?

Thanks,
Jon

Note: I need to use javadoc:aggregate-jar on the command line and not
part of the lifecycle because:
- I want the aggregated javadoc to be attached to the root pom
artifact, not some child "distribution"-like artifact
- I want the aggregated javadoc to be created after the submodules
have been built.

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

Reply | Threaded
Open this post in threaded view
|

Re: maven enforcer ensure javadoc attached

Benjamin Marwell
Hi Jon,

I think you could use the verifier-plugin for checking file existence.

https://maven.apache.org/plugins/maven-verifier-plugin/verify-mojo.html

Am So., 2. Feb. 2020 um 17:55 Uhr schrieb Jon Harper <[hidden email]>:

>
> Hi list,
>
> I would like to use maven-enforcer-plugin to ensure that javadocs are
> attached in release mode before installing. That's because I use
> $ mvn package javadoc:aggregate-jar deploy
> to build, so if someone forgets to call the aggregate-jar goal, the
> release will be missing the javadoc.
>
> I don't see any rule to enforce this (the closest I found is
> https://github.com/elastic/attached-artifact-enforcer which does the
> opposite, ensure that something is not attached).
>
> Is it possible to do what I want using the standard rules ? If not,
> would you consider to add new rules for this ?
>
> Thanks,
> Jon
>
> Note: I need to use javadoc:aggregate-jar on the command line and not
> part of the lifecycle because:
> - I want the aggregated javadoc to be attached to the root pom
> artifact, not some child "distribution"-like artifact
> - I want the aggregated javadoc to be created after the submodules
> have been built.
>
> ---------------------------------------------------------------------
> 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: maven enforcer ensure javadoc attached

Jon Harper
Hi Benjamin,
thank you for your answer. But I don't see any option to check that
the artifact are attached in the verify plugin.
The problem is that the files can be present in the target folder but
not attached if you have not run the goal in the same maven invocation
as the one doing "install".
I haven't tested, but maybe the solution is to always run the
build-helper:attach-artifact goal which can be bound the the lifecycle
so it can't be omitted during the release. It would do what I want if
it fails when the files are not present.

Thanks
Jon

On Mon, Feb 3, 2020 at 8:35 AM Benjamin Marwell <[hidden email]> wrote:

>
> Hi Jon,
>
> I think you could use the verifier-plugin for checking file existence.
>
> https://maven.apache.org/plugins/maven-verifier-plugin/verify-mojo.html
>
> Am So., 2. Feb. 2020 um 17:55 Uhr schrieb Jon Harper <[hidden email]>:
> >
> > Hi list,
> >
> > I would like to use maven-enforcer-plugin to ensure that javadocs are
> > attached in release mode before installing. That's because I use
> > $ mvn package javadoc:aggregate-jar deploy
> > to build, so if someone forgets to call the aggregate-jar goal, the
> > release will be missing the javadoc.
> >
> > I don't see any rule to enforce this (the closest I found is
> > https://github.com/elastic/attached-artifact-enforcer which does the
> > opposite, ensure that something is not attached).
> >
> > Is it possible to do what I want using the standard rules ? If not,
> > would you consider to add new rules for this ?
> >
> > Thanks,
> > Jon
> >
> > Note: I need to use javadoc:aggregate-jar on the command line and not
> > part of the lifecycle because:
> > - I want the aggregated javadoc to be attached to the root pom
> > artifact, not some child "distribution"-like artifact
> > - I want the aggregated javadoc to be created after the submodules
> > have been built.
> >
> > ---------------------------------------------------------------------
> > 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]
>

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