@@ -13,12 +13,16 @@ const finishedAsync = promisify(finished);
1313
1414const MC_BASE_URL = "https://repo1.maven.org/maven2" ;
1515const MC_SNAPSHOT_BASE_URL = "https://central.sonatype.com/repository/maven-snapshots" ;
16+ const ECLIPSE_BASE_URL = "https://repo.eclipse.org/content/repositories" ;
17+ const ECLIPSE_SNAPSHOT_BASE_URL = "https://repo.eclipse.org/content/repositories" ;
1618
1719const libertyGroupId = "io.openliberty.tools" ;
1820const libertyLemminxArtifactId = "liberty-langserver-lemminx" ;
1921const libertyLSArtifactId = "liberty-langserver" ;
20- const libertyVersion = "2.4" ;
22+ const libertyVersion = "2.4.1 " ;
2123const jakartaGroupId = "org.eclipse.lsp4jakarta" ;
24+ const jakartaJdtArtifactId = "org.eclipse.lsp4jakarta.jdt.core" ;
25+ const jakartaLSArtifactId = "org.eclipse.lsp4jakarta.ls" ;
2226const jakartaVersion = "0.2.5" ;
2327var lclsReleaseLevel = "releases" ; //snapshots or releases
2428var jakartaReleaseLevel = "releases" ;
@@ -86,29 +90,22 @@ gulp.task("downloadLibertyLSJars", async function() {
8690 ] ) ;
8791} ) ;
8892
89- //https://repo.eclipse.org/service/local/artifact/maven/content?r=snapshots&g=org.eclipse.lsp4jakarta&a=org.eclipse.lsp4jakarta.jdt.core&v=0.0.1-SNAPSHOT
90- //https://repo.eclipse.org/service/local/artifact/maven/content?r=snapshots&g=org.eclipse.lsp4jakarta&a=org.eclipse.lsp4jakarta.ls&c=jar-with-dependencies&v=0.0.1-SNAPSHOT
91- const eclipseRepoURL = "https://repo.eclipse.org/service/local/artifact/maven/content" ;
92- const jakartaReleaseLevelString = "?r=" + jakartaReleaseLevel ;
93- const jakartaGroupIdString = "&g=" + jakartaGroupId ;
94- const jakartaVersionString = "&v=" + jakartaVersion ;
95- const jakartaClassifierString = "&c=jar-with-dependencies" ;
96-
97- const jakartaJDTURL = eclipseRepoURL + jakartaReleaseLevelString + jakartaGroupIdString + "&a=org.eclipse.lsp4jakarta.jdt.core" + jakartaVersionString ;
98- const jakartaLSURL = eclipseRepoURL + jakartaReleaseLevelString + jakartaGroupIdString + "&a=org.eclipse.lsp4jakarta.ls" + jakartaClassifierString + jakartaVersionString ;
99-
100- gulp . task ( "downloadLSP4JakartaJars" , ( done ) => {
101- download ( {
102- url : jakartaJDTURL ,
103- file : jakartaJdtName ,
104- } )
105- . pipe ( gulp . dest ( "./jars" , { encoding : false } ) ) ;
106- download ( {
107- url : jakartaLSURL ,
108- file : jakartaLSName ,
109- } )
110- . pipe ( gulp . dest ( "./jars" , { encoding : false } ) ) ;
111- done ( ) ;
93+ gulp . task ( "downloadLSP4JakartaJars" , async function ( ) {
94+ var jakartaJDTURL ;
95+ var jakartaLSURL ;
96+
97+ if ( jakartaReleaseLevel === "snapshots" ) {
98+ jakartaJDTURL = getEclipseJarURL ( jakartaGroupId , jakartaJdtArtifactId , jakartaVersion , null , true ) ;
99+ jakartaLSURL = getEclipseJarURL ( jakartaGroupId , jakartaLSArtifactId , jakartaVersion , "jar-with-dependencies" , true ) ;
100+ } else {
101+ jakartaJDTURL = getEclipseJarURL ( jakartaGroupId , jakartaJdtArtifactId , jakartaVersion , null , false ) ;
102+ jakartaLSURL = getEclipseJarURL ( jakartaGroupId , jakartaLSArtifactId , jakartaVersion , "jar-with-dependencies" , false ) ;
103+ }
104+
105+ await Promise . all ( [
106+ downloadJar ( jakartaJDTURL , jakartaJdtName , "./jars" ) ,
107+ downloadJar ( jakartaLSURL , jakartaLSName , "./jars" )
108+ ] ) ;
112109} ) ;
113110
114111function mvnw ( ) {
@@ -130,6 +127,12 @@ async function downloadJar(url, fileName, destDir) {
130127 } ) ;
131128
132129 console . log ( `Downloading ${ url } ` ) ;
130+
131+ // Ensure destination directory exists
132+ if ( ! fs . existsSync ( destDir ) ) {
133+ fs . mkdirSync ( destDir , { recursive : true } ) ;
134+ }
135+
133136 const fullPath = path . join ( destDir , fileName ) ;
134137 const writer = fs . createWriteStream ( fullPath ) ;
135138 response . data . pipe ( writer ) ;
@@ -145,6 +148,16 @@ function getMavenCentralJarURL (groupId, artifactId, version, classifier) {
145148 return mavenCentralJarURL ;
146149}
147150
151+ // Generate Eclipse repository artifact URL for specified GAV coordinates
152+ // Example: https://repo.eclipse.org/content/repositories/lsp4jakarta-maven2-releases/org/eclipse/lsp4jakarta/org.eclipse.lsp4jakarta.jdt.core/0.2.5/org.eclipse.lsp4jakarta.jdt.core-0.2.5.jar
153+ function getEclipseJarURL ( groupId , artifactId , version , classifier , isSnapshot ) {
154+ const repoName = isSnapshot ? "lsp4jakarta-maven2-snapshots" : "lsp4jakarta-maven2-releases" ;
155+ const baseURL = isSnapshot ? ECLIPSE_SNAPSHOT_BASE_URL : ECLIPSE_BASE_URL ;
156+ const classifierString = classifier ? `-${ classifier } ` : '' ;
157+ const eclipseJarURL = `${ baseURL } /${ repoName } /${ groupId . replace ( / \. / g, '/' ) } /${ artifactId } /${ version } /${ artifactId } -${ version } ${ classifierString } .jar` ;
158+ return eclipseJarURL ;
159+ }
160+
148161// No API provided to retrieve snapshot artifacts hosted on https://central.sonatype.com/repository/maven-snapshots
149162// Can access maven-metadata.xml using GAV coordinates for artifacts
150163// Will parse retrieved maven-metadata.xml for full artifact version, including timestamp
0 commit comments