Maven Nexus Issue - Authorization failed for 403 Forbidden - java

We have been on this issue for days now.
Created a Gitlab CI Pipeline for a Java App that reads dependencies from Maven and Nexus
The gitlab pipeline was configured to run as a nexus user with admin rights, this has been verified many times.
But, when the gitlab pipeline is executed we get the following error:
[ERROR] Failed to execute goal on project hello-component: Could not resolve dependencies for project x.y.z:hello-component:jar:1.6-SNAPSHOT: Failed to collect dependencies at a.b:c:jar:4.5.1132100: Failed to read artifact descriptor for b:c:jar:4.5.1132100: Could not transfer artifact a.b:c:pom:4.5.1132100 from/to maven-snapshots (http://host:8081/repository/maven-snapshots): Authorization failed for http://host:8081/repository/maven-snapshots/a/b/c/4.5.1132100/nidp-4.5.1132100.pom 403 Forbidden -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project hello-component: Could not resolve dependencies for project x.y.z:hello-component:jar:1.6-SNAPSHOT: Failed to collect dependencies at a.b:c:jar:4.5.1132100
I have also used the following guide:
https://blog.sonatype.com/how-to-use-gitlab-ci-with-nexus
My POM has the below, with env variables configured in ci/cd/settings/variables:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<serverId>maven-snapshots</serverId>
<nexusUrl>http://host:8081/repository/maven-snapshots</nexusUrl>
<skipStaging>true</skipStaging>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>maven-snapshots</id>
<url>http://host:8081/repository/maven-snapshots</url>
</repository>
<repository>
<id>maven-releases</id>
<url>http://host:8081/repository/maven-releases</url>
</repository>
<!--repository>
<id>nexus.local</id>
<url>$HOME/.m2/repository</url>
</repository-->
</repositories>
<distributionManagement>
<snapshotRepository>
<id>maven-snapshots</id>
<url>http://host:8081/repository/maven-snapshots</url>
</snapshotRepository>
<repository>
<id>maven-releases</id>
<url>http://host:8081/repository/maven-releases</url>
</repository>
</distributionManagement>
The Gitlab CI runner has the following:
image: maven:3.3.9-jdk-8
variables:
GIT_STRATEGY: clone
MAVEN_CLI_OPTS: "-s /opt/apache-maven-3.6.3/conf/settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=/home/gitlab-runner/.m2/repository"
cache:
paths:
- /home/gitlab-runner/.m2/repository/
- target/
stages:
- build
CodeBuild:
stage: build
script:
- /opt/apache-maven-3.6.3/bin/mvn $MAVEN_CLI_OPTS -X clean package
artifacts:
name: “x—y-component"
paths:
- ./target/x—y-component.jar
Setting.xml on gitlab ci server has the following nexus user reference:
maven-snapshots
[adminuser]
[adminpassword]
Any help will be most appreciated.
Thanks

not sure if help is still needed but it seems that You did not grant necessary privileges to role of the user which You use for deployment/resolving dependencies. Please grant role nx-repository-view---* privilege. Test it and then you can decrease scope depend on your needs.

The issue at the time was with corporate proxy blocking download from maven central etc
Edit the proxies section in your maven settings.xml, which could be located in your ~/.m2/settings.xml file.
Settings.xml also exists in your MAVEN_HOME, so ensure you are updating the correct settings.xml
<settings>
<proxies>
<proxy>
<id>httpproxy</id>
<active>true</active>
<protocol>http</protocol>
<host>your-proxy-host</host>
<port>your-proxy-port</port>
<nonProxyHosts>add.host.that.needs.to.bypass.proxy.here|some.host.com</nonProxyHosts>
</proxy>
<proxy>
<id>httpsproxy</id>
<active>true</active>
<protocol>https</protocol>
<host>your-proxy-host</host>
<port>your-proxy-port</port>
<nonProxyHosts>add.host.that.needs.to.bypass.proxy.here|some.host.com</nonProxyHosts>
</proxy>
</proxies>
</settings>

Related

readyapi/maven integration - couldn't transfer artifact

Updating question; I am trying to implement readyapi with maven, followed the steps here https://support.smartbear.com/readyapi/docs/integrations/maven/example.html#pom but not able to resolve plugin issue. Any help?
<repository>
<id>com.teamdev</id>
<url>https://europe-maven.pkg.dev/jxbrowser/releases</url>
</repository>
</repositories>
<!-- Add the SmartBear ReadyAPI plugin repository. -->
<!-- Maven will download the plugin from the specified URL. -->
<pluginRepositories>
<pluginRepository>
<id>SmartBearPluginRepository</id>
<url>http://smartbearsoftware.com/repository/maven2</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>com.smartbear</groupId>
<artifactId>ready-api-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<projectFile>Sample-SOAP-project.xml</projectFile>
<readyApiProperties>
<property>
<name>readyAPI</name>
<value>C:\per\ReadyAPI\ReadyAPI-3.0.0\bin</value>
</property>
</readyApiProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>```
I was trying to integrate maven through pom and it didn't work so I installed packages manually
This is the root cause of the problem. You did so manually and maven can't find them now.
Let's do this the proper way. Create a pom, which tries to import the necessary dependencies using mvn and then post it here. It will be easier to debug that than to figure out how to add dependencies of the right version manually.
Edit your post with the new pom and post a comment here.
EDIT:
OK, so the reason why you are unable to download this stuff from Maven, its because maven blocks blocks external HTTP repositories by default since some version.
Here's a solution from the mvn team about how to fix this.

Maven: can not package local jar into final jar with maven and the error is java.lang.NoClassDefFoundError

The local jar is copied into /src/main/resources/, and add Maven dependency as How to add local jar files to a Maven project?
<dependency>
<groupId>com.yahoo.egads</groupId>
<artifactId>egads</artifactId>
<version>0.4.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/egads-0.4.0-jar-with-dependencies.jar</systemPath>
</dependency>
The plugin is as following:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
The class of local jar can be located in IntelliJ IDEA and the main function can run successfully in IntelliJ IDEA button run. But error when running the final packaged jar, the class of local jar cannot be found with log java.lang.NoClassDefFoundError.
During packaging there is the following warning:
'dependencies.dependency.systemPath' for com.yahoo.egads:egads:jar should not point at files within the project directory, ${project.basedir}/src/main/resources/egads-0.4.0-jar-with-dependencies.jar will be unresolvable by dependent projects # line 36, column 25
How to add local jar files to a Maven project?
This video solved the problem for me.
https://www.youtube.com/watch?v=3nGwbRONhEU
Using Netbeans, it was as simply as adding the dependency (in your case it would be):
In your "pom.xml" file:
...
com.yahoo.egads
egads
0.4.0
...
Then Open the dependencies folder and;
right click the "egads-0.4.0.jar"
then click on manually install artifact
search for your .jar file and select it
Finally, right on your project and "Clean and Build"
I
After doing the "Clean and Build" if the following error appears:
Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Then the following worked 100% for me:
(thanks to the reference: Maven dependencies are failing with a 501 error)
Add in your "pom.xml" file (in Project Settings, as long as you created a maven java project):
<project>
...
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
Then, right click on your project, press -> Clean and Build.
If "Succeded" then that's it.
Else... (more errors) try (the last thing I can recommend):
Put in your "settings.xml" file (in your Project Settings, near the pom.xml), just the following:
<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>
<offline>false</offline>
</settings>
It is not assured that the following will work:
(try under your own risk of losing your time, and patience..)
If that doesn't work and you still have errors I just can say other things that I did before but it isn't assured that they will work (here it goes):
https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
Remove all the "<" and ">" and execute that command with your custom parameters in the command line.
I executed that while being in ~/.m2/repository
(/.m2/repository)
Hope it worked for you.
I spent too much time today trying to solve this. The first post about this on stackoverflow is full of confusing things, bad explained and that isn't working at least for me. But well.
I would have commented there but I got no points.
Original post (very confusing / bad explained):
How to add local jar files to a Maven project?
I also had in my "pom.xml" the following (after having tried so much things I can't remember)
Write in "" your Java Source Package (the parent of your .java classes):
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.mycompany.app</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
And finally, I also had this on my "settings.xml" file:
<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 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>${user.home}/.m2/repository</localRepository>
<interactiveMode>true</interactiveMode>
<offline>false</offline>
</settings>
(I'm putting this on the final part because probbably with the first thing it will work, but if not you cant try to do all that I did wich I'm putting in the final part, just in case)
Also, all the links that were usefull for me, are these:
Wiki:
https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
https://techglimpse.com/create-maven-jar-file-netbeans-tutorial/
http://maven.apache.org/general.html#importing-jars
(I just remember going straight to the point "have a jar that I want to put into my local repository. How can I copy it in?")
https://www.youtube.com/watch?v=3nGwbRONhEU
(I'm not puting the docens of useless links)

Execute Appium test cases via Appcenter task in Azure Devops pipeline

How to configure correctly and execute the test cases using Appcenter task in the Azure VSTS pipeline.
In the repository, have two directories {source, testcase} in the parent directory. The build executes in hosted Mac OS triggered by VSTS pipleline.
In the first task, from source directory, create the .apk file and copy to artifacts staging directory.
In the second task, Run the Automated test cases using Appcenter task "Test with Visual Studio App Center".
I am having trouble understanding, how appium works and make it work via VSTS pipeline.
In the first approach, after the .apk buil then would like to execute the test cases using Appcenter and Appium. but it was not successful since one of my test case file has hardcoded values like below.
have one file /src/test/java/company/domain/com/util/android/UtilSetup.java which has hardcoded values like below. because of hard-coded values, it was looking for appium and it throws connection issues. so went on to second approach to make the pipeline work.
public class UtilSetupAndroid {
public static EnhancedAndroidDriver<MobileElement> driverAndroid;
public static void setupAndroid() throws MalformedURLException {
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, Platform.ANDROID);
caps.setCapability("platformVersion", "7.0");
caps.setCapability("deviceName", "hexa-decimal-value-here");
caps.setCapability("udid", "same-hexa-decimal-value-here");
caps.setCapability("appPackage", "cl.company.transformacion.appcompanymobile");
caps.setCapability("appActivity",
"cl.company.transformacion.appcompanymobile.enrolamiento.activity.CargaInicialActivity");
caps.setCapability("app", "/home/directory/Appium-test/project.apk");
caps.setCapability("unicodeKeyboard", true);
caps.setCapability("resetKeyboard", true);
URL url = new URL("http://localhost:4723/wd/hub");
driverAndroid = Factory.createAndroidDriver(url, caps);
driverAndroid.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
}
}
In the second approach, did a local build(mvn test) and it has generated the *.class files of test cases. The committed the "test-classes" directory in the test cases build directory and referred in Appium configration secion. Committing the *.class files is not right approach i believe, but to make the pipeline work, did it like this.
Then, build pipeline started executing the Appium but ended with unresolved dependency error. I had the same issue and to overcome the issue, added the company nexus repository to directly download from Nexus. but still error occurs.
pom.xml has dependencies like below:
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>6.1.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.appcenter</groupId>
<artifactId>appium-test-extension</artifactId>
<version>1.0</version>
</dependency>
build section like below:
<profiles>
<profile>
<id>prepare-for-upload</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>3.0.0-M3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/upload/dependency-jars/</outputDirectory>
<useRepositoryLayout>true</useRepositoryLayout>
<copyPom>true</copyPom>
<addParentPoms>true</addParentPoms>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-help-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>generate-pom</id>
<phase>package</phase>
<goals>
<goal>effective-pom</goal>
</goals>
<configuration>
<output>${project.build.directory}/upload/pom.xml</output>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-testclasses</id>
<phase>package</phase>
<goals>
<goal>testResources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/upload/test-classes</outputDirectory>
<resources>
<resource>
<directory>${project.build.testOutputDirectory}</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>3.0.0-M3</version>
</plugin>
</plugins>
</reporting>
<repositories>
<repository>
<id>jcenter</id>
<url>https://jcenter.bintray.com/</url>
</repository>
</repositories>
</profile>
</profiles>
<repositories>
<repository>
<id>COMPAY_NAME.cl</id>
<url>http://maven.COMPANY_NAME.cl/nexus/content/repositories/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>COMPANY_NAME.cl</id>
<url>http://maven.COMPANY_NAME.cl/nexus/content/repositories/public/</url>
</repository>
</distributionManagement>
Error message:
Reason: [INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building run-test 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.microsoft.appcenter:appium-test-extension:jar:1.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.958 s
[INFO] Finished at: 2019-06-19T01:45:22+02:00
[INFO] Final Memory: 9M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project run-test: Could not resolve dependencies for project com.xamarin.appium:run-test:jar:1.0-SNAPSHOT: Could not find artifact com.microsoft.appcenter:appium-test-extension:jar:1.0 in cache1 (http://cache1:6081/maven2) -> [Help 1]
[EDIT]
Additional information, my pom.xml does not have the project in "com.xamarin.appium". It seems the error from App Center. Also the maven repo in the output is not my maven repository.
The REST call from appcenter-cli to App Center is returned with status 2xx for first few calls and finally throws the error.
[command]/usr/local/bin/appcenter test prepare appium --artifacts-dir /Users/vsts/agent/2.153.2/work/1/a/AppCenterTest --build-dir /Users/vsts/agent/2.153.2/work/1/s/Test/test_case --debug --quiet
Using appcenter-cli version: 1.1.18
Preparing tests... done.
Tests are ready to run. Manifest file was written to /Users/vsts/agent/2.153.2/work/1/a/AppCenterTest/manifest.json
[command]/usr/local/bin/appcenter test run manifest --manifest-path /Users/vsts/agent/2.153.2/work/1/a/AppCenterTest/manifest.json --app-path /Users/vsts/agent/2.153.2/work/1/a/AppCOMPMobile.apk --app COMPchile/AppAndroid --devices COMPchile/set-pruebas-vsts --test-series pruebas --locale en_US --debug --quiet --token ***
Using appcenter-cli version: 1.1.18
Preparing tests... done.
(truncated)
Response status code: 200
Body: {"message":["Tests completed. Processing data."],"wait_time":10,"exit_code":null}
Current test status: Tests completed. Processing data.
logFilter, request: {
"rawResponse": false,
"queryString": {},
"url": "https://api.appcenter.ms/v0.1/apps/COMPchile/COMPAppAndroid/test_runs/b8b88f0f-226c-4564-98b5-dc582cca81c8/state",
"method": "GET",
"headers": {
"Content-Type": "application/json; charset=utf-8",
"user-agent": "appcenterCli/1.1.18 NodeJS/v6.17.0 darwin/18.6.0",
"x-api-token": ***
},
"body": null
}
Response status code: 200
Body: {"message":["Failed!","Reason: [INFO] Scanning for projects...\n[INFO] \n[INFO] ------------------------------------------------------------------------\n[INFO] Building run-test 1.0-SNAPSHOT\n[INFO] ------------------------------------------------------------------------\n[WARNING] The POM for com.microsoft.appcenter:appium-test-extension:jar:1.5 is missing, no dependency information available\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD FAILURE\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time: 2.132 s\n[INFO] Finished at: 2019-06-21T19:23:12+02:00\n[INFO] Final Memory: 10M/309M\n[INFO] ------------------------------------------------------------------------\n[ERROR] Failed to execute goal on project run-test: Could not resolve dependencies for project com.xamarin.appium:run-test:jar:1.0-SNAPSHOT: Could not find artifact com.microsoft.appcenter:appium-test-extension:jar:1.5 in cache1 (http://cache1:6081/maven2) -\u003e [Help 1]\n[ERROR] \n[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.\n[ERROR] Re-run Maven using the -X switch to enable full debug logging.\n[ERROR] \n[ERROR] For more information about the errors and possible solutions, please read the following articles:\n[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException\n"],"wait_time":10,"exit_code":2}

Maven Build Failure with "mvn install" command

I was trying to generate and test my codes (if working) for Cucumber-Maven report then opened command prompt. I have tried "mvn clean", it was BUILD SUCCESS. After that, I have tried "mvn install" and encountered BUILD FAILURE (error was shown).
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.844 s
[INFO] Finished at: 2019-02-05T13:14:51+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:2.20 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.20: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.20 from/to central (https://repo.maven.apache.org/maven2): Connect to webproxy.sample.com:8080 [webproxy.sample.com/205.165.7.13] failed: Connection timed out: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Here's my pom.xml:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
</plugin>
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>4.3.0</version>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>ExecuteCucumberMavenAF</projectName>
<outputDirectory>${project.build.directory}/cucumber-reports-html</outputDirectory>
<cucumberOutput>${project.build.directory}/cucumber.json</cucumberOutput>
<skippedFails>true</skippedFails>
<enableFlashCharts>true</enableFlashCharts>
<buildNumber>42</buildNumber>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
It looks like proxy issue which is blocking the downloads of dependencies, so make some changes in settings.xml or create a one if it is not there.
Goto c:\users\youruser\.m2\settings.xml.
<?xml version="1.0" encoding="UTF-8"?>
<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
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<proxies>
<proxy>
<id>myproxy</id>
<active>true</active>
<protocol>http</protocol>
<username>user</username> <!-- Put your username here -->
<password>pass</password> <!-- Put your password here -->
<host>123.45.6.78</host> <!-- Put the IP address of your proxy server here -->
<port>80</port> <!-- Put your proxy server's port number here -->
<nonProxyHosts>maven</nonProxyHosts> <!-- Do not use this setting unless you know what you're doing. -->
</proxy>
</proxies>
</settings>
I tried using eclipse. I used maven clean and install for the same POM file. It is working fine.
Seems there is some issue with your C:\users\youruser\.m2\settings.xml file.
May be proxy issues which is blocking maven from downloading dependencies.
Please check your settings.xml file.

How to get/publish multi-module maven project site into a folder

I have multi-module maven project. I can see generated project dosumentation after mvn site, but it is in every module target folder.
how to get maven project site into one folder?
(I don't really need to deploy, I will put generated site manually into GitHub pages.)
Plugin docs:
http://maven.apache.org/plugins/maven-site-plugin/
References <distributionManagement> <site> section, but there is no trace how to make output into a defined folder.
Also tried mvn site:jar - it make .jar again in every module target.
I would recommend to use the site-maven-plugin following part to distribute generated sites to github:
<profile>
<id>github</id>
<build>
<plugins>
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.8</version>
<configuration>
<message>Creating site for ${project.version}</message>
<server>github</server>
</configuration>
<executions>
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>post-site</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
To preview your site before publishing you can use the stage goal of maven-site-plugin like this:
mvn site:stage -DstagingDirectory=C:\fullsite

Categories