java - How to build without using locally installed artifacts -
Is there any way to force Maven to use remote artifacts and not installed on your machine? Since I worry about runtime errors and the creation of compilation errors server is not a valid option.
PS I know that I can delete or rename the .m2 folder, but I'm sure there is some more clever way of doing this. Maybe some plugin or special command is the ultimate?
Having a local repository does not mean that your classpath has almost completely URL on remote server I do not know why this will be supported because execution will be horrible, and any dropped connection will result in classloader issues. Having a local store ensures that jar is available before compilation / execution begins.
Also consider that war and ER projects (and many who use dependency plugin) rely on downloading jars to complete their packaging. If they were to be obtained from a remote repository on every build, then there would be a huge load of land. I am pretty sure that the Central Managers will not be keen to deal with that load.
Some options for your idea:
- If you have a clean local repository on each build, you can use the target of the dependency plugin.
- If you want to keep the build separate, you can use different Maven settings by passing- Dorg.apache.maven.global-settings =. /path/to/global/settings.xml
- Alternatively you can go to DimWen.repo.local = / some / repo / path
- If you want to avoid killing a remote repository on each build, click on the & lt; UpdatePolicy & gt; Never & lt; / UpdatePolicy & gt; Add in your remote repository configuration means that Maven will only check for updates if you force it with the "-U" switch on the command line
- If you want to get the latest version of dependency You can use the latest keyword in the version (instead of the version number), although it can be risky if the dependency is incompatible.
- If you want to take the current release version of any dependency, you can use the RELEASE keyword version version (instead of version number). It's like the latest, but the latest stable build is compared to the latest.
- If you want to get the latest version of dependency within a range, use the Maven version range notation, for example [1.0.0.2.0.0) means 1.0.0 to any Also see Version 2.0.0 Exclusive
for more details on the latest and relay.
If you use an internal store manager (mandatory and reference here), then the local repository becomes very low on netting - you can set the local network in bus Traffic loads will increase.
Comments
Post a Comment