i have set arquillian project , works fine locally when running maven build on our continuous integration box fails. managed bottom of problem , because maven user settings.xml file on ci box has server definitions (for project) whereas locally machine default file (with no servers defined). tests throw runtimeexception because mavenresolver goes looking settings-security.xml file doesn't exist on ci box.
i prefer not go adding settings-security.xml , instead provide resolver 'empty' settings.xml file, or better, tell not use one. possible?
i tried answer thread https://developer.jboss.org/thread/174873 pretty says add following option failsafe plugin:
<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <version>2.9</version><!-- or upper --> <configuration> <systempropertyvariables> <org.apache.maven.user-settings>nonexistentsetting.xml</org.apache.maven.user-settings> </systempropertyvariables> </configuration> </plugin> if , provide xml file doesnt exist work fine command line running 'mvn clean install' when debug within ide still fails.
is there way can either: tell maven resolver not use settings.xml / use 'default' file create empty settings.xml in project , tell maven resolver use that
i did try following line in code build archive didnt seem have effect:
.addaslibraries(maven.configureresolver().fromfile("test-settings.xml").loadpomfromfile("pom.xml").importruntimedependencies().resolve().withtransitivity().asfile()) thanks help, craig
shrinkwrap resolver default loads settings-security.xml
default_settings_security_path = userhome == null ? ".settings-security.xml" : userhome.concat("/.m2/settings-security.xml").replace('/', file.separatorchar); but can override location setting
system.setproperty(mavensettingsbuilder.alt_security_settings_xml_location, "somedir/empty-settings-security.xml"); when alternative location (non-empty string) provided theoretically should skip default location. not 100% sure method work.
Comments
Post a Comment