You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by pieter claassen <pi...@claassen.co.uk> on 2009/04/20 14:55:02 UTC

Dependency on local web project war (netbeans)

I have a netbeans project that requires to access sourcecode and
compiled code from a web project. If I set the dependency on the war
file, it just doesn't work (it works on a jar file). How do I access
code produced by a war project in netbeans?

Regards,
Pieter

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


Re: Dependency on local web project war (netbeans)

Posted by Milos Kleint <mk...@gmail.com>.
On Tue, Apr 21, 2009 at 4:23 PM, Siegfried Goeschl <
siegfried.goeschl@it20one.at> wrote:

> Hi Pieter,
>
> you could use a project layout like this
>
> +--project
>   +--shared
>   +--client
>   +--server
>
> A few quick remarks
>
> +) the server part should not depend on the client or the other way
> round - therefore a common subproject
> +) sharing in Maven speak means installing the shared component library
> into the local repository and reference it from the dependent project
> +) with a little bit of tinkering you can also upload the sources into
> your local repository
>
> Cheers,
>
> Siegfried Goeschl
>
> PS: Not sure if NetBeans is a good choice considering that Oracle buys Sun


that's FUD. If you use maven, you can use any IDE out there. and netbeans is
unlikely to disappear from one hour to the next. Even now there are people
still using 5.5 which came out 2+ years ago..

Milos



>
>
> pieter claassen wrote:
> > I am trying to move to netbeans for dev so it is a good question
> > whether I need the source or just the compiled code. Not finding the
> > symbols I assume is a failure to access the .class files? Or does
> > netbeans need access to the source?
> >
> > How do I share the project between the client and the server? You mean
> > unify them into 1 project?
> >
> > I am a bit stumped here because I imagine that this is such a normal
> > requirement. People write project that import classes from other local
> > projects all the time. The problem is just how to do this with maven?
> >
> > Thanks for the feedback.
> >
> > P
> >
> > On Mon, Apr 20, 2009 at 6:58 PM, Siegfried Goeschl
> > <si...@it20one.at> wrote:
> >
> >> Hi Pieter,
> >>
> >> you would like to use transitive dependencies using a WAR - this did not
> >> work in the past and I doubt that it works now. Having said that I would
> >> help if you have shared project between client and server. And do really
> >> need the source or only the class files?! If yes that approach would not
> >> work either ...
> >>
> >> Cheers,
> >>
> >> Siegfried Goeschl
> >>
> >> pieter claassen wrote:
> >>
> >>> ok, I have narrowed the problem down as probably a maven issue.
> >>>
> >>> I have parent.pom and two modules client and server. Client is a war
> >>> and server is a jar. server needs to get hold of client's source
> >>> because db4o needs the source for both the client and server (to
> >>> configure it for each java.class it will store).
> >>>
> >>> I have the following dep in server.pom
> >>>        <dependency>
> >>>             <groupId>com.musmato</groupId>
> >>>             <artifactId>client.war</artifactId>
> >>>             <version>1.0</version>
> >>>             <type>war</type>
> >>>             <scope>compile</scope>
> >>>         </dependency>
> >>>
> >>> But when I run mvn clean install on the parent, I can see it build the
> >>> client.war, pop it in the local mvn repo and then the server build
> >>> fails to find any of the depedency code.
> >>>
> >>> Any ideas? Should this work? I assume it is pretty normal to share
> >>> code between different maven projects?? Even if one of them is a war?
> >>>
> >>> Cheers,
> >>> P
> >>>
> >>> On Mon, Apr 20, 2009 at 2:55 PM, pieter claassen <
> pieter@claassen.co.uk> wrote:
> >>>
> >>>
> >>>> I have a netbeans project that requires to access sourcecode and
> >>>> compiled code from a web project. If I set the dependency on the war
> >>>> file, it just doesn't work (it works on a jar file). How do I access
> >>>> code produced by a war project in netbeans?
> >>>>
> >>>> Regards,
> >>>> Pieter
> >>>>
> >>>>
> >>>>
> >>> ---------------------------------------------------------------------
> >>> 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
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > 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: Dependency on local web project war (netbeans)

Posted by Siegfried Goeschl <si...@it20one.at>.
Hi Pieter,

you could use a project layout like this

+--project
   +--shared
   +--client
   +--server

A few quick remarks

+) the server part should not depend on the client or the other way
round - therefore a common subproject
+) sharing in Maven speak means installing the shared component library
into the local repository and reference it from the dependent project
+) with a little bit of tinkering you can also upload the sources into
your local repository

Cheers,

Siegfried Goeschl

PS: Not sure if NetBeans is a good choice considering that Oracle buys Sun

pieter claassen wrote:
> I am trying to move to netbeans for dev so it is a good question
> whether I need the source or just the compiled code. Not finding the
> symbols I assume is a failure to access the .class files? Or does
> netbeans need access to the source?
>
> How do I share the project between the client and the server? You mean
> unify them into 1 project?
>
> I am a bit stumped here because I imagine that this is such a normal
> requirement. People write project that import classes from other local
> projects all the time. The problem is just how to do this with maven?
>
> Thanks for the feedback.
>
> P
>
> On Mon, Apr 20, 2009 at 6:58 PM, Siegfried Goeschl
> <si...@it20one.at> wrote:
>   
>> Hi Pieter,
>>
>> you would like to use transitive dependencies using a WAR - this did not
>> work in the past and I doubt that it works now. Having said that I would
>> help if you have shared project between client and server. And do really
>> need the source or only the class files?! If yes that approach would not
>> work either ...
>>
>> Cheers,
>>
>> Siegfried Goeschl
>>
>> pieter claassen wrote:
>>     
>>> ok, I have narrowed the problem down as probably a maven issue.
>>>
>>> I have parent.pom and two modules client and server. Client is a war
>>> and server is a jar. server needs to get hold of client's source
>>> because db4o needs the source for both the client and server (to
>>> configure it for each java.class it will store).
>>>
>>> I have the following dep in server.pom
>>>        <dependency>
>>>             <groupId>com.musmato</groupId>
>>>             <artifactId>client.war</artifactId>
>>>             <version>1.0</version>
>>>             <type>war</type>
>>>             <scope>compile</scope>
>>>         </dependency>
>>>
>>> But when I run mvn clean install on the parent, I can see it build the
>>> client.war, pop it in the local mvn repo and then the server build
>>> fails to find any of the depedency code.
>>>
>>> Any ideas? Should this work? I assume it is pretty normal to share
>>> code between different maven projects?? Even if one of them is a war?
>>>
>>> Cheers,
>>> P
>>>
>>> On Mon, Apr 20, 2009 at 2:55 PM, pieter claassen <pi...@claassen.co.uk> wrote:
>>>
>>>       
>>>> I have a netbeans project that requires to access sourcecode and
>>>> compiled code from a web project. If I set the dependency on the war
>>>> file, it just doesn't work (it works on a jar file). How do I access
>>>> code produced by a war project in netbeans?
>>>>
>>>> Regards,
>>>> Pieter
>>>>
>>>>
>>>>         
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>>     
>
> ---------------------------------------------------------------------
> 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: Dependency on local web project war (netbeans)

Posted by pieter claassen <pi...@gmail.com>.
I am trying to move to netbeans for dev so it is a good question
whether I need the source or just the compiled code. Not finding the
symbols I assume is a failure to access the .class files? Or does
netbeans need access to the source?

How do I share the project between the client and the server? You mean
unify them into 1 project?

I am a bit stumped here because I imagine that this is such a normal
requirement. People write project that import classes from other local
projects all the time. The problem is just how to do this with maven?

Thanks for the feedback.

P

On Mon, Apr 20, 2009 at 6:58 PM, Siegfried Goeschl
<si...@it20one.at> wrote:
> Hi Pieter,
>
> you would like to use transitive dependencies using a WAR - this did not
> work in the past and I doubt that it works now. Having said that I would
> help if you have shared project between client and server. And do really
> need the source or only the class files?! If yes that approach would not
> work either ...
>
> Cheers,
>
> Siegfried Goeschl
>
> pieter claassen wrote:
>> ok, I have narrowed the problem down as probably a maven issue.
>>
>> I have parent.pom and two modules client and server. Client is a war
>> and server is a jar. server needs to get hold of client's source
>> because db4o needs the source for both the client and server (to
>> configure it for each java.class it will store).
>>
>> I have the following dep in server.pom
>>        <dependency>
>>             <groupId>com.musmato</groupId>
>>             <artifactId>client.war</artifactId>
>>             <version>1.0</version>
>>             <type>war</type>
>>             <scope>compile</scope>
>>         </dependency>
>>
>> But when I run mvn clean install on the parent, I can see it build the
>> client.war, pop it in the local mvn repo and then the server build
>> fails to find any of the depedency code.
>>
>> Any ideas? Should this work? I assume it is pretty normal to share
>> code between different maven projects?? Even if one of them is a war?
>>
>> Cheers,
>> P
>>
>> On Mon, Apr 20, 2009 at 2:55 PM, pieter claassen <pi...@claassen.co.uk> wrote:
>>
>>> I have a netbeans project that requires to access sourcecode and
>>> compiled code from a web project. If I set the dependency on the war
>>> file, it just doesn't work (it works on a jar file). How do I access
>>> code produced by a war project in netbeans?
>>>
>>> Regards,
>>> Pieter
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>

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


Re: Dependency on local web project war (netbeans)

Posted by Siegfried Goeschl <si...@it20one.at>.
Hi Pieter,

you would like to use transitive dependencies using a WAR - this did not
work in the past and I doubt that it works now. Having said that I would
help if you have shared project between client and server. And do really
need the source or only the class files?! If yes that approach would not
work either ...

Cheers,

Siegfried Goeschl

pieter claassen wrote:
> ok, I have narrowed the problem down as probably a maven issue.
>
> I have parent.pom and two modules client and server. Client is a war
> and server is a jar. server needs to get hold of client's source
> because db4o needs the source for both the client and server (to
> configure it for each java.class it will store).
>
> I have the following dep in server.pom
>        <dependency>
>             <groupId>com.musmato</groupId>
>             <artifactId>client.war</artifactId>
>             <version>1.0</version>
>             <type>war</type>
>             <scope>compile</scope>
>         </dependency>
>
> But when I run mvn clean install on the parent, I can see it build the
> client.war, pop it in the local mvn repo and then the server build
> fails to find any of the depedency code.
>
> Any ideas? Should this work? I assume it is pretty normal to share
> code between different maven projects?? Even if one of them is a war?
>
> Cheers,
> P
>
> On Mon, Apr 20, 2009 at 2:55 PM, pieter claassen <pi...@claassen.co.uk> wrote:
>   
>> I have a netbeans project that requires to access sourcecode and
>> compiled code from a web project. If I set the dependency on the war
>> file, it just doesn't work (it works on a jar file). How do I access
>> code produced by a war project in netbeans?
>>
>> Regards,
>> Pieter
>>
>>     
>
> ---------------------------------------------------------------------
> 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: Dependency on local web project war (netbeans)

Posted by pieter claassen <pi...@claassen.co.uk>.
ok, I have narrowed the problem down as probably a maven issue.

I have parent.pom and two modules client and server. Client is a war
and server is a jar. server needs to get hold of client's source
because db4o needs the source for both the client and server (to
configure it for each java.class it will store).

I have the following dep in server.pom
       <dependency>
            <groupId>com.musmato</groupId>
            <artifactId>client.war</artifactId>
            <version>1.0</version>
            <type>war</type>
            <scope>compile</scope>
        </dependency>

But when I run mvn clean install on the parent, I can see it build the
client.war, pop it in the local mvn repo and then the server build
fails to find any of the depedency code.

Any ideas? Should this work? I assume it is pretty normal to share
code between different maven projects?? Even if one of them is a war?

Cheers,
P

On Mon, Apr 20, 2009 at 2:55 PM, pieter claassen <pi...@claassen.co.uk> wrote:
> I have a netbeans project that requires to access sourcecode and
> compiled code from a web project. If I set the dependency on the war
> file, it just doesn't work (it works on a jar file). How do I access
> code produced by a war project in netbeans?
>
> Regards,
> Pieter
>

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