You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Randy Xu <r...@post.harvard.edu> on 2005/01/03 23:14:18 UTC

Multiproject without the jars

I have a multiproject project with the following subprojects:
* maven.root - the multiproject root
* app-lib
* app-jms (depends on lib)
* app-gui (depends on lib, jms)

I'd like to be able to run java:compile on all of them and just generate 
the .class files.  Then I realized this is easier said than done.  
They're currently set up to reference the jar files generated in an 
earlier module.  That is, the app-jms compilation process depends on 
app-lib-{version}.jar

Jarring takes time, and it's not neccessary to run the application so 
I'd like to avoid it except for the distribution build.  Any easy way to 
not build jar files in a multiproject setup?

-Randy

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


Re: Multiproject without the jars

Posted by Randy Xu <r...@post.harvard.edu>.
Brett Porter wrote:

>Yes, sharing a classes directory will work, but you haven't answered
>the reason why you think this is better :)
>
>  
>
Your advice is sound.  Hmm, it's not neccessarily better.  It'll be more 
congrous with the past.  Conservatism, as in politics, often serves 
those who have grown used to a system.

Not sure what app server you use.  I'm using JBoss and Jboss does not 
distinguish between the jar file app-gui.jar and a directory named 
app-gui.jar, as long as the directory matched the jar's layout.  So when 
developing, we never bother to jar.

So the way I see it, I can:

 1) copy over all the classes for all the subprojects to one central 
directory - jboss/server/myapp/deploy/app-gui.jar/com/...
     set every project's classpath to jboss/server/myapp/deploy/app-gui.jar
 2) compile to maven_project/target/classes/com...
     set every project's classpath to the point to it's dependencies' 
targets (ie set app-gui's compile classpath to ../app-lib/target/classes

Now, do you know how you do this?  Add additional directories to the 
java:compile classpath?

-Randy


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


Re: Multiproject without the jars

Posted by Brett Porter <br...@gmail.com>.
Yes, sharing a classes directory will work, but you haven't answered
the reason why you think this is better :)

If you want to be able to copy single classes to the appserver, you
can still do this. /WEB-INF/classes takes precedence over
/WEB-INF/lib, so just copy it into there during development. I do this
via my IDE.

Your build should reflect the structure of the project in all stages,
not the way you develop. Adding extra development hooks is always
handy and a good idea, but it should not affect the core structure you
have in place for releases all the way through. You should be able to
build in any environment and expect a consistent result.

Cheers,
Brett


On Tue, 04 Jan 2005 13:13:01 -0500, Randy Xu <r...@post.harvard.edu> wrote:
> Oops, badly formatted email
> 
> Just to clarify - say Subproject B depends on Subproject A.
> I would set the classpath of a subproject B to point to the
> /target/classes directory of subproject A.
> 
> Then run 'multiproject:goals' with the goal of 'java:compile'.  This
> should compile all classes without creating jars right?  What I'd like
> to do is have the project in a state where a change to a single class
> can be deployed and tested by just compiling that class then moving it
> to the application server directory.
> 
> -Randy
> 
> Randy Xu wrote:
> 
> > Hmm... you sure it involves copying files around.  I was planning on
> > setting the output classes directories (subproject/target/classes) in
> > the classpath of higher-level subprojects.
> >
> > Then, I'd run multiproject:goal with -Dgoal=java:compile?  Any reason
> > this wouldn't work?
> >
> > Would this involve overwriting the default java:compile goals?  I
> > guess what I'm asking is how one can add directories to the default
> > compile classpath.
> >
> > -Randy
> >
> > Brett Porter wrote:
> >
> >> The only way would be to copy class files around, but its not
> >> recommended.
> >>
> >> Jarring doesn't take very much time at all and makes everything a lot
> >> cleaner.
> >>
> >> If Jarring takes time, is it really that the test step in between
> >> java:compile and jar:jar is slow?
> >>
> >> This is a separate problem - there are ways to disable tests for
> >> development, but its also  highly recommended you run them if they are
> >> effective. If they are slow, perhaps you have some integration or
> >> performance tests in there and should split them into special
> >> integration test projects that can be run before releases instead of
> >> every build.
> >>
> >> - Brett
> >>
> >
> 
> ---------------------------------------------------------------------
> 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: Multiproject without the jars

Posted by Randy Xu <r...@post.harvard.edu>.
Oops, badly formatted email

Just to clarify - say Subproject B depends on Subproject A.
I would set the classpath of a subproject B to point to the 
/target/classes directory of subproject A.

Then run 'multiproject:goals' with the goal of 'java:compile'.  This 
should compile all classes without creating jars right?  What I'd like 
to do is have the project in a state where a change to a single class 
can be deployed and tested by just compiling that class then moving it 
to the application server directory.

-Randy

Randy Xu wrote:

> Hmm... you sure it involves copying files around.  I was planning on 
> setting the output classes directories (subproject/target/classes) in 
> the classpath of higher-level subprojects.
>
> Then, I'd run multiproject:goal with -Dgoal=java:compile?  Any reason 
> this wouldn't work?
>
> Would this involve overwriting the default java:compile goals?  I 
> guess what I'm asking is how one can add directories to the default 
> compile classpath.
>
> -Randy
>
> Brett Porter wrote:
>
>> The only way would be to copy class files around, but its not 
>> recommended.
>>
>> Jarring doesn't take very much time at all and makes everything a lot 
>> cleaner.
>>
>> If Jarring takes time, is it really that the test step in between
>> java:compile and jar:jar is slow?
>>
>> This is a separate problem - there are ways to disable tests for
>> development, but its also  highly recommended you run them if they are
>> effective. If they are slow, perhaps you have some integration or
>> performance tests in there and should split them into special
>> integration test projects that can be run before releases instead of
>> every build.
>>
>> - Brett
>>
>


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


Re: Multiproject without the jars

Posted by Randy Xu <r...@post.harvard.edu>.
Hmm... you sure it involves copying files around.  I was planning on 
setting the output classes directories (subproject/target/classes) in 
the classpath of higher-level subprojects.

Then, I'd run multiproject:goal with -Dgoal=java:compile?  Any reason 
this wouldn't work?

Would this involve overwriting the default java:compile goals?  I guess 
what I'm asking is how one can add directories to the default compile 
classpath.

-Randy

Brett Porter wrote:

>The only way would be to copy class files around, but its not recommended.
>
>Jarring doesn't take very much time at all and makes everything a lot cleaner.
>
>If Jarring takes time, is it really that the test step in between
>java:compile and jar:jar is slow?
>
>This is a separate problem - there are ways to disable tests for
>development, but its also  highly recommended you run them if they are
>effective. If they are slow, perhaps you have some integration or
>performance tests in there and should split them into special
>integration test projects that can be run before releases instead of
>every build.
>
>- Brett
>
>
>On Mon, 03 Jan 2005 17:14:18 -0500, Randy Xu <r...@post.harvard.edu> wrote:
>  
>
>>I have a multiproject project with the following subprojects:
>>* maven.root - the multiproject root
>>* app-lib
>>* app-jms (depends on lib)
>>* app-gui (depends on lib, jms)
>>
>>I'd like to be able to run java:compile on all of them and just generate
>>the .class files.  Then I realized this is easier said than done.
>>They're currently set up to reference the jar files generated in an
>>earlier module.  That is, the app-jms compilation process depends on
>>app-lib-{version}.jar
>>
>>Jarring takes time, and it's not neccessary to run the application so
>>I'd like to avoid it except for the distribution build.  Any easy way to
>>not build jar files in a multiproject setup?
>>
>>-Randy
>>    
>>


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


Re: Multiproject without the jars

Posted by Brett Porter <br...@gmail.com>.
The only way would be to copy class files around, but its not recommended.

Jarring doesn't take very much time at all and makes everything a lot cleaner.

If Jarring takes time, is it really that the test step in between
java:compile and jar:jar is slow?

This is a separate problem - there are ways to disable tests for
development, but its also  highly recommended you run them if they are
effective. If they are slow, perhaps you have some integration or
performance tests in there and should split them into special
integration test projects that can be run before releases instead of
every build.

- Brett


On Mon, 03 Jan 2005 17:14:18 -0500, Randy Xu <r...@post.harvard.edu> wrote:
> I have a multiproject project with the following subprojects:
> * maven.root - the multiproject root
> * app-lib
> * app-jms (depends on lib)
> * app-gui (depends on lib, jms)
> 
> I'd like to be able to run java:compile on all of them and just generate
> the .class files.  Then I realized this is easier said than done.
> They're currently set up to reference the jar files generated in an
> earlier module.  That is, the app-jms compilation process depends on
> app-lib-{version}.jar
> 
> Jarring takes time, and it's not neccessary to run the application so
> I'd like to avoid it except for the distribution build.  Any easy way to
> not build jar files in a multiproject setup?
> 
> -Randy
> 
> ---------------------------------------------------------------------
> 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