Reputation: 48208
I'm trying to download all my depenandies and have them available offline, but when I run mvn -o test
, it says The repository system is offline but the artifact commons-io:commons-io:jar:2.4 is not available in the local repository
. However, I have this package in my ~/.m2/repository
!
~/.m2/settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>${user.home}/.m2/repository</localRepository>
<interactiveMode>true</interactiveMode>
<usePluginRegistry>false</usePluginRegistry>
<offline>true</offline>
</settings>
ls ~/.m2/repository/commons-io/commons-io/2.4/
_maven.repositories
commons-io-2.4.jar
commons-io-2.4.jar.lastUpdated
commons-io-2.4.jar.sha1
commons-io-2.4.pom
commons-io-2.4.pom.sha1
[ERROR] Failed to execute goal com.github.temyers:cucumber-jvm-parallel-plugin:2.0.2:generateRunners (generateRunners) on project myproject: Execution generateRunners of goal com.github.temyers:cucumber-jvm-parallel-plugin:2.0.2:generateRunners failed: Plugin com.github.temyers:cucumber-jvm-parallel-plugin:2.0.2 or one of its dependencies could not be resolved:
The repository system is offline but the artifact commons-io:commons-io:jar:2.4 is not available in the local repository. -> [Help 1]
Basically maven says I don't have ~/.m2/repository/commons-io/commons-io/2.4/, but I do!
I tried this:
find ~/.m2/repository -name _maven.repositories -exec rm -v {} \;
but after deleting _maven.repositories
, when I ran mvn -o test
, the file came right back!
I have maven 3.0.5
Upvotes: 4
Views: 7161
Reputation: 48208
These 3 things got it to work (thanks to @Tunaki)
-o
at the END of your mvn command. Example mvn test -o
. When I used it at the beginning, it didn't work*.lastUpdated
files.
find ~/.m2/repository -name *.lastUpdated -exec rm -v {} \;
_maven.repositories
files.
find ~/.m2/repository -name _maven.repositories -exec rm -v {} \;
Note: the settings.xml
made no difference whether it was there or removed. So I don't think it did anything.
Upvotes: 6