Hi there Geode Dev List,

Whilst doing work on 
GEODE-8466<https://issues.apache.org/jira/browse/GEODE-8466> and looking at the 
functionality that the 
ClassPathLoader.java<https://github.com/apache/geode/blob/develop/geode-core/src/main/java/org/apache/geode/internal/ClassPathLoader.java>,
 
JarDeployer.java<https://github.com/apache/geode/blob/develop/geode-core/src/main/java/org/apache/geode/internal/JarDeployer.java>
 and 
DeployedJar.java<https://github.com/apache/geode/blob/develop/geode-core/src/main/java/org/apache/geode/internal/DeployedJar.java>
 provide around the “Deploy Jar” functionality, we came across some interesting 
“supported” filename patterns.

According to the 
JarDeployerFileTest.java<https://github.com/apache/geode/blob/develop/geode-core/src/integrationTest/java/org/apache/geode/internal/JarDeployerFileTest.java>
 the “supported” formats are as follows:

assertThat(JarDeployer.getArtifactId("abc.jar")).isEqualTo("abc");
assertThat(JarDeployer.getArtifactId("abc-1.jar")).isEqualTo("abc");
assertThat(JarDeployer.getArtifactId("ab.c.1.jar")).isEqualTo("ab.c");
assertThat(JarDeployer.getArtifactId("abc.v1.jar")).isEqualTo("abc.v1");
assertThat(JarDeployer.getArtifactId("abc-1.0.snapshot.jar")).isEqualTo("abc");
assertThat(JarDeployer.getArtifactId("abc-1.0.v1.jar")).isEqualTo("abc");
assertThat(JarDeployer.getArtifactId("spark-network-common_2.11-2.3.1.jar"))
    .isEqualTo("spark-network-common_2");
Which don’t make any sense. As the generally accepted norm for a version jar 
file would be: “<artifact name>[ - <major> . <minor> . <patch> - <Release Tag> 
] .jar”. (note the syntax in red)

I want to suggest that we DISCONTINUE supporting all jar name formats other 
than the one mentioned above IMMEDIATELY. As the supported name format is just 
“funky” but also wrong and can lead to misclassification of the artifact name…. 
as some of you with a keen eye would have spotted already 😉

For those who did not spot the mistake…  “spark-network-common_2.11-2.3.1.jar” 
is incorrectly classified and has the WRONG artifact name. As 
“spark-network-common_2.11” is the correct artifact name NOT 
“spark-network-common_2”!

I would like to introduce this change with 
GEODE-8466<https://issues.apache.org/jira/browse/GEODE-8466>. This would be a 
“breaking” change, but we should change this sooner than later. There is no 
transition ability here, as it would be too hard to have Geode support both, as 
there is no simple way for the system to decide if the name conforms to the 
“correct” format or not.

DISCUSS!!!

--Udo

Reply via email to