Aw: Re: How is the best way to get an effective POM outside of a Maven Plugin?

2017-08-09 Thread sparsick
Hi Karl Heinz,

unfortunately, I need the full resolved pom.

Best regards,

Sandra Parsick

> Gesendet: Mittwoch, 09. August 2017 um 19:24 Uhr
> Von: "Karl Heinz Marbaise" 
> An: "Maven Users List" , spars...@web.de
> Betreff: Re: How is the best way to get an effective POM outside of a Maven 
> Plugin?
>
> Hi Sandra,
> 
> first question: Do you need the full resolved pom (effective pom) or 
> would it be enough just to simply to parse the pom file which can simply 
> being done using MavenXpp3Reader this would deliver the XML as a Maven 
> Model class which can simply being used to extract information from the 
> maven model...
> 
> Kind regards
> Karl Heinz Marbaise
> 
> On 09/08/17 13:00, spars...@web.de wrote:
> > Hello,
> > 
> > currently, I'm working on a small tool, that needs some information of a 
> > POM and its parent POM. I didn't want to parse them with a XML reader, so I 
> > found that the DefaultModelBuilder can build a complete effective POM for 
> > me. Based on a stackoverflow answer 
> > (https://stackoverflow.com/questions/27383357/how-do-i-instantiate-mavenresolver-for-modelbuilder-usage)
> >   I build following example:
> > 
> > DefaultModelBuilderFactory factory = new DefaultModelBuilderFactory();
> >   final DefaultModelBuilder defaultModelBuilder = factory.newInstance();
> >   ModelBuildingRequest buildRequest = new DefaultModelBuildingRequest();
> >   buildRequest.setPomFile(Paths.get("/path/to/a/pom.xml").toFile())
> >   .setProcessPlugins(false)
> >   
> > .setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL);
> >   final ModelBuildingResult modelBuildingResult = 
> > defaultModelBuilder.build(buildRequest);
> > 
> >   
> > It works fine for simple POM (simple means a POM without a parent 
> > reference). But if I set a POM with a parent reference in 
> > buildRequest.setPomFile, I get following exception:
> > 
> > Exception in thread "main" java.lang.IllegalArgumentException: no model 
> > resolver provided, cannot resolve parent POM groupId:artifactId:1 for POM 
> > groupId:artifactId:version (/path/to/a/pom.xml)
> >   at 
> > org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:890)
> >   at 
> > org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:750)
> >   at 
> > org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:309)
> >   at 
> > com.github.sparsick.maven.effecitve.pom.maven.model.builder.ApacheMavenModelBuilder.main(ApacheMavenModelBuilder.java:17)
> > 
> > Another example on Stackoverflow 
> > (https://stackoverflow.com/questions/4838591/is-there-a-library-for-reading-maven2-3-pom-xml-files)
> >  mentions to use RepositoryModelResolver from Apache Archiva as an 
> > implementation ModelResolver. But I don't want to introduce a dependency to 
> > Apache Archiva in my tool.
> > 
> > So my questions are, is the usage of DefaultModelBuilder the best way to 
> > get an effective POM of my project outside of a Maven Plugin? If so which 
> > implementation I should use for the ModelResolver? If not what is the best 
> > way to get the effective POM outside of a Maven Plugin.
> > 
> > Thank you and best regards,
> > 
> > Sandra Parsick
> > 
> > -
> > 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: apache-maven-3.3.9 silently doesn't compile with jdk7 (it does with jdk8)

2017-08-09 Thread Karl Heinz Marbaise

Hi,


On 10/08/17 02:10, Guang Chao wrote:

On Tue, Aug 8, 2017 at 10:38 PM, bamboomy  wrote:


Hey All,

this is my first message on the list :)

I was wondering...

When I compile with jdk8 (or eclipse that runs under jdk8) my (java 7) code
compiles just fine, however it silently doesn't with jdk7 as jdk...



Is it OpenJDK?  Which build?




[INFO] Changes detected - recompiling the module!
[INFO] Compiling 37 source files to
C:\Project\wss\maven\Sysper2\Reporting_maven\target\classes

(but the target/classes/ folder is just empty)



It looks weird, but intuition tells me it is not maven problem but config
issue in your box.



We haved dived into that more and it is not a config issue...I can 
reproduce the problem...(We have not yet the root cause)...


But you can see the description here:

https://issues.apache.org/jira/browse/MCOMPILER-302

Kind regards
Karl Heinz Marbaise

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



Re: apache-maven-3.3.9 silently doesn't compile with jdk7 (it does with jdk8)

2017-08-09 Thread Bernd Eckenfels
Hello,

>> [INFO] Changes detected - recompiling the module!
>> [INFO] Compiling 37 source files to
>> C:\Project\wss\maven\Sysper2\Reporting_maven\target\classes
>>
>> (but the target/classes/ folder is just empty)
>
> I t looks weird, but intuition tells me it is not maven problem but config 
> issue in your box.

Yes however the compiler-plugin (or the tools API) may fail to detect failed 
forks/exec, which would also be a thing for Maven to improve.

Gruss
Bernd


Re: apache-maven-3.3.9 silently doesn't compile with jdk7 (it does with jdk8)

2017-08-09 Thread Guang Chao
On Tue, Aug 8, 2017 at 10:38 PM, bamboomy  wrote:

> Hey All,
>
> this is my first message on the list :)
>
> I was wondering...
>
> When I compile with jdk8 (or eclipse that runs under jdk8) my (java 7) code
> compiles just fine, however it silently doesn't with jdk7 as jdk...
>

Is it OpenJDK?  Which build?


>
> [INFO] Changes detected - recompiling the module!
> [INFO] Compiling 37 source files to
> C:\Project\wss\maven\Sysper2\Reporting_maven\target\classes
>
> (but the target/classes/ folder is just empty)
>

It looks weird, but intuition tells me it is not maven problem but config
issue in your box.


>
> with jdk8:
>
> [INFO] Changes detected - recompiling the module!
> [INFO] Compiling 37 source files to
> C:\Project\wss\maven\Sysper2\Reporting_maven\target\classes
> [INFO]
> /C:/Project/wss/maven/Sysper2/Reporting_maven/src/main/java/
> eu/cec/admin/sysper2/document/model/Document.java:
> C:\Project\wss\maven\Sysper2\Reporting_maven\src\main\java\
> eu\cec\admin\sysper2\document\model\Document.java
> uses or overrides a deprecated API.
> [INFO]
> /C:/Project/wss/maven/Sysper2/Reporting_maven/src/main/java/
> eu/cec/admin/sysper2/document/model/Document.java:
> Recompile with -Xlint:deprecation for details.
> [INFO]
> /C:/Project/wss/maven/Sysper2/Reporting_maven/src/main/java/
> eu/cec/admin/sysper2/report/web/BirtConfiguration.java:
> Some input files use unchecked or unsafe operations.
> [INFO]
> /C:/Project/wss/maven/Sysper2/Reporting_maven/src/main/java/
> eu/cec/admin/sysper2/report/web/BirtConfiguration.java:
> Recompile with -Xlint:unchecked for details.
>
> and a well filled target/classes/ folder...
>
> Is this normal or should I file a bug?
>
> Br,
>
> S.
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.
> com/apache-maven-3-3-9-silently-doesn-t-compile-with-
> jdk7-it-does-with-jdk8-tp5912087.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>



-- 
Guang 


Re: apache-maven-3.3.9 silently doesn't compile with jdk7 (it does with jdk8)

2017-08-09 Thread Karl Heinz Marbaise

Hi,

can you give a full working example of that...

cause it sounds like there is something wrong with your configuration...

What does: "mvn --version" says?

Are you trying to run in console or running from inside of Eclipse?

Kind regards
Karl Heinz Marbaise

On 08/08/17 16:38, bamboomy wrote:

Hey All,

this is my first message on the list :)

I was wondering...

When I compile with jdk8 (or eclipse that runs under jdk8) my (java 7) code
compiles just fine, however it silently doesn't with jdk7 as jdk...

[INFO] Changes detected - recompiling the module!
[INFO] Compiling 37 source files to
C:\Project\wss\maven\Sysper2\Reporting_maven\target\classes

(but the target/classes/ folder is just empty)

with jdk8:

[INFO] Changes detected - recompiling the module!
[INFO] Compiling 37 source files to
C:\Project\wss\maven\Sysper2\Reporting_maven\target\classes
[INFO]
/C:/Project/wss/maven/Sysper2/Reporting_maven/src/main/java/eu/cec/admin/sysper2/document/model/Document.java:
C:\Project\wss\maven\Sysper2\Reporting_maven\src\main\java\eu\cec\admin\sysper2\document\model\Document.java
uses or overrides a deprecated API.
[INFO]
/C:/Project/wss/maven/Sysper2/Reporting_maven/src/main/java/eu/cec/admin/sysper2/document/model/Document.java:
Recompile with -Xlint:deprecation for details.
[INFO]
/C:/Project/wss/maven/Sysper2/Reporting_maven/src/main/java/eu/cec/admin/sysper2/report/web/BirtConfiguration.java:
Some input files use unchecked or unsafe operations.
[INFO]
/C:/Project/wss/maven/Sysper2/Reporting_maven/src/main/java/eu/cec/admin/sysper2/report/web/BirtConfiguration.java:
Recompile with -Xlint:unchecked for details.

and a well filled target/classes/ folder...

Is this normal or should I file a bug?

Br,

S.



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



Re: How is the best way to get an effective POM outside of a Maven Plugin?

2017-08-09 Thread Karl Heinz Marbaise

Hi Sandra,

first question: Do you need the full resolved pom (effective pom) or 
would it be enough just to simply to parse the pom file which can simply 
being done using MavenXpp3Reader this would deliver the XML as a Maven 
Model class which can simply being used to extract information from the 
maven model...


Kind regards
Karl Heinz Marbaise

On 09/08/17 13:00, spars...@web.de wrote:

Hello,

currently, I'm working on a small tool, that needs some information of a POM 
and its parent POM. I didn't want to parse them with a XML reader, so I found 
that the DefaultModelBuilder can build a complete effective POM for me. Based 
on a stackoverflow answer 
(https://stackoverflow.com/questions/27383357/how-do-i-instantiate-mavenresolver-for-modelbuilder-usage)
  I build following example:

DefaultModelBuilderFactory factory = new DefaultModelBuilderFactory();
  final DefaultModelBuilder defaultModelBuilder = factory.newInstance();
  ModelBuildingRequest buildRequest = new DefaultModelBuildingRequest();
  buildRequest.setPomFile(Paths.get("/path/to/a/pom.xml").toFile())
  .setProcessPlugins(false)
  .setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL);
  final ModelBuildingResult modelBuildingResult = 
defaultModelBuilder.build(buildRequest);

  
It works fine for simple POM (simple means a POM without a parent reference). But if I set a POM with a parent reference in buildRequest.setPomFile, I get following exception:


Exception in thread "main" java.lang.IllegalArgumentException: no model 
resolver provided, cannot resolve parent POM groupId:artifactId:1 for POM 
groupId:artifactId:version (/path/to/a/pom.xml)
  at 
org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:890)
  at 
org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:750)
  at 
org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:309)
  at 
com.github.sparsick.maven.effecitve.pom.maven.model.builder.ApacheMavenModelBuilder.main(ApacheMavenModelBuilder.java:17)

Another example on Stackoverflow 
(https://stackoverflow.com/questions/4838591/is-there-a-library-for-reading-maven2-3-pom-xml-files)
 mentions to use RepositoryModelResolver from Apache Archiva as an 
implementation ModelResolver. But I don't want to introduce a dependency to 
Apache Archiva in my tool.

So my questions are, is the usage of DefaultModelBuilder the best way to get an 
effective POM of my project outside of a Maven Plugin? If so which 
implementation I should use for the ModelResolver? If not what is the best way 
to get the effective POM outside of a Maven Plugin.

Thank you and best regards,

Sandra Parsick

-
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



[ANN] Apache Maven Wagon 3.0.0

2017-08-09 Thread Olivier Lamy
Hi,
The Apache Maven team is pleased to announce the Apache Maven Wagon version
3.0.0
Maven Wagon is a transport abstraction that is used in Maven's artifact and
repository handling code.
Website: http://maven.apache.org/components/wagon/

Release Notes - Maven Wagon - Version 3.0.0

** Improvement
* [WAGON-488] - Upgrade WebDAV Wagon to a more recent HttpClient
version (4.5.3)
* [WAGON-489] - Java 7 required

** Bug
* [WAGON-363] - wagon-ftp fails to create non-existing directory when
path contains "/../"
* [WAGON-490] - FTP over HTTP proxy wagon


Enjoy
-- 
Apache Maven Team


How is the best way to get an effective POM outside of a Maven Plugin?

2017-08-09 Thread sparsick
Hello,

currently, I'm working on a small tool, that needs some information of a POM 
and its parent POM. I didn't want to parse them with a XML reader, so I found 
that the DefaultModelBuilder can build a complete effective POM for me. Based 
on a stackoverflow answer 
(https://stackoverflow.com/questions/27383357/how-do-i-instantiate-mavenresolver-for-modelbuilder-usage)
  I build following example:

DefaultModelBuilderFactory factory = new DefaultModelBuilderFactory();
 final DefaultModelBuilder defaultModelBuilder = factory.newInstance();
 ModelBuildingRequest buildRequest = new DefaultModelBuildingRequest();
 buildRequest.setPomFile(Paths.get("/path/to/a/pom.xml").toFile())
 .setProcessPlugins(false)
 .setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL);
 final ModelBuildingResult modelBuildingResult = 
defaultModelBuilder.build(buildRequest);

 
It works fine for simple POM (simple means a POM without a parent reference). 
But if I set a POM with a parent reference in buildRequest.setPomFile, I get 
following exception:

Exception in thread "main" java.lang.IllegalArgumentException: no model 
resolver provided, cannot resolve parent POM groupId:artifactId:1 for POM 
groupId:artifactId:version (/path/to/a/pom.xml)
 at 
org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:890)
 at 
org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:750)
 at 
org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:309)
 at 
com.github.sparsick.maven.effecitve.pom.maven.model.builder.ApacheMavenModelBuilder.main(ApacheMavenModelBuilder.java:17)

Another example on Stackoverflow 
(https://stackoverflow.com/questions/4838591/is-there-a-library-for-reading-maven2-3-pom-xml-files)
 mentions to use RepositoryModelResolver from Apache Archiva as an 
implementation ModelResolver. But I don't want to introduce a dependency to 
Apache Archiva in my tool. 

So my questions are, is the usage of DefaultModelBuilder the best way to get an 
effective POM of my project outside of a Maven Plugin? If so which 
implementation I should use for the ModelResolver? If not what is the best way 
to get the effective POM outside of a Maven Plugin.

Thank you and best regards,

Sandra Parsick

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