How to run Tomcat 7 using Maven 2 Tomcat plugin? - maven-2

I am using Maven 2 and I have an external Tomcat 7. I was wondering how to run Tomcat 7 from using Maven Tomcat plugin.
And does Maven Tomcat plugin in Maven 3 runs the Tomcat 7 by default.
Thanks.

This works for me: http://tomcat.apache.org/maven-plugin-2.1/
With this plugin config:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<path>/</path>
</configuration>
</plugin>
And running with
mvn clean install tomcat7:run
(Please note that tomcat7:run, not tomcat:run.)
Plugin documentation is here: http://tomcat.apache.org/maven-plugin-2.1/tomcat7-maven-plugin/plugin-info.html
For example, the default value of additionalConfigFilesDir is ${basedir}/src/main/tomcatconf, so if you put your configs into this directory it will be used on tomcat7:run.
mvn -X tomcat7:run prints the configration, for example:
[DEBUG] (f) additionalConfigFilesDir = /workspace/webtest1/src/main/tomcatconf
[DEBUG] (f) configurationDir = /workspace/webtest1/target/tomcat
...
[DEBUG] (f) path = /webtest1
...
[DEBUG] (f) port = 8080
[DEBUG] (f) project = ...:webtest1:0.0.1-SNAPSHOT # /workspace/webtest1/pom.xml
...
[DEBUG] (f) warSourceDirectory = /workspace/webtest1/src/main/webapp
Note that warSourceDirectory points to src (not target), so it runs as an usual dynamic web project, you could change your JSPs, HTMLs and it will visible immediately. That's why the target/tomcat/webapps folder is empty.

Have you tried the tomcat 7 plugin?

Related

Apache Isis Security Module: Required table missing : "ISISSECURITY.APPLICATIONROLE"

I created an application using the apache isis simpleapp-archetype and then added the dependencies (isis-module-security-dom and jbcrypt) of the security module to my pom.xml's and the modules and services to my DomainAppAppManifest.
After running mvn clean install on the project the following error happens in the integration tests module:
[INFO] introspecting org.apache.isis.applib.services.iactn.Interaction: class-level details
[INFO] calling #PostConstruct on all domain services
seed-users-and-roles-fixture-script : EXEC org.isisaddons.module.security.seed.SeedUsersAndRolesFixtureScript
seed-users-and-roles-fixture-script/global-tenancy : EXEC org.isisaddons.module.security.seed.scripts.GlobalTenancy
[INFO] abort transaction IsisTransaction#517e381b[state=MUST_ABORT,commands=0]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Simple App ......................................... SUCCESS [ 0.608 s]
[INFO] Simple App DOM ..................................... SUCCESS [ 14.607 s]
[INFO] Simple App Fixtures ................................ SUCCESS [ 1.285 s]
[INFO] Simple App Application ............................. SUCCESS [ 2.204 s]
[INFO] Simple App Integration Tests ....................... FAILURE [ 17.539 s]
[INFO] Simple App Webapp .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.654 s
[INFO] Finished at: 2016-09-26T18:44:48+07:00
[INFO] Final Memory: 65M/572M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.isis.tool:isis-maven-plugin:1.13.0:swagger (default) on project groupid-demo-integtests: Execution default of goal org.apache.isis.tool:isis-maven-plugin:1.13.0:swagger failed: org.datanucleus.store.rdbms.exceptions.MissingTableException: Required table missing : "ISISSECURITY.APPLICATIONROLE" in Catalog "" Schema "ISISSECURITY". DataNucleus requires this table to perform its persistence operations. Either your MetaData is incorrect, or you need to enable "datanucleus.schema.autoCreateTables"
-> [Help 1]
In principle I followed the documentation found in the security module github repository, but this didn't really work at all, and by taking a look at the quickstart module I figured the security dependencies needed to be added to the parent POM, and the the bcrypt dependency needs to be added to the App POM, and the security-plugin dependency to the Dom POM.
To reproduce the error, this is the what I did:
Create project with archetype
mvn archetype:generate -D archetypeGroupId=org.apache.isis.archetype -D archetypeArtifactId=simpleapp-archetype -D archetypeVersion=1.13.0 -D groupId=my.groupid -D artifactId=groupid-demo -D version=1.0-SNAPSHOT -D archetypeRepository=http://repository-estatio.forge.cloudbees.com/snapshot/ -B
Then in /groupid-demo/pom.xml I added these dependencies:
<dependency>
<groupId>org.isisaddons.module.security</groupId>
<artifactId>isis-module-security-dom</artifactId>
<version>1.13.1</version>
</dependency>
<dependency>
<groupId>org.mindrot</groupId>
<artifactId>jbcrypt</artifactId>
<version>0.3m</version>
</dependency>
In /groupid-demo-app/pom.xml I added this dependency:
<dependency>
<groupId>org.mindrot</groupId>
<artifactId>jbcrypt</artifactId>
</dependency>
In /groupid-demo-app/src/main/java/domainapp/app/DomainAppAppManifest.java I modified the modules and services as follows:
#Override
public List<Class<?>> getModules() {
return Arrays.asList(
DomainAppDomainModule.class, // domain (entities and repositories)
DomainAppFixtureModule.class, // fixtures
DomainAppAppModule.class // home page service etc
,org.isisaddons.module.security.SecurityModule.class
);
}
#Override
public List<Class<?>> getAdditionalServices() {
return Arrays.asList(
org.isisaddons.module.security.dom.password.PasswordEncryptionServiceUsingJBcrypt.class
);
}
In /groupid-demo-dom/pom.xml I added this dependency:
<dependency>
<groupId>org.isisaddons.module.security</groupId>
<artifactId>isis-module-security-dom</artifactId>
</dependency>
And then /groupid-demo-webapp/src/main/webapp/WEB-INF/shiro.ini has been modified like this:
[main]
....
# to use .ini file
# securityManager.realms = $iniRealm
isisModuleSecurityRealm=org.isisaddons.module.security.shiro.IsisModuleSecurityRealm
authenticationStrategy=org.isisaddons.module.security.shiro.AuthenticationStrategyForIsisModuleSecurityRealm
securityManager.authenticator.authenticationStrategy = $authenticationStrategy
securityManager.realms = $isisModuleSecurityRealm
Finally I executed mvn clean install on the root pom and got above error.
Any idea what I am missing here? This is really just a bare bone simpleapp-archetype app with the only modification applied being the added security module.
Yes, I hit the same issue today when putting together this demo app for the issue you raised on the Apache Isis mailing list.
The issue is that the maven plugin, which generates the swagger spec, uses its own AppManifest, and that manifest needs to correctly reference security.
Since I didn't want to get side-tracked on this, I simply disabled the swagger goal in the pom.xml (remove the '!' exclamation mark).
HTH
Dan

How to analyze low-level OSGi problems during tycho test execution?

When executing JUnit test with tycho-surefire-plugin, tycho forks an equinox runtime.
In rare cases it may happen that some bundles in the OSGi test runtime cannot be resolved/started (e.g. package uses conflicts).
If you read the debug log (maven CLI option -X), you will find something like
!ENTRY org.eclipse.osgi 2 0 2012-10-08 16:41:31.635
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2012-10-08 16:41:31.635
An error has occurred. See the log file
C:\mytestproject.tests\target\work\configuration\1349705136008.log.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:03.181s
[INFO] Finished at: Mon Oct 08 16:17:16 CEST 2012
[INFO] Final Memory: 20M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.15.0:test (default-test) on project mytestproject.tests: An unexpected error occured (return c
ode 13). See log for details. -> [Help 1]
The eclipse console log does not provide enough information in case of package uses conflicts.
How can I analyze the bundles in the OSGi test runtime forked by tycho?
start tests in remote debug mode (simply specify -DdebugPort=8000 on the CLI) and start the OSGi console on a local port, e.g. 1234:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<systemProperties>
<osgi.console>1234</osgi.console>
</systemProperties>
</configuration>
</plugin>
Set a breakpoint in one of your test classes or in org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter if tests are not even started. Then,
telnet localhost 1234
and you can use the usual OSGi console commands like ss, diag, bundle etc. to analyze the problem "in vivo".
Alternatively you can run with -consolelog or set the eclipse.consoleLog property to true property. If you're running with Tycho, you can use <argLine>-Declipse.consoleLog=true</argLine>.

error in deploying jar to remote repository in maven

i am trying to deploy a jar file from my local machine to a remote machine which has an artifactory. I tried the following command :
mvn deploy:deploy-file -DgroupId=<some-id>
-DartifactId=<some-artifact>
-Dversion=<version>
-Dpackaging=jar
-Dfile=<path to the file in my local system>
-Durl=http://<ip of remote machine>:<port>/artifactory/repo/
-DrepositoryId=<artifactory -id in remote machine>
but on executing it gives error that:
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'deploy'.
[INFO] -----------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [deploy:deploy-file] (aggregator-style)
[INFO] -----------------------------------------------------------------------
[INFO] -----------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] -----------------------------------------------------------------------
[INFO] One or more required plugin parameters are invalid/missing for 'deploy:
ploy-file'
[0] Inside the definition for plugin 'maven-deploy-plugin' specify the following
:
<configuration>
...
<url>VALUE</url>
</configuration>
-OR-
on the command line, specify: '-Durl=VALUE'
As i am specifying the value for Durl in my command why am i still getting this error?
How to resolve this?
The maven version is 2.2.1
Thanks.
Answered in comments:
Not sure about the Maven error itself, but I did notice that the
deployment URL points to Artifactory's "/repo" repository (which is a
global virtual aggregator of all the repositories in the instance);
since it's a virtual repository, one cannot deploy to it; you should
point the URL to one of Artifactory's local repositories
(libs-release-local, etc.). – noamt Jan 20 '12 at 8:44
i changed it to local repo name but still same error – pranay Jan 20
'12 at 13:02
yes i got it wokring now..actually was putting the wrong url ..thanks
a lot – pranay Jan 25 '12 at 6:33

maven in 5 min not working

I have downloaded latest
maven 3.0.3, java version "1.6.0_18".
mvn –version
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: C:\software\apache-maven-3.0.3
Java version: 1.5.0_05, vendor: Sun Microsystems Inc.
Java home: C:\software\jdk1.5.0.15\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"
My application located at: C:\Temp\ecm_esv\app\ENT_APP\ESV>. I am getting following error message:
C:\Temp\ecm_esv\app\ENT_APP\ESV>mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.4.1: 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
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.3.1: Plugin org.apache.maven.plugins:maven-install-plugin:2.3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.5/maven-deploy-plugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.5: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.5
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-site-plugin/2.0.1/maven-site-plugin-2.0.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:2.0.1: Plugin org.apache.maven.plugins:maven-site-plugin:2.0.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:2.0.1
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.1: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.0/maven-release-plugin-2.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.0: Plugin org.apache.maven.plugins:maven-release-plugin:2.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:jar:2.0
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.406s
[INFO] Finished at: Mon Apr 18 15:51:05 CEST 2011
[INFO] Final Memory: 1M/3M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Temp\ecm_esv\app\ENT_APP\ESV), central (http://repo1.maven.org/maven2)] -> [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/NoPluginFoundForPrefixException
C:\Temp\ecm_esv\app\ENT_APP\ESV>
C:\software\apache-maven-3.0.3\conf\settings.xml
I have enabled proxies here as:
….
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|-->
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>www.BT.co.uk</host>
<port>80</port>
<nonProxyHosts>localhost|google.com</nonProxyHosts>
</proxy>
</proxies>
What is the problem I am facing here? Why it is not downloading?
Found solution:
Solution #1:
issue was with proxy in settings.xml file:
<host>webproxy</host>
to get host goto IE->tools->connection->LAN settings->advanced->http.
=====
Solution #2:
if auto configured proxy is given: then
1> open IE(or any browser)
2> get the url address from your browser through IE->Tools->internet option->connections->LAN Settings-> get address and give in url eg: as http://autocache.abc.com/ and enter, a file will be downloaded with .pac format, save to desktop
3> open .pac file in textpad, identify PROXY:
In your editor, it will come something like:
return "PROXY web-proxy.ind.abc.com:8080; PROXY proxy.sgp.abc.com:8080";
4> go to Maven settings.xml and enter as:
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>web-proxy.ind.abc.com</host>
<port>8080</port>
</proxy>
5> run mvn:install through command prompt or run through eclipse.
=====
Solution #3:
For any other issues delete maven local repository and run mvn:install again.
Clearly this is an issue of proxy. Either use VPN or edit procy setting in setting.xml.
I searched lot about this error. Finally, I used VPN(Virtual private network ) to disable the proxy and was able to use cemtral repository of Maven.
Window-Preferences-Maven-User Settings. Check, does settings.xml exists? if eclipse says no, get settings.xml from you friend or set the path to it.
Try checking proxy settings in settings.xml file located under following directory:
C:\Users\UserName\.m2
I just copied setting.xml which comes under "\apache-maven-3.1.1\conf" directory, to the directory "${user.home}/.m2/)" of windows machine and change the required proxy setting according to my network as below and it worked for me.
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>www-proxy.xxxx</host>
<port>8080</port>
</proxy>
Thanks --
Kamran Shahzad
We have observed that the maven project creation fails when it tries to download the archtype from this URL: Maven Repository which falls under "https" protocol.
So solution #2 mentioned above worked only after a little change to the settings.xml. Instead of using "http" protocol I have to use "https"
<proxy>
<id>optional</id>
<active>true</active>
<protocol>https</protocol>
<host>web-proxy.ind.abc.com</host>
<port>8080</port>
Hope it helps someone.
Note: Make sure that you check the following internet settings.
Internet Explorer > Internet Options > Connections [TAB] > LAN Settings > Under Proxy server check Use proxy server for LAN > Advanced > Check "same proxy server for all protocols" and Click OK.
Adding below under proxy tag in settings.xml worked for me
<proxy>
<id>optional</id>
<active>true</active>
<protocol>https</protocol>
<host>web-proxy.ind.abc.com</host>
<port>8080</port>
</proxy>

Set plugin’s version on the command line in Maven 2

I generate default quickstart Maven example, and type mvn checkstyle:checkstyle, it always try to use the lastest SNAPSHOT version. Probably it is wrong in my Nexus server, but how can I set plugin's version on the command line in Maven 2, like 2.5 for checkstyle instead of 2.6-SNAPSHOT?
C:\HelloWorld>mvn checkstyle:checkstyle
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'checkstyle'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.apache.maven.plugins:maven-checkstyle-plugin
Reason: Error getting POM for 'org.apache.maven.plugins:maven-checkstyle-plugin' from the repository: Failed to resolve artifact, possibly due to a repository list that is not appropriately equipped for this artifact's metadata.
org.apache.maven.plugins:maven-checkstyle-plugin:pom:2.6-SNAPSHOT
from the specified remote repositories:
nexus (http://localhost:9081/nexus/content/groups/public)
for project org.apache.maven.plugins:maven-checkstyle-plugin
I guess it could be mvn checkstyle:2.5:checkstyle, unfortunately it is not.
Surely if I set build dependance in pom.xml, it will work, but I want to see how command line can work.
If you don't want to run the latest version of a plugin installed in your local repository, you need to set the version number. And for that, you need to specify a fully-qualified goal in the form of:
mvn groupID:artifactID:version:goal
So in your case:
mvn org.apache.maven.plugins:maven-checkstyle-plugin:2.5:checkstyle
mvn org.apache.maven.plugins:maven-site-plugin:3.7.1:site
My experience with a newer version of maven(3.3.9) is slightly different. If I'm not running maven in offline mode, it will ALWAYS go for a remote repo regardless of what I have in the local one.
And if it finds a newer version(based on maven-metadata.xml), it will download and use that one. What's more, it will scan multiple repos simultaneously:
[INFO] ------------------------------------------------------------------------
[DEBUG] Resolving plugin version for com.phoenixnap.oss:springmvc-raml-plugin
[DEBUG] Could not find metadata com.phoenixnap.oss:springmvc-raml-plugin/maven-metadata.xml in local (/home/yuranos/.m2/repository)
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.spring.io/libs-milestone
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.spring.io/milestone
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.maven.apache.org/maven2
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.spring.io/snapshot
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.spring.io/libs-milestone
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.spring.io/milestone
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.maven.apache.org/maven2
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.spring.io/snapshot
Downloading: https://repo.spring.io/libs-milestone/com/phoenixnap/oss/springmvc-raml-plugin/maven-metadata.xml
Downloading: https://repo.spring.io/snapshot/com/phoenixnap/oss/springmvc-raml-plugin/maven-metadata.xml
Downloading: https://repo.maven.apache.org/maven2/com/phoenixnap/oss/springmvc-raml-plugin/maven-metadata.xml
Downloading: https://repo.spring.io/milestone/com/phoenixnap/oss/springmvc-raml-plugin/maven-metadata.xml
[DEBUG] Writing tracking file /home/yuranos/.m2/repository/com/phoenixnap/oss/springmvc-raml-plugin/resolver-status.properties
[DEBUG] Writing tracking file /home/yuranos/.m2/repository/com/phoenixnap/oss/springmvc-raml-plugin/resolver-status.properties
Downloaded: https://repo.maven.apache.org/maven2/com/phoenixnap/oss/springmvc-raml-plugin/maven-metadata.xml (2 KB at 1.0 KB/sec)
[DEBUG] Writing tracking file /home/yuranos/.m2/repository/com/phoenixnap/oss/springmvc-raml-plugin/resolver-status.properties
Downloaded: https://repo.spring.io/libs-milestone/com/phoenixnap/oss/springmvc-raml-plugin/maven-metadata.xml (2 KB at 0.9 KB/sec)
[DEBUG] Writing tracking file /home/yuranos/.m2/repository/com/phoenixnap/oss/springmvc-raml-plugin/resolver-status.properties
[DEBUG] Could not find metadata com.phoenixnap.oss:springmvc-raml-plugin/maven-metadata.xml in spring-snapshots (https://repo.spring.io/snapshot)
[DEBUG] Could not find metadata com.phoenixnap.oss:springmvc-raml-plugin/maven-metadata.xml in spring-milestones-libs (https://repo.spring.io/milestone)
What's more, maven seems to know how to compare several metadata files and select the very latest version of the artifact.
Maven makes use of Aether to resolve dependencies, based on what I see in resolver-status.properties:
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
#Mon Feb 19 23:41:24 EET 2018
maven-metadata-spring-milestones.xml.lastUpdated=1519076484366
maven-metadata-spring-snapshots.xml.error=
maven-metadata-central.xml.lastUpdated=1519076484205
maven-metadata-spring-snapshots.xml.lastUpdated=1519076484107
maven-metadata-spring-milestones-libs.xml.lastUpdated=1519076484105
maven-metadata-spring-milestones-libs.xml.error=
You can also use:
mvn {your groupId}:{your artifactId}:{your version}:{your goal}