Re: Problem with mvn site:run and javadocs

2021-06-28 Thread Mikhail Titov
Hello Hervé,

On Mon, Jun 28, 2021 at  1:51 PM, Hervé BOUTEMY  wrote:
> To me, looking at javadoc or jxr output during "mvn site:run" is not supposed 
> to work: "mvn site:run" is here to help write markup for the site, to quickly 
> see the output when you update markdown/apt/... source

It is fine by me if it never meant to work. However a note/warning for
newcomers would be greatly appreciated to avoid spending time trying to
figure it out. It just seems as if it should "just work".

> Why are you trying to use site:run to look at javadoc or jxr?

It is just a matter of convenience so I can see how this and that in
various reports look like and gets updated in one place. Also,
auto-update was working for checkstyle but not for spotbug plugin. At
least it did not cause an exception but just showed stale data. Also I
thought it looked more "java/maven way" rather than launching a single
liner for a simple python web server for site directory.

> Notice, whatever the answer is, implementing file by file rendering update as 
> required by site:run seems quite hard...
> If you want to look at javadoc or jxr, you're expected to run "mvn site" and 
> open your browser at target/site/index.html

Once again, this is fine by me... I guess I don't even have to run a
mini web server. However simply showing stale javadoc would be better
than cryptic exception.

-- 
Mikhail

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: change the location of pom File within maven extension

2021-06-28 Thread Falko Modler
Sorry, I totally missed that flatten bit in your message.

You can access all projects via the MavenSession that get's passed in to your 
extension.
See getProjects().

Cheers,
Falko

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Problem with mvn site:run and javadocs

2021-06-28 Thread Hervé BOUTEMY
Hi,

To me, looking at javadoc or jxr output during "mvn site:run" is not supposed 
to work: "mvn site:run" is here to help write markup for the site, to quickly 
see the output when you update markdown/apt/... source

Why are you trying to use site:run to look at javadoc or jxr?

Notice, whatever the answer is, implementing file by file rendering update as 
required by site:run seems quite hard...
If you want to look at javadoc or jxr, you're expected to run "mvn site" and 
open your browser at target/site/index.html

Regards,

Hervé

Le lundi 28 juin 2021, 20:19:24 CEST Mikhail Titov a écrit :
> Hello all!
> 
> I have the same issue as back from 2009[1]. I'm not sure if it ever
> worked or even supposed to. I thought something is off with my project
> (single pom). However, I see the same issue even if I use maven
> archetype to generate a new one.
> 
> I see that JIRA moved to https://issues.apache.org/jira/browse/MSITE-220
> but the issue was closed in a great purge of 2014. It seems to me that
> it is still an issue unless that is not how javadoc is supposed to be
> used. Please advise.
> 
> In particular, I tried Spring Boot WebSocket Sample. Then I added
> 
> ,[ project/build/plugins ]
> 
> | 
> | 
> |   org.apache.maven.plugins
> |   maven-site-plugin
> |   3.7.1
> | 
> | 
> | 
> | 
> |   org.apache.maven.plugins
> |   maven-project-info-reports-plugin
> |   3.1.1
> | 
> | 
> 
> `
> 
> ,[ project ]
> 
> | 
> | 
> |   
> | 
> | 
> | 
> |   org.apache.maven.plugins
> |   maven-javadoc-plugin
> |   3.3.0
> | 
> | 
> |   
> |   
> | 
> | 
> 
> `
> 
> Now, if I do mvn site:run and navigate to
> http://localhost:8080/apidocs/index.html , then I get
> 
> ,
> 
> | HTTP ERROR 500
> | 
> | Problem accessing /apidocs/index.html. Reason:
> | Error generating maven-javadoc-plugin:3.3.0:aggregate-no-fork report
> | 
> | Caused by:
> | org.apache.maven.doxia.siterenderer.RendererException: Error generating
> | maven-javadoc-plugin:3.3.0:aggregate-no-fork report| 
> | at
> | 
org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocume
> | nt(ReportDocumentRenderer.java:245) at
> | 
org.apache.maven.plugins.site.run.DoxiaFilter.doFilter(DoxiaFilter.java:
> | 144) at
> | 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHan
> | dler.java:1157) at
> | org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
388)
> | at
> | 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:2
> | 16) at
> | org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
182)
> | at
> | org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
765)
> | at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
440)
> | at
> | 
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.jav
> | a:114) at
> | org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
> | at org.mortbay.jetty.Server.handle(Server.java:326)
> | at
> | org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)
> | at
> | 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConne
> | ction.java:926) at
> | org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
> | at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
> | at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> | at
> | 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
> | 410) at
> | 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java
> | :582)| 
> | Caused by: org.apache.maven.reporting.MavenReportException:
> | Exit code: 1 -
> | C:\tmp\123\arid-spring\src\main\java\samples\websocket\client\SimpleClien
> | tWebSocketHandler.java:21: error: package org.apache.commons.logging does
> | not exist import org.apache.commons.logging.Log;
> | ...
> 
> `
> 
> 
> Footnotes:
> [1]  https://www.mail-archive.com/users@maven.apache.org/msg103216.html
> 
> --
> Mikhail
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: change the location of pom File within maven extension

2021-06-28 Thread torsten . liermann
Thanks, Falko. In my question I mentioned the flatten plugin with snippets of 
code. Can I access MavenProject in a Maven Extension? The flatten plugin uses 
this Injection @Parameter (defaultValue = "$ {project}", readonly = true, 
required = true)
 MavenProject project;

What would the equivalent in an extension be? Thanks!

On 2021/06/28 17:33:52, Falko Modler  wrote: 
> Hi,
> 
> I think flatten-maven-plugin is doing something like that, see: 
> https://github.com/mojohaus/flatten-maven-plugin/blob/4efae7e8d180e838ff25a1daffab712166911328/src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java#L224
> 
> Cheers,
> Falko
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 
> 

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: change the location of pom File within maven extension

2021-06-28 Thread Torsten Liermann
Thanks, Falko. In my question I mentioned the flatten plugin with snippets of 
code. Can I access MavenProject in a Maven Extension? The flatten plugin uses 
this Injection @Parameter (defaultValue = "$ {project}", readonly = true, 
required = true)
 MavenProject project;

What would the equivalent in an extension be? Thanks!


On Mon, 28 Jun 2021 17:33:52 + (UTC)
 Falko Modler  wrote:
>Hi,
>
>I think flatten-maven-plugin is doing something like that, see: 
>https://github.com/mojohaus/flatten-maven-plugin/blob/4efae7e8d180e838ff25a1daffab712166911328/src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java#L224
>
>Cheers,
>Falko
>
>-
>To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>For additional commands, e-mail: users-h...@maven.apache.org
>


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Problem with mvn site:run and javadocs

2021-06-28 Thread Mikhail Titov
Hello all!

I have the same issue as back from 2009[1]. I'm not sure if it ever
worked or even supposed to. I thought something is off with my project
(single pom). However, I see the same issue even if I use maven
archetype to generate a new one.

I see that JIRA moved to https://issues.apache.org/jira/browse/MSITE-220
but the issue was closed in a great purge of 2014. It seems to me that
it is still an issue unless that is not how javadoc is supposed to be
used. Please advise.

In particular, I tried Spring Boot WebSocket Sample. Then I added

,[ project/build/plugins ]
| 
|   org.apache.maven.plugins
|   maven-site-plugin
|   3.7.1
| 
| 
|   org.apache.maven.plugins
|   maven-project-info-reports-plugin
|   3.1.1
| 
`

,[ project ]
| 
|   
| 
|   org.apache.maven.plugins
|   maven-javadoc-plugin
|   3.3.0
| 
|   
| 
`

Now, if I do mvn site:run and navigate to
http://localhost:8080/apidocs/index.html , then I get

,
| HTTP ERROR 500
| Problem accessing /apidocs/index.html. Reason:
|
| Error generating maven-javadoc-plugin:3.3.0:aggregate-no-fork report
| Caused by:
| org.apache.maven.doxia.siterenderer.RendererException: Error generating 
maven-javadoc-plugin:3.3.0:aggregate-no-fork report
|   at 
org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:245)
|   at 
org.apache.maven.plugins.site.run.DoxiaFilter.doFilter(DoxiaFilter.java:144)
|   at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
|   at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
|   at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
|   at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
|   at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
|   at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
|   at 
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
|   at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
|   at org.mortbay.jetty.Server.handle(Server.java:326)
|   at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
|   at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)
|   at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
|   at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
|   at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
|   at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
|   at 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
| Caused by: org.apache.maven.reporting.MavenReportException:
| Exit code: 1 - 
C:\tmp\123\arid-spring\src\main\java\samples\websocket\client\SimpleClientWebSocketHandler.java:21:
 error: package org.apache.commons.logging does not exist
| import org.apache.commons.logging.Log;
| ...
`


Footnotes:
[1]  https://www.mail-archive.com/users@maven.apache.org/msg103216.html

--
Mikhail

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



change the location of pom File within maven extension

2021-06-28 Thread Falko Modler
Hi,

I think flatten-maven-plugin is doing something like that, see: 
https://github.com/mojohaus/flatten-maven-plugin/blob/4efae7e8d180e838ff25a1daffab712166911328/src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java#L224

Cheers,
Falko

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



change the location of pom File within maven extension

2021-06-28 Thread Torsten Liermann
Hi,

My English is poor, but I hope for help in this place.

I am trying to manipulate an org.apache.maven.model.Model via a maven extension 
and at the same time create a new POM file. But unfortunately the new location 
of the POM file does not apply. The plugins (e.g. maven-deploy-plugin) still 
work with the original file location.

// Part of Model Processor
@Override
  public Model read(InputStream input, Map options) throws 
IOException {
Model model = read(input, options);
// This has no effect:
model.setPomFile(new File(„new-pom.xml“);
return model;
}


This example here helped me a little:
https://github.com/jcgay/unique-revision-maven-filtering/blob/master/src/main/java/fr/jcgay/maven/extension/revision/UniqueRevisionFiltering.java

The maven-install-plugin uses the desired file location, but the 
maven-deploy-plugin uses the old file location.

At the plugin level, changing the POM file location works, as can be seen on 
the flatten-maven-plugin:

  this.project.setPomFile (flattenedPomFile);

But how does that work with a maven extension?

Thanks for a hint.

Regards,
Torsteen



Maven Surefire and JPMS with runtime dependencies

2021-06-28 Thread Christian Beikov

Hi,

I am in the process of modularizing one of my projects and hit some 
rather annoying limitations that I thought needed changes to my Maven 
build and dependencies due to the way the Java module system works, but 
it turned out that this is by design and there is a way out. Alan 
Bateman suggested that I should use --add-modules to add runtime scoped 
dependencies to my tests and it works like a charm: 
https://mail.openjdk.java.net/pipermail/jigsaw-dev/2021-June/014679.html


Now my question is, why does the maven-surefire-plugin not add this flag 
by default, with a possible option to disable the behavior?


Has this been considered/discussed before? I couldn't find anything on 
the internet yet. I am adding the necessary bits now through 
 to avoid having to use the compile scope and listing 
the modules in the module-info descriptor, but I would prefer if the 
surefire team would add support for this out of the box.


What do you think?

Regards,

Christian


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: [ANN] Maven Resolver 1.7.1 released

2021-06-28 Thread Michael Osipov

Am 2021-06-27 um 09:16 schrieb Mark Derricutt:

Interesting - updating to this version from 1.7.0 in my own plugin now
yields an NPE when creating a RepositorySystem - guess I know one thing I’m
working on this week :)


If you think this is a bug and you have a reproducer, please report it!

Thanks


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org