Re: Running maven-compiler-plugin and maven-jaxws-plugin with different configurations in different phases

2008-05-21 Thread Jan Fredrik Wedén
Hi,

Could you not split this into two modules where your step 4 resides in
a module which dependes on another module containing the results from
1, 2 and 3? Seems like the most correct Maven-way if you are allowed
to split your codebase to accomplish this.

On Wed, May 21, 2008 at 2:48 AM, Clint Gilbert
[EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Hello everyone,

 First of all, I cannot overstate the beneficial effect that Maven has had on
 the
 development process at my organization.  To the devs: thanks for the great
 tool!

 I have a pom that specifies two executions of the compiler plugin, with
 different phases
 specified and different configs, but they're not both running.  (See pom
 excerpt below.)
 Is that expected?  Can I configure multiple executions of the compiler
 plugin with
 different configurations?  It seems like no - [1], [2], [3] - but I hope
 someone has an
 definitive answer.

 Here's some background on my problem, which I admit is fairly obscure.
 Basically, what I
 need to do is:

 1 Compile class A in package org.myorg, which is annotated with @WebService

 2 Run JAXWS's wsgen (via maven-jaxws-plugin) to make a WSDL from the
 compiled A.class

 3 Run JAXWS's wsimport (via maven-jaxws-plugin) to make client-side bindings
 from the
 just-generated WSDL

 4 Compile non-generated classes that reference the just-generated client
 bindings. These
 live in separate sub-packages - org.myorg.x, org.myorg.y, etc - and would
 have failed if
 compiled during step 1 because they reference code generated in step 3.

 I've included (what I hope are) the relevant sections of my pom below.

 PS: Do I need to do things this way?  Unfortunately, I think so.  Class
 org.myorg.A is a
 web service that needs to invoke other org.myorg.A web services arranged in
 a tree or mesh
 topology.  I've tried to break out the bindings, the SEI (A), and the
 classes that
 abstract the connection between As using the client bindings into
 submodules, but I've
 only managed to introduce circular dependencies.

 In the past, I've dealt with this sort of chicken-and-egg problem by
 generating WSDLs and
 code and then checking them into source control.  This feels bad, and makes
 updates if the
 interface of the SEI changes a hassle.  I'd much rather define a simple SEI
 annotated with
 @WebService and have the low-level stuff (WSDLs, client bindings) generated
 from that.

 [1]
 http://weblogs.java.net/blog/ss141213/archive/2007/11/my_maven_experi.html
 [2]
 http://mail-archives.apache.org/mod_mbox/maven-users/200711.mbox/[EMAIL 
 PROTECTED]
 [3]
 http://mail-archives.apache.org/mod_mbox/maven-users/200609.mbox/[EMAIL 
 PROTECTED]

 | plugin
 |   artifactIdmaven-compiler-plugin/artifactId
 |   executions
 |   execution
 |   idjaxws-pre-compilation-hack/id
 |   !-- Hack to specify order of plugin application --
 |   phaseprocess-sources/phase
 |   configuration
 |   source1.5/source
 |   target1.5/target
 |   includes
 |
 include${source.dir}/org/myorg/include
 |   /includes
 |   excludes
 |
 exclude${source.dir}/org/myorg/x/exclude
 |
 exclude${source.dir}/org/myorg/y/exclude
 |   /excludes
 |   goals
 |   goalcompile/goal
 |   /goals
 |   /configuration
 |   /execution
 |   execution
 |   idnormal-compilation/id
 |   !-- Hack to specify order of plugin application --
 |   phasecompile/phase
 |   configuration
 |   source1.5/source
 |   target1.5/target
 |   /configuration
 |   goals
 |   goalcompile/goal
 |   /goals
 |   /execution
 |   /executions
 | /plugin
 | plugin
 |   groupIdorg.codehaus.mojo/groupId
 |   artifactIdjaxws-maven-plugin/artifactId
 |   executions
 |   execution
 |   idmake-wsdl/id
 |   !-- Hack to specify order goals are run in --
 |   phasegenerate-resources/phase
 |   goals
 |   goalwsgen/goal
 |   /goals
 |   configuration
 |   seiorg.myorg.A/sei
 |   ...
 |   /configuration
 |   /execution
 |   execution
 |   idmake-client-bindings/id
 |   !-- Hack to specify order goals are run in --
 |   phaseprocess-resources/phase
 |   goals
 |   goalwsimport/goal
 |   /goals

Re: Running maven-compiler-plugin and maven-jaxws-plugin with different configurations in different phases

2008-05-21 Thread Clint Gilbert

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jan, thank you very much for your suggestion.

That was almost the first thing I tried.  The problem is that my web service 
instances (I
call them Nodes - they're components of a distributed DB system) need to talk 
to each other.

A Node needs to be compiled to generate the client bindings, and a Node needs 
to invoke
the bindings to talk to other Nodes.  There's always a circular dependency.  I 
tried to
get around this by abstracting the process of talking to a node in order to 
hide the JAXWS
client bindings from the nodes that use them.  That let me attempt the two-pass
compilation hack, but can't get around the circular dependency.

I think I'm going to bootstrap my module by checking in the generated code and 
artifacts.

Just for reference, does anyone know for sure if you can give different configs 
for
different executions of maven-compiler-plugin?

Jan Fredrik Wedén wrote:
| Hi,
|
| Could you not split this into two modules where your step 4 resides in
| a module which dependes on another module containing the results from
| 1, 2 and 3? Seems like the most correct Maven-way if you are allowed
| to split your codebase to accomplish this.
|
| On Wed, May 21, 2008 at 2:48 AM, Clint Gilbert
| [EMAIL PROTECTED] wrote:
| Hello everyone,
|
| First of all, I cannot overstate the beneficial effect that Maven has had on
| the
| development process at my organization.  To the devs: thanks for the great
| tool!
|
| I have a pom that specifies two executions of the compiler plugin, with
| different phases
| specified and different configs, but they're not both running.  (See pom
| excerpt below.)
| Is that expected?  Can I configure multiple executions of the compiler
| plugin with
| different configurations?  It seems like no - [1], [2], [3] - but I hope
| someone has an
| definitive answer.
|
| Here's some background on my problem, which I admit is fairly obscure.
| Basically, what I
| need to do is:
|
| 1 Compile class A in package org.myorg, which is annotated with @WebService
|
| 2 Run JAXWS's wsgen (via maven-jaxws-plugin) to make a WSDL from the
| compiled A.class
|
| 3 Run JAXWS's wsimport (via maven-jaxws-plugin) to make client-side bindings
| from the
| just-generated WSDL
|
| 4 Compile non-generated classes that reference the just-generated client
| bindings. These
| live in separate sub-packages - org.myorg.x, org.myorg.y, etc - and would
| have failed if
| compiled during step 1 because they reference code generated in step 3.
|
| I've included (what I hope are) the relevant sections of my pom below.
|
| PS: Do I need to do things this way?  Unfortunately, I think so.  Class
| org.myorg.A is a
| web service that needs to invoke other org.myorg.A web services arranged in
| a tree or mesh
| topology.  I've tried to break out the bindings, the SEI (A), and the
| classes that
| abstract the connection between As using the client bindings into
| submodules, but I've
| only managed to introduce circular dependencies.
|
| In the past, I've dealt with this sort of chicken-and-egg problem by
| generating WSDLs and
| code and then checking them into source control.  This feels bad, and makes
| updates if the
| interface of the SEI changes a hassle.  I'd much rather define a simple SEI
| annotated with
| @WebService and have the low-level stuff (WSDLs, client bindings) generated
| from that.
|
| [1]
| http://weblogs.java.net/blog/ss141213/archive/2007/11/my_maven_experi.html
| [2]
|
http://mail-archives.apache.org/mod_mbox/maven-users/200711.mbox/[EMAIL 
PROTECTED]
| [3]
|
http://mail-archives.apache.org/mod_mbox/maven-users/200609.mbox/[EMAIL 
PROTECTED]
|
| | plugin
| |   artifactIdmaven-compiler-plugin/artifactId
| |   executions
| |   execution
| |   idjaxws-pre-compilation-hack/id
| |   !-- Hack to specify order of plugin application --
| |   phaseprocess-sources/phase
| |   configuration
| |   source1.5/source
| |   target1.5/target
| |   includes
| |
| include${source.dir}/org/myorg/include
| |   /includes
| |   excludes
| |
| exclude${source.dir}/org/myorg/x/exclude
| |
| exclude${source.dir}/org/myorg/y/exclude
| |   /excludes
| |   goals
| |   goalcompile/goal
| |   /goals
| |   /configuration
| |   /execution
| |   execution
| |   idnormal-compilation/id
| |   !-- Hack to specify order of plugin application --
| |   phasecompile/phase
| |   configuration
| |   source1.5/source
| |   target1.5/target
| | 

Re: Running maven-compiler-plugin and maven-jaxws-plugin with different configurations in different phases

2008-05-21 Thread Jan Fredrik Wedén
Hmm, I'm not very familiar with jaxws so maybe I don't understand the
full picture here. It just seems that if a class in one package can be
compiled and used when generating wsdl and client bidnings without
reference to other packages in the module, it can also be used for the
same steps in module by itself.

Unless you mean that compilation of a webservice class requires client
bindings from another service which is not yet built since it requires
the client bindings you are about to build - that would be a painful
circular dep. But I guess such a situation cannot be solved by
conventional means anyhow...

On Wed, May 21, 2008 at 7:03 PM, Clint Gilbert
[EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Jan, thank you very much for your suggestion.

 That was almost the first thing I tried.  The problem is that my web service
 instances (I
 call them Nodes - they're components of a distributed DB system) need to
 talk to each other.

 A Node needs to be compiled to generate the client bindings, and a Node
 needs to invoke
 the bindings to talk to other Nodes.  There's always a circular dependency.
  I tried to
 get around this by abstracting the process of talking to a node in order to
 hide the JAXWS
 client bindings from the nodes that use them.  That let me attempt the
 two-pass
 compilation hack, but can't get around the circular dependency.

 I think I'm going to bootstrap my module by checking in the generated code
 and artifacts.

 Just for reference, does anyone know for sure if you can give different
 configs for
 different executions of maven-compiler-plugin?

 Jan Fredrik Wedén wrote:
 | Hi,
 |
 | Could you not split this into two modules where your step 4 resides in
 | a module which dependes on another module containing the results from
 | 1, 2 and 3? Seems like the most correct Maven-way if you are allowed
 | to split your codebase to accomplish this.
 |
 | On Wed, May 21, 2008 at 2:48 AM, Clint Gilbert
 | [EMAIL PROTECTED] wrote:
 | Hello everyone,
 |
 | First of all, I cannot overstate the beneficial effect that Maven has had
 on
 | the
 | development process at my organization.  To the devs: thanks for the great
 | tool!
 |
 | I have a pom that specifies two executions of the compiler plugin, with
 | different phases
 | specified and different configs, but they're not both running.  (See pom
 | excerpt below.)
 | Is that expected?  Can I configure multiple executions of the compiler
 | plugin with
 | different configurations?  It seems like no - [1], [2], [3] - but I hope
 | someone has an
 | definitive answer.
 |
 | Here's some background on my problem, which I admit is fairly obscure.
 | Basically, what I
 | need to do is:
 |
 | 1 Compile class A in package org.myorg, which is annotated with
 @WebService
 |
 | 2 Run JAXWS's wsgen (via maven-jaxws-plugin) to make a WSDL from the
 | compiled A.class
 |
 | 3 Run JAXWS's wsimport (via maven-jaxws-plugin) to make client-side
 bindings
 | from the
 | just-generated WSDL
 |
 | 4 Compile non-generated classes that reference the just-generated client
 | bindings. These
 | live in separate sub-packages - org.myorg.x, org.myorg.y, etc - and would
 | have failed if
 | compiled during step 1 because they reference code generated in step 3.
 |
 | I've included (what I hope are) the relevant sections of my pom below.
 |
 | PS: Do I need to do things this way?  Unfortunately, I think so.  Class
 | org.myorg.A is a
 | web service that needs to invoke other org.myorg.A web services arranged
 in
 | a tree or mesh
 | topology.  I've tried to break out the bindings, the SEI (A), and the
 | classes that
 | abstract the connection between As using the client bindings into
 | submodules, but I've
 | only managed to introduce circular dependencies.
 |
 | In the past, I've dealt with this sort of chicken-and-egg problem by
 | generating WSDLs and
 | code and then checking them into source control.  This feels bad, and
 makes
 | updates if the
 | interface of the SEI changes a hassle.  I'd much rather define a simple
 SEI
 | annotated with
 | @WebService and have the low-level stuff (WSDLs, client bindings)
 generated
 | from that.
 |
 | [1]
 | http://weblogs.java.net/blog/ss141213/archive/2007/11/my_maven_experi.html
 | [2]
 |
 http://mail-archives.apache.org/mod_mbox/maven-users/200711.mbox/[EMAIL 
 PROTECTED]
 | [3]
 |
 http://mail-archives.apache.org/mod_mbox/maven-users/200609.mbox/[EMAIL 
 PROTECTED]
 |
 | | plugin
 | |   artifactIdmaven-compiler-plugin/artifactId
 | |   executions
 | |   execution
 | |   idjaxws-pre-compilation-hack/id
 | |   !-- Hack to specify order of plugin application
 --
 | |   phaseprocess-sources/phase
 | |   configuration
 | |   source1.5/source
 | |   target1.5/target
 | |   includes
 | |
 | 

Re: Running maven-compiler-plugin and maven-jaxws-plugin with different configurations in different phases

2008-05-21 Thread Daniel Kulp


One option is to go completely code first and not generate anything.
Use the same SEI interface for the client and for the service impls.
You don't need to generate any wsdl's or anything then.I know  
Apache CXF supports that directly without problems.   No generation of  
anything needed at all.   With the Sun RI, you would still need wsgen  
to generate the wrapper beans/fault beans, but it can also compile them.


Dan



On May 21, 2008, at 1:03 PM, Clint Gilbert wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jan, thank you very much for your suggestion.

That was almost the first thing I tried.  The problem is that my web  
service instances (I
call them Nodes - they're components of a distributed DB system)  
need to talk to each other.


A Node needs to be compiled to generate the client bindings, and a  
Node needs to invoke
the bindings to talk to other Nodes.  There's always a circular  
dependency.  I tried to
get around this by abstracting the process of talking to a node in  
order to hide the JAXWS
client bindings from the nodes that use them.  That let me attempt  
the two-pass

compilation hack, but can't get around the circular dependency.

I think I'm going to bootstrap my module by checking in the  
generated code and artifacts.


Just for reference, does anyone know for sure if you can give  
different configs for

different executions of maven-compiler-plugin?

Jan Fredrik Wedén wrote:
| Hi,
|
| Could you not split this into two modules where your step 4  
resides in
| a module which dependes on another module containing the results  
from

| 1, 2 and 3? Seems like the most correct Maven-way if you are allowed
| to split your codebase to accomplish this.
|
| On Wed, May 21, 2008 at 2:48 AM, Clint Gilbert
| [EMAIL PROTECTED] wrote:
| Hello everyone,
|
| First of all, I cannot overstate the beneficial effect that Maven  
has had on

| the
| development process at my organization.  To the devs: thanks for  
the great

| tool!
|
| I have a pom that specifies two executions of the compiler plugin,  
with

| different phases
| specified and different configs, but they're not both running.   
(See pom

| excerpt below.)
| Is that expected?  Can I configure multiple executions of the  
compiler

| plugin with
| different configurations?  It seems like no - [1], [2], [3] - but  
I hope

| someone has an
| definitive answer.
|
| Here's some background on my problem, which I admit is fairly  
obscure.

| Basically, what I
| need to do is:
|
| 1 Compile class A in package org.myorg, which is annotated with  
@WebService

|
| 2 Run JAXWS's wsgen (via maven-jaxws-plugin) to make a WSDL from the
| compiled A.class
|
| 3 Run JAXWS's wsimport (via maven-jaxws-plugin) to make client- 
side bindings

| from the
| just-generated WSDL
|
| 4 Compile non-generated classes that reference the just-generated  
client

| bindings. These
| live in separate sub-packages - org.myorg.x, org.myorg.y, etc -  
and would

| have failed if
| compiled during step 1 because they reference code generated in  
step 3.

|
| I've included (what I hope are) the relevant sections of my pom  
below.

|
| PS: Do I need to do things this way?  Unfortunately, I think so.   
Class

| org.myorg.A is a
| web service that needs to invoke other org.myorg.A web services  
arranged in

| a tree or mesh
| topology.  I've tried to break out the bindings, the SEI (A), and  
the

| classes that
| abstract the connection between As using the client bindings into
| submodules, but I've
| only managed to introduce circular dependencies.
|
| In the past, I've dealt with this sort of chicken-and-egg problem by
| generating WSDLs and
| code and then checking them into source control.  This feels bad,  
and makes

| updates if the
| interface of the SEI changes a hassle.  I'd much rather define a  
simple SEI

| annotated with
| @WebService and have the low-level stuff (WSDLs, client bindings)  
generated

| from that.
|
| [1]
| http://weblogs.java.net/blog/ss141213/archive/2007/11/my_maven_experi.html
| [2]
|
http://mail-archives.apache.org/mod_mbox/maven-users/200711.mbox/[EMAIL 
PROTECTED]
| [3]
|
http://mail-archives.apache.org/mod_mbox/maven-users/200609.mbox/[EMAIL 
PROTECTED]
|
| | plugin
| |   artifactIdmaven-compiler-plugin/artifactId
| |   executions
| |   execution
| |   idjaxws-pre-compilation-hack/id
| |   !-- Hack to specify order of plugin  
application --

| |   phaseprocess-sources/phase
| |   configuration
| |   source1.5/source
| |   target1.5/target
| |   includes
| |
| include${source.dir}/org/myorg/include
| |   /includes
| |   excludes
| |
| exclude${source.dir}/org/myorg/x/exclude
| |
| exclude${source.dir}/org/myorg/y/exclude
| |   

RE: Running maven-compiler-plugin and maven-jaxws-plugin with different configurations in different phases

2008-05-21 Thread Sean Hennessy
Perhaps one convention being the client bindings from another service could be 
resolved by a common IService class that each client Node would derive from and 
be dependent?
Thereby decoupling the maven compile time binding to a generic class?
Unless you mean that compilation of a webservice class requires client 
bindings from another service which is not yet built since it requires the 
client bindings you are about to build - that would be a painful circular 
dep. But I guess such a situation cannot be solved by conventional means 
anyhow...



-Original Message-
From: Jan Fredrik Wedén [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 21, 2008 11:25 AM
To: Maven Users List
Subject: Re: Running maven-compiler-plugin and maven-jaxws-plugin with 
different configurations in different phases


Hmm, I'm not very familiar with jaxws so maybe I don't understand the full 
picture here. It just seems that if a class in one package can be compiled and 
used when generating wsdl and client bidnings without reference to other 
packages in the module, it can also be used for the same steps in module by 
itself.

Unless you mean that compilation of a webservice class requires client bindings 
from another service which is not yet built since it requires the client 
bindings you are about to build - that would be a painful circular dep. But I 
guess such a situation cannot be solved by conventional means anyhow...

On Wed, May 21, 2008 at 7:03 PM, Clint Gilbert [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Jan, thank you very much for your suggestion.

 That was almost the first thing I tried.  The problem is that my web
 service instances (I call them Nodes - they're components of a
 distributed DB system) need to talk to each other.

 A Node needs to be compiled to generate the client bindings, and a
 Node needs to invoke the bindings to talk to other Nodes.  There's
 always a circular dependency.  I tried to
 get around this by abstracting the process of talking to a node in order to
 hide the JAXWS
 client bindings from the nodes that use them.  That let me attempt the
 two-pass
 compilation hack, but can't get around the circular dependency.

 I think I'm going to bootstrap my module by checking in the generated
 code and artifacts.

 Just for reference, does anyone know for sure if you can give
 different configs for different executions of maven-compiler-plugin?

 Jan Fredrik Wedén wrote:
 | Hi,
 |
 | Could you not split this into two modules where your step 4 resides
 | in a module which dependes on another module containing the results
 | from 1, 2 and 3? Seems like the most correct Maven-way if you are
 | allowed to split your codebase to accomplish this.
 |
 | On Wed, May 21, 2008 at 2:48 AM, Clint Gilbert
 | [EMAIL PROTECTED] wrote: Hello everyone,
 |
 | First of all, I cannot overstate the beneficial effect that Maven
 | has had
 on
 | the
 | development process at my organization.  To the devs: thanks for the
 | great tool!
 |
 | I have a pom that specifies two executions of the compiler plugin,
 | with different phases specified and different configs, but they're
 | not both running.  (See pom excerpt below.)
 | Is that expected?  Can I configure multiple executions of the compiler
 | plugin with
 | different configurations?  It seems like no - [1], [2], [3] - but I hope
 | someone has an
 | definitive answer.
 |
 | Here's some background on my problem, which I admit is fairly
 | obscure. Basically, what I need to do is:
 |
 | 1 Compile class A in package org.myorg, which is annotated with
 @WebService
 |
 | 2 Run JAXWS's wsgen (via maven-jaxws-plugin) to make a WSDL from the
 | compiled A.class
 |
 | 3 Run JAXWS's wsimport (via maven-jaxws-plugin) to make client-side
 bindings
 | from the
 | just-generated WSDL
 |
 | 4 Compile non-generated classes that reference the just-generated
 | client bindings. These live in separate sub-packages - org.myorg.x,
 | org.myorg.y, etc - and would have failed if
 | compiled during step 1 because they reference code generated in step 3.
 |
 | I've included (what I hope are) the relevant sections of my pom
 | below.
 |
 | PS: Do I need to do things this way?  Unfortunately, I think so.
 | Class org.myorg.A is a web service that needs to invoke other
 | org.myorg.A web services arranged
 in
 | a tree or mesh
 | topology.  I've tried to break out the bindings, the SEI (A), and
 | the classes that abstract the connection between As using the client
 | bindings into submodules, but I've
 | only managed to introduce circular dependencies.
 |
 | In the past, I've dealt with this sort of chicken-and-egg problem by
 | generating WSDLs and code and then checking them into source
 | control.  This feels bad, and
 makes
 | updates if the
 | interface of the SEI changes a hassle.  I'd much rather define a
 | simple
 SEI
 | annotated with
 | @WebService and have the low-level stuff (WSDLs, client bindings)
 generated
 | from that.
 |
 | [1]
 | 

Re: Running maven-compiler-plugin and maven-jaxws-plugin with different configurations in different phases

2008-05-21 Thread Clint Gilbert

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

So could I generate client code directly from a class annotated with 
@WebService, without
generating an intermediary WSDL?  I couldn't find a way to do that with 
wsgen/wsimport,
but I'd love it if that was possible.

Daniel Kulp wrote:
|
| One option is to go completely code first and not generate anything.
| Use the same SEI interface for the client and for the service impls.
| You don't need to generate any wsdl's or anything then.I know Apache
| CXF supports that directly without problems.   No generation of anything
| needed at all.   With the Sun RI, you would still need wsgen to generate
| the wrapper beans/fault beans, but it can also compile them.
|
| Dan
|
|
|
| On May 21, 2008, at 1:03 PM, Clint Gilbert wrote:
|
| Jan, thank you very much for your suggestion.
|
| That was almost the first thing I tried.  The problem is that my web
| service instances (I
| call them Nodes - they're components of a distributed DB system) need
| to talk to each other.
|
| A Node needs to be compiled to generate the client bindings, and a
| Node needs to invoke
| the bindings to talk to other Nodes.  There's always a circular
| dependency.  I tried to
| get around this by abstracting the process of talking to a node in
| order to hide the JAXWS
| client bindings from the nodes that use them.  That let me attempt the
| two-pass
| compilation hack, but can't get around the circular dependency.
|
| I think I'm going to bootstrap my module by checking in the generated
| code and artifacts.
|
| Just for reference, does anyone know for sure if you can give
| different configs for
| different executions of maven-compiler-plugin?
|
| Jan Fredrik Wedén wrote:
| | Hi,
| |
| | Could you not split this into two modules where your step 4 resides in
| | a module which dependes on another module containing the results from
| | 1, 2 and 3? Seems like the most correct Maven-way if you are allowed
| | to split your codebase to accomplish this.
| |
| | On Wed, May 21, 2008 at 2:48 AM, Clint Gilbert
| | [EMAIL PROTECTED] wrote:
| | Hello everyone,
| |
| | First of all, I cannot overstate the beneficial effect that Maven
| has had on
| | the
| | development process at my organization.  To the devs: thanks for the
| great
| | tool!
| |
| | I have a pom that specifies two executions of the compiler plugin, with
| | different phases
| | specified and different configs, but they're not both running.  (See
| pom
| | excerpt below.)
| | Is that expected?  Can I configure multiple executions of the compiler
| | plugin with
| | different configurations?  It seems like no - [1], [2], [3] - but I
| hope
| | someone has an
| | definitive answer.
| |
| | Here's some background on my problem, which I admit is fairly obscure.
| | Basically, what I
| | need to do is:
| |
| | 1 Compile class A in package org.myorg, which is annotated with
| @WebService
| |
| | 2 Run JAXWS's wsgen (via maven-jaxws-plugin) to make a WSDL from the
| | compiled A.class
| |
| | 3 Run JAXWS's wsimport (via maven-jaxws-plugin) to make client-side
| bindings
| | from the
| | just-generated WSDL
| |
| | 4 Compile non-generated classes that reference the just-generated
| client
| | bindings. These
| | live in separate sub-packages - org.myorg.x, org.myorg.y, etc - and
| would
| | have failed if
| | compiled during step 1 because they reference code generated in step 3.
| |
| | I've included (what I hope are) the relevant sections of my pom below.
| |
| | PS: Do I need to do things this way?  Unfortunately, I think so.  Class
| | org.myorg.A is a
| | web service that needs to invoke other org.myorg.A web services
| arranged in
| | a tree or mesh
| | topology.  I've tried to break out the bindings, the SEI (A), and the
| | classes that
| | abstract the connection between As using the client bindings into
| | submodules, but I've
| | only managed to introduce circular dependencies.
| |
| | In the past, I've dealt with this sort of chicken-and-egg problem by
| | generating WSDLs and
| | code and then checking them into source control.  This feels bad,
| and makes
| | updates if the
| | interface of the SEI changes a hassle.  I'd much rather define a
| simple SEI
| | annotated with
| | @WebService and have the low-level stuff (WSDLs, client bindings)
| generated
| | from that.
| |
| | [1]
| |
| http://weblogs.java.net/blog/ss141213/archive/2007/11/my_maven_experi.html
|
| | [2]
| |
|
http://mail-archives.apache.org/mod_mbox/maven-users/200711.mbox/[EMAIL 
PROTECTED]

|
| | [3]
| |
|
http://mail-archives.apache.org/mod_mbox/maven-users/200609.mbox/[EMAIL 
PROTECTED]

|
| |
| | | plugin
| | |   artifactIdmaven-compiler-plugin/artifactId
| | |   executions
| | |   execution
| | |   idjaxws-pre-compilation-hack/id
| | |   !-- Hack to specify order of plugin
| application --
| | |   phaseprocess-sources/phase
| | |   configuration
| | 

Re: Running maven-compiler-plugin and maven-jaxws-plugin with different configurations in different phases

2008-05-21 Thread Clint Gilbert

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

True, in my case that, along with a little dynamic classloading, would get rid 
of the
source-level circular dependency.  It's similar to the way I've currently 
abstracted the
process of Nodes talking to each other - I have an abstract base NodeConnector. 
 However,
there would still be a pom-level circular dependency, since the node module 
(with client
bindings) depends on the nodeconnector module to talk to other nodes, and the
nodeconnector module depends on the node module for the client bindings needed 
to actually
talk to another Node.  I thought about breaking the client bindings out into 
their own
module, but that just turns a 2-vertex dependency cycle into a 3-vertex 
triangular-shaped one.

Ultimately, I'm sorry, as I posed my original question before I'd thought 
through my
situation fully.  I thought I could get around my circular dependency issue by 
jumping
through some very hacky hoops in one of my poms, but the circular dependency 
will always
be there in my case.

I bootstrapped everything by running wsgen and wsimport manually and checking 
in the
generated artifacts, and while slightly unpleasant, it seems a lot better than 
trying to
hack something together to generate everything on the fly, as it were, from by 
@WebService
class.

Thanks to all who offered suggestions!

Sean Hennessy wrote:
| Perhaps one convention being the client bindings from another service could 
be resolved
by a common IService class that each client Node would derive from and be 
dependent?
| Thereby decoupling the maven compile time binding to a generic class?
| Unless you mean that compilation of a webservice class requires client 
bindings from

another service which is not yet built since it requires the client bindings 
you are
about to build - that would be a painful circular dep. But I guess such a 
situation
cannot be solved by conventional means anyhow...

|
|
|
| -Original Message-
| From: Jan Fredrik Wedén [mailto:[EMAIL PROTECTED]
| Sent: Wednesday, May 21, 2008 11:25 AM
| To: Maven Users List
| Subject: Re: Running maven-compiler-plugin and maven-jaxws-plugin with 
different
configurations in different phases
|
|
| Hmm, I'm not very familiar with jaxws so maybe I don't understand the full 
picture here.
It just seems that if a class in one package can be compiled and used when 
generating wsdl
and client bidnings without reference to other packages in the module, it can 
also be used
for the same steps in module by itself.
|
| Unless you mean that compilation of a webservice class requires client 
bindings from
another service which is not yet built since it requires the client bindings 
you are about
to build - that would be a painful circular dep. But I guess such a situation 
cannot be
solved by conventional means anyhow...
|
| On Wed, May 21, 2008 at 7:03 PM, Clint Gilbert [EMAIL PROTECTED] wrote:
| Jan, thank you very much for your suggestion.
|
| That was almost the first thing I tried.  The problem is that my web
| service instances (I call them Nodes - they're components of a
| distributed DB system) need to talk to each other.
|
| A Node needs to be compiled to generate the client bindings, and a
| Node needs to invoke the bindings to talk to other Nodes.  There's
| always a circular dependency.  I tried to
| get around this by abstracting the process of talking to a node in order to
| hide the JAXWS
| client bindings from the nodes that use them.  That let me attempt the
| two-pass
| compilation hack, but can't get around the circular dependency.
|
| I think I'm going to bootstrap my module by checking in the generated
| code and artifacts.
|
| Just for reference, does anyone know for sure if you can give
| different configs for different executions of maven-compiler-plugin?
|
| Jan Fredrik Wedén wrote:
| | Hi,
| |
| | Could you not split this into two modules where your step 4 resides
| | in a module which dependes on another module containing the results
| | from 1, 2 and 3? Seems like the most correct Maven-way if you are
| | allowed to split your codebase to accomplish this.
| |
| | On Wed, May 21, 2008 at 2:48 AM, Clint Gilbert
| | [EMAIL PROTECTED] wrote: Hello everyone,
| |
| | First of all, I cannot overstate the beneficial effect that Maven
| | has had
| on
| | the
| | development process at my organization.  To the devs: thanks for the
| | great tool!
| |
| | I have a pom that specifies two executions of the compiler plugin,
| | with different phases specified and different configs, but they're
| | not both running.  (See pom excerpt below.)
| | Is that expected?  Can I configure multiple executions of the compiler
| | plugin with
| | different configurations?  It seems like no - [1], [2], [3] - but I hope
| | someone has an
| | definitive answer.
| |
| | Here's some background on my problem, which I admit is fairly
| | obscure. Basically, what I need to do is:
| |
| | 1 Compile class A in package org.myorg, which is 

Re: Running maven-compiler-plugin and maven-jaxws-plugin with different configurations in different phases

2008-05-21 Thread Daniel Kulp


On May 21, 2008, at 6:43 PM, Clint Gilbert wrote:
So could I generate client code directly from a class annotated with  
@WebService, without
generating an intermediary WSDL?  I couldn't find a way to do that  
with wsgen/wsimport,

but I'd love it if that was possible.


If you have an INTERFACE (not a class) with the annotations then that  
is usable for both the server side part and the client side part.   No  
generation required.  The server implementation would implement the  
interface and the @WebService annotation on it would specify the  
endpointInterface.  (the server impl would ONLY need the @WebService  
annotation.  The rest would be on the interface)


For the client side, it's just:
Service service = Service.create(serviceName);
service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING,  
endpointAddress);

YourInterface port = service.getPort(portName, YourInterface.class);


Dan





Daniel Kulp wrote:
|
| One option is to go completely code first and not generate anything.
| Use the same SEI interface for the client and for the service impls.
| You don't need to generate any wsdl's or anything then.I know  
Apache
| CXF supports that directly without problems.   No generation of  
anything
| needed at all.   With the Sun RI, you would still need wsgen to  
generate

| the wrapper beans/fault beans, but it can also compile them.
|
| Dan
|
|
|
| On May 21, 2008, at 1:03 PM, Clint Gilbert wrote:
|
| Jan, thank you very much for your suggestion.
|
| That was almost the first thing I tried.  The problem is that my web
| service instances (I
| call them Nodes - they're components of a distributed DB system)  
need

| to talk to each other.
|
| A Node needs to be compiled to generate the client bindings, and a
| Node needs to invoke
| the bindings to talk to other Nodes.  There's always a circular
| dependency.  I tried to
| get around this by abstracting the process of talking to a node in
| order to hide the JAXWS
| client bindings from the nodes that use them.  That let me attempt  
the

| two-pass
| compilation hack, but can't get around the circular dependency.
|
| I think I'm going to bootstrap my module by checking in the  
generated

| code and artifacts.
|
| Just for reference, does anyone know for sure if you can give
| different configs for
| different executions of maven-compiler-plugin?
|
| Jan Fredrik Wedén wrote:
| | Hi,
| |
| | Could you not split this into two modules where your step 4  
resides in
| | a module which dependes on another module containing the results  
from
| | 1, 2 and 3? Seems like the most correct Maven-way if you are  
allowed

| | to split your codebase to accomplish this.
| |
| | On Wed, May 21, 2008 at 2:48 AM, Clint Gilbert
| | [EMAIL PROTECTED] wrote:
| | Hello everyone,
| |
| | First of all, I cannot overstate the beneficial effect that Maven
| has had on
| | the
| | development process at my organization.  To the devs: thanks for  
the

| great
| | tool!
| |
| | I have a pom that specifies two executions of the compiler  
plugin, with

| | different phases
| | specified and different configs, but they're not both running.   
(See

| pom
| | excerpt below.)
| | Is that expected?  Can I configure multiple executions of the  
compiler

| | plugin with
| | different configurations?  It seems like no - [1], [2], [3] -  
but I

| hope
| | someone has an
| | definitive answer.
| |
| | Here's some background on my problem, which I admit is fairly  
obscure.

| | Basically, what I
| | need to do is:
| |
| | 1 Compile class A in package org.myorg, which is annotated with
| @WebService
| |
| | 2 Run JAXWS's wsgen (via maven-jaxws-plugin) to make a WSDL from  
the

| | compiled A.class
| |
| | 3 Run JAXWS's wsimport (via maven-jaxws-plugin) to make client- 
side

| bindings
| | from the
| | just-generated WSDL
| |
| | 4 Compile non-generated classes that reference the just-generated
| client
| | bindings. These
| | live in separate sub-packages - org.myorg.x, org.myorg.y, etc -  
and

| would
| | have failed if
| | compiled during step 1 because they reference code generated in  
step 3.

| |
| | I've included (what I hope are) the relevant sections of my pom  
below.

| |
| | PS: Do I need to do things this way?  Unfortunately, I think  
so.  Class

| | org.myorg.A is a
| | web service that needs to invoke other org.myorg.A web services
| arranged in
| | a tree or mesh
| | topology.  I've tried to break out the bindings, the SEI (A),  
and the

| | classes that
| | abstract the connection between As using the client bindings into
| | submodules, but I've
| | only managed to introduce circular dependencies.
| |
| | In the past, I've dealt with this sort of chicken-and-egg  
problem by

| | generating WSDLs and
| | code and then checking them into source control.  This feels bad,
| and makes
| | updates if the
| | interface of the SEI changes a hassle.  I'd much rather define a
| simple SEI
| | annotated with
| | @WebService and have the low-level stuff 

Running maven-compiler-plugin and maven-jaxws-plugin with different configurations in different phases

2008-05-20 Thread Clint Gilbert

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hello everyone,

First of all, I cannot overstate the beneficial effect that Maven has had on the
development process at my organization.  To the devs: thanks for the great tool!

I have a pom that specifies two executions of the compiler plugin, with 
different phases
specified and different configs, but they're not both running.  (See pom 
excerpt below.)
Is that expected?  Can I configure multiple executions of the compiler plugin 
with
different configurations?  It seems like no - [1], [2], [3] - but I hope 
someone has an
definitive answer.

Here's some background on my problem, which I admit is fairly obscure. 
Basically, what I
need to do is:

1 Compile class A in package org.myorg, which is annotated with @WebService

2 Run JAXWS's wsgen (via maven-jaxws-plugin) to make a WSDL from the compiled 
A.class

3 Run JAXWS's wsimport (via maven-jaxws-plugin) to make client-side bindings 
from the
just-generated WSDL

4 Compile non-generated classes that reference the just-generated client 
bindings. These
live in separate sub-packages - org.myorg.x, org.myorg.y, etc - and would have 
failed if
compiled during step 1 because they reference code generated in step 3.

I've included (what I hope are) the relevant sections of my pom below.

PS: Do I need to do things this way?  Unfortunately, I think so.  Class 
org.myorg.A is a
web service that needs to invoke other org.myorg.A web services arranged in a 
tree or mesh
topology.  I've tried to break out the bindings, the SEI (A), and the classes 
that
abstract the connection between As using the client bindings into submodules, 
but I've
only managed to introduce circular dependencies.

In the past, I've dealt with this sort of chicken-and-egg problem by generating 
WSDLs and
code and then checking them into source control.  This feels bad, and makes 
updates if the
interface of the SEI changes a hassle.  I'd much rather define a simple SEI 
annotated with
@WebService and have the low-level stuff (WSDLs, client bindings) generated 
from that.

[1] http://weblogs.java.net/blog/ss141213/archive/2007/11/my_maven_experi.html
[2]
http://mail-archives.apache.org/mod_mbox/maven-users/200711.mbox/[EMAIL 
PROTECTED]
[3]
http://mail-archives.apache.org/mod_mbox/maven-users/200609.mbox/[EMAIL 
PROTECTED]

| plugin
|   artifactIdmaven-compiler-plugin/artifactId
|   executions
|   execution
|   idjaxws-pre-compilation-hack/id
|   !-- Hack to specify order of plugin application --
|   phaseprocess-sources/phase
|   configuration
|   source1.5/source
|   target1.5/target
|   includes
|   
include${source.dir}/org/myorg/include
|   /includes
|   excludes
|   
exclude${source.dir}/org/myorg/x/exclude
|   
exclude${source.dir}/org/myorg/y/exclude
|   /excludes
|   goals
|   goalcompile/goal
|   /goals
|   /configuration
|   /execution
|   execution
|   idnormal-compilation/id
|   !-- Hack to specify order of plugin application --
|   phasecompile/phase
|   configuration
|   source1.5/source
|   target1.5/target
|   /configuration
|   goals
|   goalcompile/goal
|   /goals
|   /execution
|   /executions
| /plugin
| plugin
|   groupIdorg.codehaus.mojo/groupId
|   artifactIdjaxws-maven-plugin/artifactId
|   executions
|   execution
|   idmake-wsdl/id
|   !-- Hack to specify order goals are run in --
|   phasegenerate-resources/phase
|   goals
|   goalwsgen/goal
|   /goals
|   configuration
|   seiorg.myorg.A/sei
|   ...
|   /configuration
|   /execution
|   execution
|   idmake-client-bindings/id
|   !-- Hack to specify order goals are run in --
|   phaseprocess-resources/phase
|   goals
|   goalwsimport/goal
|   /goals
|   configuration
|   ...
|   /configuration
|   /execution
|   /executions
|   ...
| /plugin



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIM3FkrZoE3ArapxERCMccAKDlPjEgU1qgJHl/HPohB/v11qLSGACgo4PY
/TE9PQTQfVgGzt1zsee9gGo=
=5LNh