[Geoserver-devel] using src/main/resources

Hi all,

I am wondering how people feel about starting to put resource files under src/main/resources and src/test/resources, which is the recommended way of doing things with maven.

The reason I ask is because whenever i write some test case that uses some resources it works great in eclipse, but when i run it in maven boom! Then i remember i have to modify the pom to include the type of file i am using if it is not already there.

Removing the customization would also simplify the pom. We currently have about 40 lines which are just include of the various file types.

Opinions?

-Justin

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Justin Deoliveira ha scritto:

Hi all,

I am wondering how people feel about starting to put resource files under src/main/resources and src/test/resources, which is the recommended way of doing things with maven.

The reason I ask is because whenever i write some test case that uses some resources it works great in eclipse, but when i run it in maven boom! Then i remember i have to modify the pom to include the type of file i am using if it is not already there.

Removing the customization would also simplify the pom. We currently have about 40 lines which are just include of the various file types.

Opinions?

I am ambivalent. I have no issues with the core modules,
but I would find that annoying for the wicket UI ones
where you're usually editing both html and the java file
in parallel. Having them far apart in the eclipse package
tree seems un-natural, unlike most of the other resources
there is a 1-1 relationship with the code they refer to.

In fact there was sort of an uprise in the Wicket land
when the Maven eclipse plugin started to exclude the
.html files from the source folder using a filter in
version 2.6. See:
http://www.nabble.com/maven-eclipse-plugin-2.6-will-break-your-wicket-projects-tp22844953p22844953.html
http://www.nabble.com/Fwd%3A--ANN--Maven-Eclipse-Plugin-2.7-Released-td24020302.html#a24020302

Maybe it makes sense to have two set of rules? The UI
resources should say along with the code and everything
else in resources?

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Good point about wicket. I could see the same argument made for the spring application contexts, it is kind of handy to have them in the source tree.

So yeah, this compromise sounds good to me.

Andrea Aime wrote:

Justin Deoliveira ha scritto:

Hi all,

I am wondering how people feel about starting to put resource files under src/main/resources and src/test/resources, which is the recommended way of doing things with maven.

The reason I ask is because whenever i write some test case that uses some resources it works great in eclipse, but when i run it in maven boom! Then i remember i have to modify the pom to include the type of file i am using if it is not already there.

Removing the customization would also simplify the pom. We currently have about 40 lines which are just include of the various file types.

Opinions?

I am ambivalent. I have no issues with the core modules,
but I would find that annoying for the wicket UI ones
where you're usually editing both html and the java file
in parallel. Having them far apart in the eclipse package
tree seems un-natural, unlike most of the other resources
there is a 1-1 relationship with the code they refer to.

In fact there was sort of an uprise in the Wicket land
when the Maven eclipse plugin started to exclude the
.html files from the source folder using a filter in
version 2.6. See:
http://www.nabble.com/maven-eclipse-plugin-2.6-will-break-your-wicket-projects-tp22844953p22844953.html

http://www.nabble.com/Fwd%3A--ANN--Maven-Eclipse-Plugin-2.7-Released-td24020302.html#a24020302

Maybe it makes sense to have two set of rules? The UI
resources should say along with the code and everything
else in resources?

Cheers
Andrea

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Justin Deoliveira wrote:

I am wondering how people feel about starting to put resource files under src/main/resources and src/test/resources, which is the recommended way of doing things with maven.

I say yes. Maven uses convention over configuration. If you are going to use Maven, follow the convention. We don't want our poms turning into those giant ant scripts we all remember from pre-Maven days. *shudder*

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer, CSIRO Exploration and Mining
Australian Resources Research Centre
26 Dick Perry Ave, Kensington WA 6151, Australia