Set update policy on the runelite repo directly. It appears this doesn't work on releases though. Use developer-mode switch.
This commit is contained in:
@@ -60,7 +60,6 @@ public class ArtifactResolver
|
|||||||
|
|
||||||
LocalRepository localRepo = new LocalRepository(repositoryCache.getAbsolutePath());
|
LocalRepository localRepo = new LocalRepository(repositoryCache.getAbsolutePath());
|
||||||
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
|
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
|
||||||
session.setUpdatePolicy(RepositoryPolicy.UPDATE_POLICY_ALWAYS); // this causes a refetch of maven-metadata.xml, but not any binaries
|
|
||||||
|
|
||||||
//session.setTransferListener(new ConsoleTransferListener());
|
//session.setTransferListener(new ConsoleTransferListener());
|
||||||
//session.setRepositoryListener(new ConsoleRepositoryListener());
|
//session.setRepositoryListener(new ConsoleRepositoryListener());
|
||||||
@@ -99,7 +98,9 @@ public class ArtifactResolver
|
|||||||
|
|
||||||
public RemoteRepository newRuneliteRepository()
|
public RemoteRepository newRuneliteRepository()
|
||||||
{
|
{
|
||||||
return new RemoteRepository.Builder("runelite", "default", "http://repo.runelite.net/").build();
|
return new RemoteRepository.Builder("runelite", "default", "http://repo.runelite.net/")
|
||||||
|
.setPolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_FAIL))
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validate(List<ArtifactResult> artifacts)
|
private void validate(List<ArtifactResult> artifacts)
|
||||||
|
|||||||
@@ -15,9 +15,13 @@ import org.eclipse.aether.artifact.Artifact;
|
|||||||
import org.eclipse.aether.artifact.DefaultArtifact;
|
import org.eclipse.aether.artifact.DefaultArtifact;
|
||||||
import org.eclipse.aether.resolution.ArtifactResult;
|
import org.eclipse.aether.resolution.ArtifactResult;
|
||||||
import org.eclipse.aether.resolution.DependencyResolutionException;
|
import org.eclipse.aether.resolution.DependencyResolutionException;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class ClientLoader
|
public class ClientLoader
|
||||||
{
|
{
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(ClientLoader.class);
|
||||||
|
|
||||||
private static final String CLIENT_ARTIFACT_URL = "https://static.runelite.net/client.json";
|
private static final String CLIENT_ARTIFACT_URL = "https://static.runelite.net/client.json";
|
||||||
|
|
||||||
public Applet load() throws MalformedURLException, ClassNotFoundException, IOException, InstantiationException, IllegalAccessException, DependencyResolutionException
|
public Applet load() throws MalformedURLException, ClassNotFoundException, IOException, InstantiationException, IllegalAccessException, DependencyResolutionException
|
||||||
@@ -26,9 +30,18 @@ public class ClientLoader
|
|||||||
|
|
||||||
config.fetch();
|
config.fetch();
|
||||||
|
|
||||||
// the only thing resolved here is the injected client, which has no dependencies, so no need to switch developer mode
|
ArtifactResolver resolver;
|
||||||
ArtifactResolver resolver = new ArtifactResolver(RuneLite.REPO_DIR);
|
if (!RuneLite.getOptions().has("developer-mode"))
|
||||||
resolver.addRepositories();
|
{
|
||||||
|
resolver = new ArtifactResolver(RuneLite.REPO_DIR);
|
||||||
|
resolver.addRepositories();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
resolver = new ArtifactResolver(new File(System.getProperty("user.home"), ".m2/repository"));
|
||||||
|
|
||||||
|
logger.info("In developer mode, not fetching updates for client");
|
||||||
|
}
|
||||||
|
|
||||||
List<ArtifactResult> results = resolver.resolveArtifacts(getClientArtifact());
|
List<ArtifactResult> results = resolver.resolveArtifacts(getClientArtifact());
|
||||||
File client = results.get(0).getArtifact().getFile();
|
File client = results.get(0).getArtifact().getFile();
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public class RuneLite
|
|||||||
public static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite");
|
public static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite");
|
||||||
public static final File REPO_DIR = new File(RUNELITE_DIR, "repository");
|
public static final File REPO_DIR = new File(RUNELITE_DIR, "repository");
|
||||||
|
|
||||||
public static OptionSet options;
|
private static OptionSet options;
|
||||||
private static Client client;
|
private static Client client;
|
||||||
private static RuneLite runelite;
|
private static RuneLite runelite;
|
||||||
|
|
||||||
@@ -67,4 +67,9 @@ public class RuneLite
|
|||||||
{
|
{
|
||||||
return renderer;
|
return renderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static OptionSet getOptions()
|
||||||
|
{
|
||||||
|
return options;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user