为了在一个项目中工作,我试图找到一个可靠的存储库,在那里可以获得jsdt核心文件。
虽然'org.eclipse.jdt:org.eclipse.jdt.core:3.14.0‘是非常容易找到的,但是对于我的Gradle构建,我的jsdt并没有这样的外观。我需要一些网络工具。
当我下载eclipse时,我可以在里面找到jar,并且能够找到组和工件ids。但不是声明依赖关系的存储库。
我找到了贾比隆和阿尔弗雷科,但它们都是2013年的,我还发现了2007年的另一个名字。但我想找出他们把这些罐子放在哪里才能在现在的版本中做出选择。
这就是我要找的包: Bundle-SymbolicName: org.eclipse.wst.jsdt.core,它的组似乎是org.eclipse.webtools.jsdt.bundles
有什么想法吗?
发布于 2018-09-17 05:49:52
发布于 2018-09-17 17:48:25
作为将来的参考,我构建了一个快速脚本来将eclipse排序到一个存储库结构中,这样我们就可以部署它,如果可以的话,并有一个服务器。
import java.io.IOException;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.nio.file.*;
import java.util.*;
import java.util.regex.*;
public final class DirToRepoStructure {
private static final Pattern jarNamePattern = Pattern.compile( "(.*)_(\\d+\\.\\d+\\.\\d+)\\.v?(\\d+)\\.jar" );
public static void main( String[] args ) throws IOException {
Path root = Paths.get( args[ 0 ] );
int rootNameCount = root.getNameCount( );
String rootName = root.getFileName( )
.toString( );
Path tempDir = Files.createTempDirectory( Paths.get( "." ), rootName );
System.out.println( "using temporary directory: " + tempDir );
Path achievePath = tempDir.getParent( )
.resolve( rootName + ".zip" );
System.out.println( "Archiving at: " + achievePath );
DirectoryStream< Path > stream = Files.newDirectoryStream( root, "*.jar" );
stream.forEach( jar -> {
String fullName = jar.getFileName( )
.toString( );
System.out.println( fullName );
Matcher matcher = jarNamePattern.matcher( fullName );
if ( matcher.matches( ) ) {
String jarName = matcher.group( 1 );
String version = matcher.group( 2 );
String snap = matcher.group( 3 );
System.out.println( "reading: " + jarName + ", " + version );
createJarStructure( tempDir, jar, jarName, version, snap );
}
else {
throw new IllegalArgumentException( "file name does not match regex" );
}
} );
try ( FileSystem zipFs = getZipFs( achievePath ) ) {
Files.walk( tempDir )
.skip( rootNameCount )
.forEach( source -> copyIntoZip( zipFs, source, rootNameCount ) );
}
}
private static void copyIntoZip( FileSystem zipFs, Path source, int rootNameCount ) {
try {
Path zipRoot = zipFs.getPath( "/" );
int tempRootNameCount = rootNameCount + 1;
int sourceNameCount = source.getNameCount( );
String newPathName = source.subpath( tempRootNameCount, sourceNameCount )
.toString( );
Path pathInZipFile = zipRoot.resolve( newPathName );
Files.copy( source, pathInZipFile, StandardCopyOption.REPLACE_EXISTING );
}
catch ( IOException e ) {
throw new RuntimeException( e );
}
}
private static void createJarStructure( Path tempDir, Path jar, String jarName, String version, String snap ) {
try {
Path jarRoot = jar.getParent( )
.resolve( jarName )
.resolve( version + "-SNAPSHOT" );
Path jarDirectory = Files.createDirectories( tempDir.resolve( jarRoot ) );
String shortSnap = snap.substring( 0,8 );
Path jarTarget = jarDirectory.resolve( jarName + "-" + version + "-"+ shortSnap + ".jar" ); Files.copy( jar, jarTarget );
}
catch ( IOException e ) {
throw new RuntimeException( e );
}
}
private static FileSystem getZipFs( Path archivePath ) throws IOException {
Map< String, String > env = new HashMap<>( );
env.put( "create", "true" );
env.put( "encoding", StandardCharsets.UTF_8.toString( ) );
System.out.println( archivePath );
URI uri = URI.create( "jar:file:" + archivePath.toAbsolutePath( ) );
return FileSystems.newFileSystem( uri, env );
}
}https://stackoverflow.com/questions/52357234
复制相似问题