Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 528563

Summary: GroupId / namespace convention for scala project
Product: [LocationTech] JTS Reporter: Jody Garnett <jody.garnett>
Component: ServersAssignee: Eclipse Webmaster <webmaster>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: 28

Description Jody Garnett CLA 2014-08-14 12:03:12 EDT
The following discussion from the mailing list is worth a bug ticket. Expectation is this issue can be resolved with some research into scala project best practices.

On observation of of java projects switching package structure (for example to org.locationtech.geomesa) mild alarm was raised on behalf of the geotrellis project written in scala

Rob Emanuele:
  I'm not sure if the switch from the namespace being 'geomesa' to
  'org.locationtech.geomesa' was due to a requirement, but I'm hoping
  not. I'm very against having to change the actual package namespace to
  'org.locationtech.geotrellis' for GeoTrellis. Scala packages commonly
  have short names, ...
Comment 1 Jody Garnett CLA 2014-08-14 12:41:34 EDT
This may be a quick ticket, maven central provides pretty clear instructions on groupId based on domain name control. Nothing says the contents of the resulting jar have to follow java conventions - I expect they jar contents can be perfectly happen with shorter scala package names.
Comment 2 Rob Emanuele CLA 2014-08-14 13:12:00 EDT
Most of the major scala packages don't follow the reverse URL package naming convention. The groupId however does follow the convention, and I think that we definitely need to follow that convention in order to fit in with the maven repository architecture.

Here's some popular scala libraries that use the project-name-only approach to package naming:

play
spray
akka
dispatch
scalaz
spire
shapeless
argonaut
monocle
slick

I believe having LocationTech and Eclipse scala projects following this naming convention will best serve the projects, as it allows them to follow conventions used in the Scala community, rather then seeming like Scala projects trying to fit a Java mold.
Comment 3 Jody Garnett CLA 2014-08-14 13:32:41 EDT
So if you are content Rob you can either mark this ticket as resolved, or wait until you actually publish close the issue at that time (i.e. when you know this approach works).
Comment 4 Jody Garnett CLA 2014-08-14 13:34:26 EDT
Found the following for reference:

* http://docs.scala-lang.org/style/naming-conventions.html

They do not seem to match with your expectations...

------
Scala packages should follow the Java package naming conventions:

// wrong!
package coolness
// right!
package com.novell.coolness
// right, for package object com.novell.coolness
package com.novell
/**
 * Provides classes related to coolness
 */
package object coolness {
}
------
Comment 5 Eclipse Genie CLA 2014-08-14 13:43:18 EDT
I've created some sections in the "namespace" guidance document [1] and took a first crack at the group id. I'll try to edit this document as this develops; feel free to tweak what needs tweaking.

[1] https://wiki.eclipse.org/Development_Resources/HOWTO/The_Eclipse_Code_Namespace_Policy
Comment 6 Rob Emanuele CLA 2014-08-14 13:52:02 EDT
This is true. I'm not sure why the Scala style docs are so out of line with what the community is actually doing. You'd think that if that was the capital-S Standard for scala, on the site that TypeSafe maintains, then projects like Akka and Play, which are TypeSafe projects, would be packaged as 

com.typesafe.akka
com.typesafe.play

which they are certainly not. I'm not sure if this the style guide is intentionally trying to go against what the community is doing, or just trying to fit in with Java conventions while knowingly breaking them in their own projects, but this contradiction doesn't seem like it should make us in line with what someone put on a scala doc rather then what the community is actually doing.

I'll post something on the scala-lang mailing list to see what their opinion is.

(In reply to Jody Garnett from comment #4)
> Found the following for reference:
> 
> * http://docs.scala-lang.org/style/naming-conventions.html
> 
> They do not seem to match with your expectations...
> 
> ------
> Scala packages should follow the Java package naming conventions:
> 
> // wrong!
> package coolness
> // right!
> package com.novell.coolness
> // right, for package object com.novell.coolness
> package com.novell
> /**
>  * Provides classes related to coolness
>  */
> package object coolness {
> }
> ------