You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dan Rollo <da...@gmail.com> on 2012/08/28 21:30:29 UTC

How To Publish/Depend On Generated WSDL as Artifact?

Hi,

We have a maven project that produces both a .war file and a WSDL file. 
The WSDL is auto-generated by the project. Right now we are publishing 
the WSDL as an attachment (to the packaged 'war' file) with a custom 
type="wsdl".

This allows us to use the WSDL artifact as a dependency in other 
projects. The problem is when we use the "wsdl" dependency, it includes 
all the dependencies of the project that generated the WSDL (eg: all the 
deps of the 'war' project).

How can we publish/use a generated WSDL file, and avoid getting 
dependencies that where used to generate the WSDL?

Thanks,
Dan Rollo

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


Re: How To Publish/Depend On Generated WSDL as Artifact?

Posted by Anders Hammar <an...@hammar.net>.
This is exactly the problem of producing more than one artifact from
one single project. They will all share the same pom (thus,
dependencies).
However, not sure how you would have two projects in your case as the
wsdl is generated. In cases where you go contract first, I recommend
putting the wsdl in one project and then have other projects depend on
it. I've even created a custom packaging type for wsdl...

Would it work to generate the wsdl in a separate project which depends
on the jar artifact which holds the jaxws annotated classes? Haven't
tried that; will it work on binaries or does it require sources?

/Anders

On Fri, Aug 31, 2012 at 7:15 PM, Dan Rollo <da...@gmail.com> wrote:
> Ping?
>
> Maybe a different phrasing of the question would help:
>
> How could I publish an artifact generated by a maven project, but also make
> sure that artifact did NOT include any dependencies? The desired result is:
> When some other project depends on this artifact, the project would not see
> any transitive dependencies.
>
> For example:
>
> myWSDL pom snippet:
> ...
>         <groupId>com.mine</groupId>
>         <artifactId>myWSDL</artifactId>
>         <version>1.0-SNAPSHOT</version>
> ...
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>build-helper-maven-plugin</artifactId>
>         <version>1.7</version>
>         <executions>
>           <execution>
>             <id>attach-artifacts</id>
>             <phase>package</phase>
>             <goals>
>               <goal>attach-artifact</goal>
>             </goals>
>             <configuration>
>               <artifacts>
>                 <artifact>
>                   <file>target/generated/wsdl/mywsdl.wsdl</file>
>                   <type>wsdl</type>
>                 </artifact>
>               </artifacts>
>             </configuration>
>           </execution>
>         </executions>
>       </plugin>
>     </plugins>
>   </build>
>
>
> Some other project pom that uses the mywsdl file:
>
>         <artifactId>serviceClient</artifactId>
> ...
>     <dependencies>
>         <dependency>
>             <groupId>com.mine</groupId>
>             <artifactId>myWSDL</artifactId>
>             <type>wsdl</type>
>             <version>1.0-SNAPSHOT</version>
>         </dependency>
>     </dependencies>
>
> How can I prevent 'serviceClient' project from seeing the transitive
> dependencies of 'myWSDL'?
>
>
> I found other posts that mention things like:
> 'Maven Remote Resources Plugin' -
> http://www.mail-archive.com/users@maven.apache.org/msg112195.html
>
> 'Don't do it' -
> http://www.mail-archive.com/users@maven.apache.org/msg90783.html
>
> We want non-maven projects to be able to use these WSDLs easily (eg: using
> maven ant tasks to pull in the WSDL), so even though a WSDL is a small
> artifact, we want to publish and version it as a standard artifact (with a
> custom "type").
>
> Dan
>
>
> On 08/28/2012 03:30 PM, Dan Rollo wrote:
>>
>> Hi,
>>
>> We have a maven project that produces both a .war file and a WSDL file.
>> The WSDL is auto-generated by the project. Right now we are publishing
>> the WSDL as an attachment (to the packaged 'war' file) with a custom
>> type="wsdl".
>>
>> This allows us to use the WSDL artifact as a dependency in other
>> projects. The problem is when we use the "wsdl" dependency, it includes
>> all the dependencies of the project that generated the WSDL (eg: all the
>> deps of the 'war' project).
>>
>> How can we publish/use a generated WSDL file, and avoid getting
>> dependencies that where used to generate the WSDL?
>>
>> Thanks,
>> Dan Rollo
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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


Re: How To Publish/Depend On Generated WSDL as Artifact?

Posted by Dan Rollo <da...@gmail.com>.
Ping?

Maybe a different phrasing of the question would help:

How could I publish an artifact generated by a maven project, but also 
make sure that artifact did NOT include any dependencies? The desired 
result is: When some other project depends on this artifact, the project 
would not see any transitive dependencies.

For example:

myWSDL pom snippet:
...
	<groupId>com.mine</groupId>
	<artifactId>myWSDL</artifactId>
	<version>1.0-SNAPSHOT</version>
...
   <build>
     <plugins>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>build-helper-maven-plugin</artifactId>
         <version>1.7</version>
         <executions>
           <execution>
             <id>attach-artifacts</id>
             <phase>package</phase>
             <goals>
               <goal>attach-artifact</goal>
             </goals>
             <configuration>
               <artifacts>
                 <artifact>
                   <file>target/generated/wsdl/mywsdl.wsdl</file>
                   <type>wsdl</type>
                 </artifact>
               </artifacts>
             </configuration>
           </execution>
         </executions>
       </plugin>
     </plugins>
   </build>


Some other project pom that uses the mywsdl file:

	<artifactId>serviceClient</artifactId>
...
     <dependencies>
         <dependency>
             <groupId>com.mine</groupId>
             <artifactId>myWSDL</artifactId>
             <type>wsdl</type>
             <version>1.0-SNAPSHOT</version>
         </dependency>
     </dependencies>

How can I prevent 'serviceClient' project from seeing the transitive 
dependencies of 'myWSDL'?


I found other posts that mention things like:
'Maven Remote Resources Plugin' - 
http://www.mail-archive.com/users@maven.apache.org/msg112195.html

'Don't do it' - 
http://www.mail-archive.com/users@maven.apache.org/msg90783.html

We want non-maven projects to be able to use these WSDLs easily (eg: 
using maven ant tasks to pull in the WSDL), so even though a WSDL is a 
small artifact, we want to publish and version it as a standard artifact 
(with a custom "type").

Dan


On 08/28/2012 03:30 PM, Dan Rollo wrote:
> Hi,
>
> We have a maven project that produces both a .war file and a WSDL file.
> The WSDL is auto-generated by the project. Right now we are publishing
> the WSDL as an attachment (to the packaged 'war' file) with a custom
> type="wsdl".
>
> This allows us to use the WSDL artifact as a dependency in other
> projects. The problem is when we use the "wsdl" dependency, it includes
> all the dependencies of the project that generated the WSDL (eg: all the
> deps of the 'war' project).
>
> How can we publish/use a generated WSDL file, and avoid getting
> dependencies that where used to generate the WSDL?
>
> Thanks,
> Dan Rollo


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