mentby.com
Blog | Jobs | Help | Signup | Login

loading
I am working on modernizing an older project to be used with Maven. The
project is very large and has around 30 modules in it.

As far as the main source code is concerned, I managed to get all of it to
compile and establish the dependencies correctly. It actually works and it
can be run through Maven's tomcat plugin.

The problem is with compiling the tests.

Unfortunately, this company did not apply the same dependency restrictions
for their test code as they did with their main source code.

For example, C depends on B, and B depends on A in the main source code.
However, A depends on C to run its tests. Obviously, Maven is going to
complain and say there is a cyclic dependency.

Besides out-right fixing the code (which is sadly not going to happen on
this project - it's tens of millions of lines), is there any way to tell
Maven, "Please compile ALL of the main source code first, then compile ALL
of the test code afterward" ? Or is there any other solution around this
problem?

Many Thanks,
Ken

Read more »

I tried to bind this to the prepare-package phase actually, but the copying
of the webapp resources directory to the target directory still occurs
after the yui:compress goal. Am I missing something? Setting the phase to
process-resources actually runs the yui:compress goal before the
compilation step.

One idea I have to fix this is maybe put the javascript in
src/main/scriptsand then compress everything to
src/main/webapp/scripts... that way the package goal treats the regular
source path as the final product. The real drawback to this though is that
I won't be able to test my development javascript code anymore - I'd have
to run the yui:compress goal EVERY time I make a change to the css and
javascript - that's just too much of hassle for me.

I'd also like to get functionality to work with the tomcat:run goal as
well. Am I trying to get this to work with too much?

Thanks for the assistance!

> >> ---------- Forwarded message ----------
> >> From: fe.character.guide <fe.character.guide*******>
> >> Date: Fri, Dec 2, 2011 at 7:17 AM
> >> Subject: YUI Compressor Maven plugin executed at wrong time and tomcat
> >> plugin not using yui-compressor output
> >> To: users*******
> >>
> >>
> >> Hello everyone!
> >>
> >> I'm trying to get some basic maven build processes configured correctly
> >> with my Java project, and beyond Stackoverflow, I'm not sure
> >> where else to turn.
> >>
> >> I'd like to compress all of my javascript files and aggregate them using
> >> YUICompressor, and I saw that there was a maven plugin to allow me to do
> >> this. I got it working for the most part.
> >>
> >> I am also using the Mojo tomcat plugin as well. When i go to run the
> >> tomcat:run goal, tomcat does not read from the target's output
> >> directory (this is where the YUI compressor put my javascript files) -
> but
> >> rather, it reads from the actual source files in my "src/main/
> >> webapp/scripts" directory. Of course, the aggregated javascript file
> >> (all.js) is not there. This makes sense, but is a big problem for me.
> >>
> >> I have a few questions.
> >>
> >> 1. How can I get the tomcat plugin to read the target's output folder
> that
> >> the yui compressor plugin created?
> >>
> >> 2. Do I have to run the yui compressor maven goal every time I want to
> >> update my javascript files during development while my tomcat instance
> is
> >> running?
> >>
> >> 3. How can tell Maven that I want to run the YUI compressor AFTER Maven
> >> copies over the `src/main/webapp` directory? Currently, Maven runs the
> YUI
> >> compressor, but then overwrites all of the compressed css and javascript
> >> files with the original source files, defeating the purposes of
> compressing
> >> them ;)
> >>
> >> 4. Is there a better way to achieve my objective rather than using the
> YUI
> >> compressor? Essentially, my end goal is to be able to develop JavaScript
> >> code in separate files and test my source files in development mode
> without
> >> having to aggregate them... but I want to compress and aggregate the
> files
> >> and use the `all.js` script when the application is running in
> production
> >> mode.
> >>
> >> While the Rails people have certainly figured this out, this seems to
> be a
> >> non-trivial thing to do with Maven and Spring.
> >> I would appreciate any and all assistance on how I can get this running
> >> correctly. Thanks!
> >>
> >>
> >>
> >> --
> >> "Legacy code" often differs from its suggested alternative by actually
> >> working and scaling.
> >> - Bjarne Stroustrup
> >>
> >>  http://www.jeffmaury.com
> >>  http://riadiscuss.jeffmaury.com
> >>  http://www.twitter.com/jeffmaury
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe*******
> > For additional commands, e-mail: users-help*******
> >
>
>
>
> --
> Olivier Lamy
> Talend:  http://coders.talend.com
>  http://twitter.com/olamy  |  http://linkedin.com/in/olamy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe*******
> For additional commands, e-mail: users-help*******
>
>

Read more »

If you don't understand the contract, then just don't sign it.

You can always get a lawyer to look this thing over for you too, if
you want to invest in it.

Odds are, if the contract doesn't make sense, or is obscure, there's a
good reason - it benefits them and it hoses you. Just my experience -
take it for what it's worth.

--
You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk*******.
To unsubscribe from this group, send email to rubyonrails-talk unsubscribegooglegroups.com.
For more options, visit this group at  http://groups.google.com/group/rubyorails-talk?hl=en.
Profile Widget
Copy and paste this HTML code to your blog or website: