Crashes while running "Maven In Five Minutes"

2018-12-03 Thread Steve Ramage
If I follow the steps listed here 
(https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html) : 



mkdir scratch; pushd scratch; mvn archetype:generate 
-DgroupId=com.mycompany.app -DartifactId=my-app 
-DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false; cd 
my-app; mvn package; mvn clean dependency:copy-dependencies package; mvn site



I get several crashes. The first of which is:



[INFO] - 
[ERROR] COMPILATION ERROR :  
[INFO] - 
[ERROR] Source option 5 is no longer supported. Use 6 or later. 
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.
 

Even if I fix that error I get another error later.



[INFO] --< com.mycompany.app:my-app >-- 
[INFO] Building my-app 1.0-SNAPSHOT 
[INFO] [ jar ]- 
[INFO]  
[INFO] --- maven-site-plugin:3.3:site (default-site) @ my-app --- 
[WARNING] Report plugin 
org.apache.maven.plugins:maven-project-info-reports-plugin has an empty 
version. 
[WARNING]  
[WARNING] It is highly recommended to fix these problems because they threaten 
the stability of your build. 
[WARNING]  
[WARNING] For this reason, future Maven versions might no longer support 
building such malformed projects. 
[INFO] configuring report plugin 
org.apache.maven.plugins:maven-project-info-reports-plugin:3.0.0 
[WARNING] Error injecting: 
org.apache.maven.report.projectinfo.CiManagementReport 
java.lang.NoClassDefFoundError: 
org/apache/maven/doxia/siterenderer/DocumentContent 
    at java.lang.Class.getDeclaredConstructors0 (Native Method) 
    at java.lang.Class.privateGetDeclaredConstructors (Class.java:3138) 
    at java.lang.Class.getDeclaredConstructors (Class.java:2358) 
    at com.google.inject.spi.InjectionPoint.forConstructorOf 
(InjectionPoint.java:245) 
...
    at 
org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo 
(DefaultMavenPluginManager.java:520) 
    at 
org.apache.maven.reporting.exec.DefaultMavenReportExecutor.getConfiguredMavenReport
 (DefaultMavenReportExecutor.java:306) 
    at 
org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildReportPlugin 
(DefaultMavenReportExecutor.java:263) 
    at 
org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildMavenReports 
(DefaultMavenReportExecutor.java:154) 
    at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.getReports 
(AbstractSiteRenderingMojo.java:235) 
    at org.apache.maven.plugins.site.SiteMojo.execute (SiteMojo.java:121) 
...
    at org.codehaus.plexus.classworlds.launcher.Launcher.main 
(Launcher.java:356) 
Caused by: java.lang.ClassNotFoundException: 
org.apache.maven.doxia.siterenderer.DocumentContent 
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass 
(SelfFirstStrategy.java:50) 
...
 



$mvn --version

Apache Maven 3.6.0 (NON-CANONICAL_2018-11-06T03:14:22+01:00_root; 
2018-11-05T18:14:22-08:00)
Maven home: /opt/maven
Java version: 11.0.1, vendor: Oracle Corporation, runtime: 
/usr/lib/jvm/java-11-openjdk
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.14.84-1-lts", arch: "amd64", family: "unix"

Anyway I think the generated archetype should actually work with the maven 
version I'm using (especially because the advice on getting help is to run the 
latest), or failing that the Getting Started Guide should include the 
descriptions on how to fix them, imho.

Cheers,

Steve Ramage


Re: How to rewrite POMs retaining the XML structure

2018-12-03 Thread Robert Scholte
On Mon, 03 Dec 2018 11:47:58 +0100, Marc Rohlfs  
 wrote:



Hi all,

many thanks for Your suggestions. I already check the different plugin
implementations (except tidy-maven-plugin) before writing my post -  
should

have probably mentioned them in my post, I'm sorry. Unfortunately none of
them really seems to help me with what I like/need to achieve, expect of
the JDom parser approach that was implemented by Robert Scholte for the
maven-release-plugin version 3.0 - which hasn't been continued nor
released for 2 1/2 years now.

@Robert: I'd really like to pick up Your approach. Looks very useful to  
me,

not only for the maven-release-plugin. If You don't mind, I'd invest a
little time to transfer it to a new library and extend it for my use  
cases.


That would be great. I guess I was working on it before I had to switch to  
JPMS/Project Jigsaw support.
Since then focus was on keeping all our ~100 subprojects running on more  
Java versions.
The maven-release-plugin is not dead. There are more things that should be  
improved for 3.0.0, but based on business value I need to focus on other  
topics. Will definitely work on it again in the future!


Robert



@Anton: DecentXML is an interesting library, too. I'll surely remember  
this

one.

@Matthieu: Besides some other use cases, we basically need this for a
migration of a very huge/complex project setup into a new project layout.
For this, (re)calculate our projects (including dependencies, properties
etc) and we need to continuously transfer changes between old and new
project layout for a transition period.

Best regards
Marc


On Thu, 29 Nov 2018 at 17:11, Marc Rohlfs   
wrote:



Hi all,

is there a way to rewrite pom.xml files without loosing formatting,
ordering and comments?

We need to (programmatically) do several changes on Maven POMs, e.g.
adding and removing dependencies and properties. Currently we're using
the MavenXpp3Reader and MavenXpp3Writer classes to read and write the
pom.xml files, but in the output files, all comments are removed, the  
XML

nodes are reordered and formatting (indentations, empty lines) is lost.
Does anybody know a way how to read and write POM files without loosing
formatting ordering and comments?

Best regards
Marc


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



Re: How to rewrite POMs retaining the XML structure

2018-12-03 Thread Marc Rohlfs
Hi all,

many thanks for Your suggestions. I already check the different plugin
implementations (except tidy-maven-plugin) before writing my post - should
have probably mentioned them in my post, I'm sorry. Unfortunately none of
them really seems to help me with what I like/need to achieve, expect of
the JDom parser approach that was implemented by Robert Scholte for the
maven-release-plugin version 3.0 - which hasn't been continued nor
released for 2 1/2 years now.

@Robert: I'd really like to pick up Your approach. Looks very useful to me,
not only for the maven-release-plugin. If You don't mind, I'd invest a
little time to transfer it to a new library and extend it for my use cases.

@Anton: DecentXML is an interesting library, too. I'll surely remember this
one.

@Matthieu: Besides some other use cases, we basically need this for a
migration of a very huge/complex project setup into a new project layout.
For this, (re)calculate our projects (including dependencies, properties
etc) and we need to continuously transfer changes between old and new
project layout for a transition period.

Best regards
Marc


On Thu, 29 Nov 2018 at 17:11, Marc Rohlfs  wrote:

> Hi all,
>
> is there a way to rewrite pom.xml files without loosing formatting,
> ordering and comments?
>
> We need to (programmatically) do several changes on Maven POMs, e.g.
> adding and removing dependencies and properties. Currently we're using
> the MavenXpp3Reader and MavenXpp3Writer classes to read and write the
> pom.xml files, but in the output files, all comments are removed, the XML
> nodes are reordered and formatting (indentations, empty lines) is lost.
> Does anybody know a way how to read and write POM files without loosing
> formatting ordering and comments?
>
> Best regards
> Marc
>