maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg_Vau...@Countrywide.Com
Subject Re: checkstyle plugins: maven and eclipse
Date Fri, 05 Oct 2007 16:01:17 GMT
For the .checkstyle file, I just configured the eclipse prefs UI to point 
to a http url. It was pretty straightforward IIRC. Just poke through the 
checkstyle plugin UI. I think I did it in the project specific settings 
(project properties?). That's what creates the .checkstyle file. Otherwise 
it's stored in the workspace.

On the other point, use build-helper-maven-plugin to deploy the xml file 
as well as the jar.
http://mojo.codehaus.org/build-helper-maven-plugin/howto.html 
attach-artifact section has an example.

-Greg

"Jim Sellers" <jim.sellers@gmail.com> wrote on 10/05/2007 08:15:32 AM:

> Hi Greg.
> 
> A couple of questions:
> "The .checkstyle file can point to the xml file in the maven repo."
> - how does it do this?  Can you please provide an example?
> 
> "There's only one source xml config file, but it gets deployed twice."
> - Are you doing that manually?  Do you have it done with maven?  Is so,
> could you provide an example of that or point me in the right direction?
> 
> Thanks for your time!
> Jim
> 
> 
> On 10/4/07, Greg_Vaughn@countrywide.com <Greg_Vaughn@countrywide.com> 
wrote:
> >
> > Thanks for mentioning that, Dimitris. I forgot about that piece. 
They're
> > not mutually exclusive though. The .checkstyle file can point to the 
xml
> > file in the maven repo.
> >
> > houzecl, I don't think I was clear enough in my first message. I have 
both
> > the xml in a jar and the xml out of a jar in the maven repo. Maven 
uses
> > the one in the jar. The eclipse plugin uses the one out of the jar.
> > There's only one source xml config file, but it gets deployed twice. 
It's
> > not quite optimal, but it was close enough for our purposes.
> >
> > Someone else commented that you can add extra info in a parent pom for 
the
> > eclipse plugin that will add the metadata for checkstyle when
> > eclipse:eclipse goal is run. We went with more of Dimitris' approach 
here.
> > The .checkstyle file is part of our archetypes to make the eclipse 
plugin
> > happy. But we do use the jar file for maven invocation.
> >
> > -Greg Vaughn
> >
> > Dimitris Kapanidis <dimitris@itconsulting.gr> wrote on 10/04/2007 
03:47:17
> > AM:
> >
> > > I have another solution to this problem, which is not the maven way 
but
> > > works equally.
> > >
> > > I have uploaded the file on a web server and accessing it from 
there:
> > >
> > > Eclipse is using .checkstyle config to see the remote location of 
the
> > > configuration (there is an option for remote file)
> > > Maven is using the parent pom.xml to see the same remote location of 
the
> >
> > > configuration.
> > >      <plugin>
> > >                 <artifactId>maven-checkstyle-plugin</artifactId>
> > >                 <configuration>
> > >
> > >
> > <configLocation>http://www.someplace.net/scytl_checkstyle.xml
> > </configLocation>
> > >                 </configuration>
> > >      </plugin>
> > >
> > > I'd prefer the jar solution though, is much cleaner.
> > >
> > > houzecl wrote:
> > > > Yes, the last part of your post is what we'd like to do:
> > > >
> > > > One mavenized projet holding a set of configuration files.
> > > > So that you can version, deploy, and access the jar containing the
> > > > appropriate set of rules.
> > > > We do not want to embed the rules inside the project(s) that will 
be
> > using
> > > > the rules.
> > > > we want these rules to be common (as sun_checks).
> > > >
> > > > Therefore, once the rules'jar is available in the repository, it 
can
> > be
> > > > accessed by maven (no probs)
> > > > BUT how can you make it available to eclipse at the same time ? 
(do
> > you
> > > > explode the jar in the repository when you deploy it ?, so that
> > eclipse
> > > > checkstyle can reference the xml files ...)
> > > >
> > > > anyway, I posted the question in checkstyle mailing list.
> > > > If I get an answer, I'll post it
> > > >
> > > > good day,
> > > >
> > > > Christian-Luc
> > > >
> > > >
> > > >
> > > > Greg_Vaughn wrote:
> > > >
> > > >>> I am using maven-checkstyle-plugin with a specific configuration
> > file
> > > >>> (I made it as a resource in a jar and the plugin configuration

works
> >
> > > >>>
> > > >> fine:
> > > >>
> > > >>> checkstyle - or the plugin - is clever enough to get the xml 
file
> > out of
> > > >>>
> > > >> the
> > > >>
> > > >>> dependency jar)
> > > >>>
> > > >>> I'd like to do the same within eclipse with the
> > > >>>
> > > >> eclipse-checkstyle-plugin
> > > >>
> > > >>> (so that checkstyle can be active during eclipse work, not just

when
> > > >>> building with maven)
> > > >>> Unfortunately the checkstyle preference window does not seem to
> > allow a
> > > >>> reference to a jar.
> > > >>> it needs an xml file
> > > >>> This is not really a maven question but someone may know if my
> > request
> > > >>>
> > > >> is
> > > >>
> > > >>> possible ???
> > > >>>
> > > >> We did this last year, but the details aren't fresh on my mind. 
Let
> > me
> > > >> know
> > > >> if this general approach is not enough.
> > > >>
> > > >> We attached the checkstyle xml file to the project so it was 
deployed
> >
> > > >> along
> > > >> with the jar file to our corporate maven repository. Since that
> > repository
> > > >> is available via http, we configured the eclipse plugin to use 
that
> > url.
> > > >>
> > > >> Now we have one mavenized project to manage the checkstyle rules.
> > When we
> > > >> deploy it, the checkstyle rules become available to both maven 
and
> > eclipse
> > > >> at the same time.
> > > >>
> > > >> -Greg Vaughn
> > > >>
> > > >>
> > > >>
> > ======================================================================
> > > >>
> > > >> Confidentiality Notice: The information contained in and 
transmitted
> > with
> > > >> this communication is strictly confidential, is intended only for

the
> > use
> > > >> of the intended recipient, and is the property of Countrywide
> > Financial
> > > >> Corporation or its affiliates and subsidiaries. If you are not 
the
> > > >> intended recipient, you are hereby notified that any use of the
> > > >> information contained in or transmitted with the communication or
> > > >> dissemination, distribution, or copying of this communication is
> > strictly
> > > >> prohibited by law. If you have received this communication in 
error,
> > > >> please immediately return this communication to the sender and 
delete
> > the
> > > >> original message and any copy of it in your possession.
> > > >>
> > > >>
> > ======================================================================
> > > >>
> > > >>
> > > >>
> > > >>
> > > >
> > > >
> > >
> > >
> > > 
---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> >
> >
> > ======================================================================
> >
> > Confidentiality Notice: The information contained in and transmitted 
with
> > this communication is strictly confidential, is intended only for the 
use of
> > the intended recipient, and is the property of Countrywide Financial
> > Corporation or its affiliates and subsidiaries. If you are not the 
intended
> > recipient, you are hereby notified that any use of the 
informationcontained
> > in or transmitted with the communication or dissemination, 
distribution, or
> > copying of this communication is strictly prohibited by law. If you 
have
> > received this communication in error, please immediately return this
> > communication to the sender and delete the original message and any 
copy of
> > it in your possession.
> >
> > ======================================================================
> >
> >


======================================================================

Confidentiality Notice: The information contained in and transmitted with this communication
is strictly confidential, is intended only for the use of the intended recipient, and is the
property of Countrywide Financial Corporation or its affiliates and subsidiaries. If you are
not the intended recipient, you are hereby notified that any use of the information contained
in or transmitted with the communication or dissemination, distribution, or copying of this
communication is strictly prohibited by law. If you have received this communication in error,
please immediately return this communication to the sender and delete the original message
and any copy of it in your possession.

======================================================================


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message