dreedyman / Rio

Rio is an open source technology that provides a dynamic architecture for developing, deploying and managing distributed systems composed of services.
Apache License 2.0
21 stars 17 forks source link

using File.pathSeparator for classpath separator is probably a bug #31

Closed rafalkrupinski closed 11 years ago

rafalkrupinski commented 11 years ago

org.rioproject.config.PlatformCapabilityConfig#getClasspath() uses File.pathSeparator as a separator for classpath entries. This property is Operating System dependent, making platform configuration file also OS-dependent.

dreedyman commented 11 years ago

Why would this be a bug? The File.pathSeparator is used because it is operating system dependent.

rafalkrupinski commented 11 years ago

Ah, I see the problem: you've switched to groovy config, while we use old platform.xml files. It's easy to use pathSeparator in groovy, but it makes impossible to write portable xml.

We will switch to groovy format, but I'd still like to provide list of artifact coordinates as a classPath, similar to #32.

I can make this change if you're willing to include it. Then you could configure a capability this way:

configs << new PlatformCapabilityConfig(
    "Commons Compress",
    "1.0",
    "Apache Commons Compress",
    "Apache Software Foundation",
    ["commons-commpress:commons-compress:20050911"]
)
dreedyman commented 11 years ago

On Apr 15, 2013, at 207PM, Rafał Krupiński wrote:

Ah, I see the problem: you've switched to groovy config, while we use old platform.xml files. It's easy to use pathSeparator in groovy, but it makes impossible to write portable xml.

We will switch to groovy format, but I'd still like to provide list of artifact coordinates as a classPath, similar to #32.

I can make this change if you're willing to include it. Then you could configure a capability this way:

configs << new PlatformCapabilityConfig( "Commons Compress", "1.0", "Apache Commons Compress", "Apache Software Foundation", ["commons-commpress:commons-compress:20050911"] )

But you can do that already by just using the Resolver.

ResolverHelper.getResolver().getClassPathFor("commons-commpress:commons-compress:20050911") why add code?

rafalkrupinski commented 11 years ago

On 15.04.2013 20:14, Dennis Reedy wrote:

On Apr 15, 2013, at 207PM, Rafał Krupiński wrote:

Ah, I see the problem: you've switched to groovy config, while we use old platform.xml files. It's easy to use pathSeparator in groovy, but it makes impossible to write portable xml.

We will switch to groovy format, but I'd still like to provide list of artifact coordinates as a classPath, similar to #32.

I can make this change if you're willing to include it. Then you could configure a capability this way:

configs << new PlatformCapabilityConfig( "Commons Compress", "1.0", "Apache Commons Compress", "Apache Software Foundation", ["commons-commpress:commons-compress:20050911"] )

But you can do that already by just using the Resolver.

ResolverHelper.getResolver().getClassPathFor("commons-commpress:commons-compress:20050911") why add code?

That's for single classpath entry. For more you would have to concatenate it with the separator:

ResolverHelper.getResolver().getClassPathFor("commons-commpress:commons-compress:20050911")

I'm not sure what you are referring to. getClassPathFor returns the classpath required to load the artifact. I see no reason to modify and code at this point.