I just started with cloudstack and wanted to get the dev environment going. I have Maven installed, and using Eclipse. I've been following this guide, Which seems a bit outdated, but I've been unable to find anything more recent about getting this going in Eclipse.
Versions I'm running:
--Eclipse 4.1
--Maven 3.6.1
--Java 1.8.0_211
--Cloudstack 4.9
Upon importing I'm getting 152 errors (all seem related to maven):
*Description Resource Path Location Type
Missing artifact com.cloud.com.f5:icontrol:jar:1.0 pom.xml /cloud-plugin-network-f5 line 30 Maven Dependency Problem
*Description Resource Path Location Type Missing artifact com.cloud.com.netapp:manageontap:jar:4.0 pom.xml /cloud-plugin-netapp line
30 Maven Dependency Problem
*Description Resource Path Location Type Missing artifact com.cloud.com.vmware:vmware-vim25:jar:6.0 pom.xml /cloud-engine-storage-integration-test line
12 Maven Dependency Problem
*Description Resource Path Location Type Plugin execution not covered by lifecycle configuration:
org.apache.maven.plugins:maven-plugin-plugin:3.1:descriptor
(execution: default-descriptor, phase:
process-classes) pom.xml /Wix-cloudstack-maven-plugin line 16 Maven
Project Build Lifecycle Mapping Problem
*Description Resource Path Location Type The container 'Maven Dependencies' references non existing library
'C:\Users.m2\repository\com\cloud\com\f5\icontrol\1.0\icontrol-1.0.jar' cloud-plugin-network-f5 Build
path Build Path Problem
*Description Resource Path Location Type The import com.cloud.network.schema cannot be
resolved BrocadeVcsApi.java /cloud-plugin-network-vcs/src/com/cloud/network/brocade line
61 Java Problem
Probably a bit late, but may help other people trying this out for the first time.
Adding the Apache Maven repositories should allow you to build, for example I have added Maven Central and Apache Maven repositories with CloudStack 4.13.
This can be done by editing ~/.m2/settings.xml to include mirrors, it is important to use HTTPS not HTTP as this is deprecated and will result in failures by default.
Apache Repository Entry
Entry to be added to configuration.
<mirror>
<id>Apache HTTPS</id>
<mirrorOf>apache</mirrorOf>
<name>Apache (HTTPS)</name>
<url>https://repo.maven.apache.org/maven2/</url>
</mirror>
Example
Mirrors only entry for user.
<settings>
<mirrors>
<mirror>
<id>Central HTTPS</id>
<mirrorOf>central</mirrorOf>
<name>Maven Central (HTTPS)</name>
<url>https://repo1.maven.org/maven2/</url>
</mirror>
<mirror>
<id>Apache HTTPS</id>
<mirrorOf>apache</mirrorOf>
<name>Apache (HTTPS)</name>
<url>https://repo.maven.apache.org/maven2/</url>
</mirror>
</mirrors>
</settings>
Related
I am trying to deploy the Maven build JAR to Github Package Registry.
I am getting exception when I execute mvn deploy command.
I am using a simple Maven project which I want to create a component JAR and store in Github Package Registry.
The build is successful I now want to deploy this artifact to registry.
I have added the below in ~./m2/settings.xml.
Added a repository element under repositories in profile.
<repository>
<id>github</id>
<name>GitHub OWNER Apache Maven Packages</name>
<url>https://maven.pkg.github.com/swastikaa-in</url>
</repository>
<servers>
<server>
<id>github</id>
<username>swastikaa</username>
<password>my personal token from github</password>
</server>
</servers>
Also, I have added the below in Maven project's pom.xml:
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub OWNER Apache Maven Packages</name>
<url>https://maven.pkg.github.com/swastikaa-in/math</url>
</repository>
</distributionManagement>
Expected:
Deployment to be successful , build artifact is deployed to Github package registry.
Actual:
Exception as below:
Caused by: org.eclipse.aether.transfer.MetadataTransferException:
Could not transfer metadata com.redjohn.tools:math:0.0.2-SNAPSHOT/maven-metadata.xml
from/to github (https://maven.pkg.github.com/swastikaa-in/math):
Failed to transfer file https://maven.pkg.github.com/swastikaa-in/math/com/redjohn/tools/math/0.0.2-SNAPSHOT/maven-metadata.xml
with status code 400
Caused by: org.apache.maven.wagon.TransferFailedException:
Failed to transfer file https://maven.pkg.github.com/swastikaa-in/math/com/redjohn/tools/math/0.0.2-SNAPSHOT/maven-metadata.xml
with status code 400
Can someone help me in resolving the issue.
I have followed the instructions provided in the below link:
https://help.github.com/en/articles/configuring-apache-maven-for-use-with-github-package-registry
I had the same problem and I found that snapshot versions don't work well. If you deploy a non snapshot version, it should work.
Inside your settings.xml file, <url>https://maven.pkg.github.com/OWNER/REPOSITORY</url> you need to make use that OWNER is replaced with your github username and REPOSITORY is replaced with the name of your project repository in github.
I am trying to deploy maven artifact to central repository through Travis but I am facing below error:
[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:deploy (injected-nexus-deploy) on project Test-plugin: Execution injected-nexus-deploy of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:deploy failed: Nexus connection problem to URL [https://oss.sonatype.org/ ]: 401 - Unauthorized -> [Help 1]
I have set correct username and password for sonatype account, still I am getting the same error.
Below are the files uploaded:
.travis.yml
settings.xml
Looks like your settings.xml in the .m2 folder in your home directory is not having proper authorization properties set for maven to look
I am enclosing a sample XML for your reference ..
https://maven.apache.org/settings.html
<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"> ... <servers>
<server>
<id>server001</id>
<username>my_login</username>
<password>my_password</password>
<privateKey>${user.home}/.ssh/id_dsa</privateKey>
<passphrase>some_passphrase</passphrase>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
<configuration></configuration>
</server> </servers> ... </settings>
Here is the troubleshooting guide if you are getting 404
https://support.sonatype.com/hc/en-us/articles/213464518-Troubleshooting-Artifact-Download-Failures
From the docs
SNAPSHOT look-ups, or version ranges, or unversioned dependencies (typically plugins) will trigger metadata look-up. If the version referenced by the maven-metadata.xml is not there you will get a 404.
This can usually be fixed by running rebuild metadata on the affected artifact.
I have installed the last version of kepler the one has the maven embedded in it
when I tried many times to create application from any archetype
I always got
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:RELEASE from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Users\onourdean\.m2\repository)
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Users\onourdean\.m2\repository)
even though:
I have deleted the repository folder inside .m2 and its created again by it self
I have downloaded an external maven and used it
I made the proxy in sittings on both the embedded and the external
any other ideas? My 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">
<pluginGroups>
</pluginGroups>
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>stsproxy</host>
<port>8080</port>
<nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
</proxy>
</proxies>
<servers>
</servers>
<mirrors>
</mirrors>
<profiles>
</profiles>
</settings>
Note That:
i have tried all the soultions in the Create a Maven project in Eclipse complains "Could not resolve archetype" except making a variable for maven due to company restriction so is this variable necessary to run the embedded version?
Its seems there is a bug in the embedded version even if i use it outside of the proxy just used the external version
then use wagon-http-lightweight-2.2.jar as described in
Can access maven repository from behind proxy, need help
and its worked
I'm not sure if it's still the same with Kepler, but with earlier Eclipse (and M2E) releases this problem usually goes away if you go to Window -> Preferences -> Maven -> Installations and add your local, external Maven installation, which usually causes Eclipse to pick up the correct settings.xml file.
I'm having some issues to configure properly my eclipse to work with maven.
I create a new project, this one is correctly build with maven in command line (mvn install), but in Eclipse I got this error:
CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 (): ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-settings:jar:2.2.1: ArtifactResolutionException: Failure to transfer org.apache.maven:maven-settings:pom:2.2.1 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-settings:pom:2.2.1 from/to central : NullPointerException pom.xml /test line 9 Maven Project Build Lifecycle Mapping Problem
Here is my settings.xml conf :
<proxy>
<active>true</active>
<protocol>http</protocol>
<username>myuser</username>
<password>$mymdp</password>
<host>myhost</host>
<port>8080</port>
<nonProxyHosts>some.host.com</nonProxyHosts>
</proxy>
....
<repository>
<id>central</id>
<name>central repo m2</name>
<url>http://central.maven.org/maven2</url>
</repository>
I choose the correct maven installation (in Preference -> Maven -> Install)
I also direct my user settings on the correct settings.xml (Preferences -> Maven -> User Settings)
But I still got this error in Eclipse and everything goes well with maven command line. Do you have and idea?
You only need to delete one folder it is throwing error for. Just go to your M2 repo and org/apache/maven/plugins/maven-compiler-plugins and delete the folder 2.3.2
Have you tried to remove the proxy username and password? A similar poster encountered that issue:
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-jar-plugin:2.3.2 or one of its dependencies could not be resolved
Failing that I found the following worked:
Delete project in Eclipse (but do not delete the contents on disk)
Delete all files in your Maven repository
Re-download all Maven dependencies:
mvn dependency:resolve
Start up Eclipse
Ensure that Eclipse is configured to use your external Maven installation (Window->Preferences->Maven->Installations)
Re-import the existing project(s) into Eclipse
Ensure that there are no Maven Eclipse plugin errors on the final screen of the project import
I was getting this problem when using IBM RSA 9.6.1 when building a brand new development machine. The problem for me ended up being because of HTTPS on the Global Maven repository. My solution was to create a Maven settings.xml that forced it to use HTTP.
The key to me was that the central repository was empty when I exploded it under Maven Repositories -- > Global Repositories
Using the following settings file worked for me:
<settings>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>insecurecentral</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>insecurecentral</id>
<!--Override the repository (and pluginRepository) "central" from the Maven Super POM -->
<repositories>
<repository>
<id>central</id>
<url>http://repo.maven.apache.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://repo.maven.apache.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
I got the idea from this stackoverflow question.
The issue has been resolved while installation of the maven settings is provided as External in Eclipse. The navigation settings are Window --> Preferences --> Installations. Select the External as installation Type, provide the Installation home and name and click on Finish. Finally select this as default installations.
I accidentally turned on offline mode.
To disable it: in the Maven tool window, click The Toggle Offline Mode button.
I also got the same issue and not able to create a jar, and I found that in Windows-->Prefernces-->Java-->installed JREs By default JRE was added to the build path of newly
created java project so just changed it to your prefered JDK.
Find your Maven local repository, navigate to maven-compiler-plugin, delete the 3.8.1 folder, so that the Maven will redownload it again.
For example:
C:\Users\mkyong.m2\repository\org\apache\maven\plugins\maven-compiler-plugin
I added below dependency in pom.xml file:
<dependency>
<groupId>org.tuckey</groupId>
<artifactId>urlrewritefilter</artifactId>
<version>4.0.4</version>
</dependency>
I have alot of maven dependencies but when I add the one above I get:
Failed to read artifact descriptor for org.tuckey:urlrewritefilter:jar:4.0.4: Could not transfer artifact org.tuckey:urlrewritefilter:pom:4.0.4 from/to central (http://app1.stage.server.net/artifactory/libs-release): Not authorized, ReasonPhrase:Unauthorized. -> [Help 1]
[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/DependencyResolutionException
this is how the settings.xml file looks:
..
<servers>
<server>
<username>user</username>
<id>central</id>
<password>my-password</password>
</server>
<server>
<username>user</username>
<id>snapshots</id>
<password>my-password</password>
</server>
</servers>
<profiles>
...
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
..
any help? tnx.
I faced this issue when my proxy server was not configured correctly for maven. You should check with your network administrator about proxy server and add the it in settings.xml under conf dir.
You can look for <proxies> tag and update the fields.
When I face this issue, I too felt it happened for just a few jars, but then all other required jar files were already present in my local repository and hence I was getting it for a few jars only.
I had this error trying to deploy to an internal instance of Nexus with a Maven client that was using proxies with no settings. Attempting to access a Nexus instance on the LAN via a proxy resulted in the Not authorized, ReasonPhrase:Unauthorized error.
<nonProxyHosts>internal.hostname</nonProxyHosts> fixed the issue.
Please check access of repository or password which had given in settings.xml
Adding this in case it helps someone else. In my case I was receiving this error and none of the solutions I found seemed to help. In the end I needed to add the config option to settings.xml to set interactiveMode to false.
If you are sure that your mirror links are configured properly in the settings.xml file, then please try this:
Navigate to .m2 -> repositories
Search for "lastupdated"
Delete all the files that come in the search result.
Then do a 'mvn clean install' -> new 'lastupdated' files would be created.
Try to changes groupId for the dependencies which you have added.
It work