Re: jaxws-maven-plugin:2.6:wsimport Exception in thread "main" java.lang.reflect.InvocationTargetException

2020-09-15 Thread Anders Hammar
What maven version and what jdk version? jaxws-m-p v2.6 should work with
Java 8 and 11.

Also, I can't see in the log you provide what class is not found. The log
seems stripped.

/Anders

On Wed, Sep 16, 2020 at 7:55 AM Ilia  wrote:

> Hello folks,
>
> I'm trying to generate an async client for some web-service using
> jaxws-maven-plugin. Here is src: https://github.com/tillias/reactive-ws
>
> Unfortunately I have a following error:
> [INFO] --- jaxws-maven-plugin:2.6:wsimport (default) @ asyncws ---
> [INFO] Processing:
> file:/C:/Development/Projects/asyncws/src/wsdl/CountryInfoService.wsdl
> [INFO] jaxws:wsimport args: [-keep, -s,
> 'C:\Development\Projects\asyncws\target\generated-sources\wsimport', -d,
> 'C:\Development\Projects\asyncws\target\classes', -encoding, UTF-8,
> -extension, -Xnocompile, -p, com.example.asyncws.client, -wsdllocation,
> /wsdl/CountryInfoService.wsdl, -b,
> 'file:/C:/Development/Projects/asyncws/src/resources/bindings.xml',
> "file:/C:/Development/Projects/asyncws/src/wsdl/CountryInfoService.wsdl"]
> Exception in thread "main" java.lang.reflect.InvocationTargetException
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
>
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
>
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at org.codehaus.mojo.jaxws.Invoker.main(Invoker.java:80)
>
> Exception: java.lang.NoClassDefFoundError thrown from the
> UncaughtExceptionHandler in thread "main"
>
> Can you please advise which dependency may be missing?
>
> Many thanks in advance
>
>
>
> <
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >
> Virenfrei.
> www.avast.com
> <
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>


jaxws-maven-plugin:2.6:wsimport Exception in thread "main" java.lang.reflect.InvocationTargetException

2020-09-15 Thread Ilia
Hello folks,

I'm trying to generate an async client for some web-service using
jaxws-maven-plugin. Here is src: https://github.com/tillias/reactive-ws

Unfortunately I have a following error:
[INFO] --- jaxws-maven-plugin:2.6:wsimport (default) @ asyncws ---
[INFO] Processing:
file:/C:/Development/Projects/asyncws/src/wsdl/CountryInfoService.wsdl
[INFO] jaxws:wsimport args: [-keep, -s,
'C:\Development\Projects\asyncws\target\generated-sources\wsimport', -d,
'C:\Development\Projects\asyncws\target\classes', -encoding, UTF-8,
-extension, -Xnocompile, -p, com.example.asyncws.client, -wsdllocation,
/wsdl/CountryInfoService.wsdl, -b,
'file:/C:/Development/Projects/asyncws/src/resources/bindings.xml',
"file:/C:/Development/Projects/asyncws/src/wsdl/CountryInfoService.wsdl"]
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.mojo.jaxws.Invoker.main(Invoker.java:80)

Exception: java.lang.NoClassDefFoundError thrown from the
UncaughtExceptionHandler in thread "main"

Can you please advise which dependency may be missing?

Many thanks in advance




Virenfrei.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


Re: Why does POM have precedence over -D property expressions?

2020-09-15 Thread Andy Feldman
On Tue, Sep 15, 2020 at 1:12 PM Andreas Sewe 
wrote:

> My situation is unfortunately a bit more complex than that, as I have
> *two* s of the maven-enforcer-plugin, only one of which
> should be affected by -DskipChecks. The other simply uses the
>  rule, which IMHO shouldn't easily be disabled (but
> should still respect -Denforcer.skip)
> [...]
> What I want is this:
> [...]

-Denforcer.skip, being the more direct option, should
> take precedence over -DskipChecks.
>

Just an idea:


  false
  ${enforcer.skip}


This way if you set -DskipChecks=true, then only checks would be
skipped, but if you set -Denforcer.skip=true, it would also cause
skipChecks to be true, so both executions would be skipped. I haven't
actually tested it though.

--
Andy Feldman


Re: Why does POM have precedence over -D property expressions?

2020-09-15 Thread Andreas Sewe
Andy Feldman wrote:
> I guess you don't even need a custom property since each plugin tends to
> have one already. So a simpler property-based approach would just be:
> 
> 
>   ${skipChecks}
> 
> 
> And maybe you'd also need false in your properties
> to provide a default for when skipChecks isn't specified on the command
> line. But like I said, I haven't tried this approach so you'd have to
> experiment and see if it works for you.

Thank you, Andy, for the suggestions.

My situation is unfortunately a bit more complex than that, as I have
*two* s of the maven-enforcer-plugin, only one of which
should be affected by -DskipChecks. The other simply uses the
 rule, which IMHO shouldn't easily be disabled (but
should still respect -Denforcer.skip)

  
org.apache.maven.plugins
maven-enforcer-plugin

  
enforce-maven-version/id>

  enforce


  

  [3.6,4)

  
   
 
 
checks

  enforce


  $[skipChecks}
  

  

  

  

I can't think of a way to use  to get the desired behavior
in this case, at least not without resorting to profiles -- which I am
trying to avoid, as they seem to be frowned upon for this kind of stuff.

What I want is this:

  no property -> enforce-maven-version, checks

  -DskipChecks=false -> enforce-maven-version, checks

  -DskipChecks=true -> enforce-maven-version

  -Denforcer.skip=true -> no executions

  -Denforcer.skip=false, -DskipChecks=true -> enforce-maven-version,
checks (but possibly other checks predicated on skipChecks)

  etc.

In other words, -Denforcer.skip, being the more direct option, should
take precedence over -DskipChecks.

Any ideas?

Best wishes,

Andreas Sewe



signature.asc
Description: OpenPGP digital signature


Re: Why does POM have precedence over -D property expressions?

2020-09-15 Thread Andreas Sewe
Oliver B. Fischer wrote:
> I had the same question some days back
> (https://mail-archives.apache.org/mod_mbox/maven-users/202009.mbox/%3C922b4efc-3296-d35d-0675-d6c0090cc4b1%40swe-blog.net%3E)
> and Stuart McCulloch sent me a link to this JIRA issue:
> https://issues.apache.org/jira/browse/MNG-4979

Thanks for the pointer, Oliver. I also thought this behavior was a bug
and even tested with different Maven versions, assuming that this was a
regression.

> So, this seems to be a recurring issue that irritates a lot of people.

Yes, it is very irritating and I don't really buy Robert Scholte's
argument [1] that this is a feature rather than a bug.

Yes, it allows you to lock-in critical configuration options and make
them read-only, but to be on the safe side, you would need to do this
for *every* option of your plug-ins, which is obviously undesirable.

Also, if you break something with a manual override via the
command-line, the cause is normally crystal-clear, as you just added the
-D to the invocation; it's not something that snuck in using some
configuration file the user didn't even know about.

I hence really wish MNG-4979 would be reconsidered, maybe for Maven 4.

Best wishes,

Andreas

[1] 



signature.asc
Description: OpenPGP digital signature