I have the following settings.xml file in my project organizationsservice:
<?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">
<servers>
<server>
<username>${env.MAVEN_REPO_USERNAME}</username>
<password>${env.MAVEN_REPO_PASSWORD}</password>
<id>central</id>
</server>
<server>
<username>${env.MAVEN_REPO_USERNAME}</username>
<password>${env.MAVEN_REPO_PASSWORD}</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<id>saathratri-profile</id>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<id>central</id>
<name>default-maven-virtual</name>
<url>https://saathratri.jfrog.io/artifactory/default-maven-virtual</url>
</repository>
<repository>
<snapshots>
<updatePolicy>always</updatePolicy>
</snapshots>
<id>snapshots</id>
<name>default-maven-virtual</name>
<url>https://saathratri.jfrog.io/artifactory/default-maven-virtual</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>saathratri-profile</activeProfile>
</activeProfiles>
</settings>
I include the following in my pom.xml:
...
<dependencies>
<dependency>
<groupId>com.saathratri.organizations.domain</groupId>
<artifactId>saathratri-organizations-domain</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
...
However, when I run the following command mvn -s settings.xml dependency:list, only the maven-metadata.xml file is downloaded. The saathratri-organizations-domain-2.0-SNAPSHOT.jar nor the
saathratri-organizations-domain-2.0-SNAPSHOT.pom are not downloaded.
See below output from the command:
➜ organizationsservice git:(master) ✗ mvn -s settings.xml dependency:list
[INFO] Scanning for projects...
[INFO]
[INFO] ---------< com.saathratri.organizations:organizationsservice >----------
[INFO] Building Organizationsservice 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from snapshots: https://saathratri.jfrog.io/artifactory/default-maven-virtual/com/saathratri/organizations/domain/saathratri-organizations-domain/2.0-SNAPSHOT/maven-metadata.xml
Downloaded from snapshots: https://saathratri.jfrog.io/artifactory/default-maven-virtual/com/saathratri/organizations/domain/saathratri-organizations-domain/2.0-SNAPSHOT/maven-metadata.xml (376 B at 565 B/s)
INFO]
[INFO] --- maven-dependency-plugin:2.8:list (default-cli) # organizationsservice ---
[INFO]
[INFO] The following files have been resolved:
[INFO] org.springframework.boot:spring-boot-starter-oauth2-client:jar:2.4.4:compile
[INFO] org.junit.jupiter:junit-jupiter-engine:jar:5.7.1:test
...
Please advise why the pom and jar are not being downloaded.
Thanks and Happy Father's Day to all dads.
Edit1: The Artifactory URL:
https://saathratri.jfrog.io/artifactory/default-maven-local/com/saathratri/organizations/domain/saathratri-organizations-domain/2.0-SNAPSHOT/``` has the following contents:
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/c9Qwj.png
Edit2:
mvn -s settings.xml dependency:list
[INFO] Scanning for projects...
...
Downloading: http://repository.jboss.org/nexus/content/groups/public/jboss/web/servlet-api/2.1.0.GA/servlet-api-2.1.0.GA.pom
Downloaded: http://repository.jboss.org/nexus/content/groups/public/jboss/web/servlet-api/2.1.0.GA/servlet-api-2.1.0.GA.pom (195 B at 0.2 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/jboss/web/servlet-api/2.1.0.GA/servlet-api-2.1.0.GA.jar
Downloaded: http://repository.jboss.org/nexus/content/groups/public/jboss/web/servlet-api/2.1.0.GA/servlet-api-2.1.0.GA.jar (84 KB at 90.8 KB/sec)
Are the pom and jar actually present in the correct place in your jfrog?
Related
I want use screen-recorder via Maven.
<dependency>
<groupId>org.monte</groupId>
<artifactId>screen-recorder</artifactId>
<version>0.7.7</version>
</dependency>
I have more one repository:
<repository>
<id>jenkins-releases</id>
<url>http://repo.jenkins-ci.org/releases/</url>
</repository>
<repository>
<id>sonatype-releases</id>
<url>https://oss.sonatype.org/content/repositories/releases</url>
</repository>
<repository>
<id>maven.oracle.com</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://maven.oracle.com</url>
<layout>default</layout>
</repository>
When I have my Maven setting.xml is it OK for me, but for other people is it KO.
21:30:45 Downloading: http://repo.jenkins-ci.org/releases/org/monte/screen-recorder/0.7.7/screen-recorder-0.7.7.pom
21:30:46
Downloading: https://oss.sonatype.org/content/repositories/releases/org/monte/screen-recorder/0.7.7/screen-recorder-0.7.7.pom
21:30:46
Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/monte/screen-recorder/0.7.7/screen-recorder-0.7.7.pom
21:30:51
Downloading: https://maven.oracle.com/org/monte/screen-recorder/0.7.7/screen-recorder-0.7.7.pom
21:30:54
[INFO] ------------------------------------------------------------------------
16:30:54 [INFO] BUILD FAILURE
16:30:54 [INFO] ------------------------------------------------------------------------
21:30:54 [ERROR] Failed to execute goal on project foo: Could not resolve dependencies for project com.comp:foo:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at com.github.fii:fuu:jar:1.1.0 -> org.monte:screen-recorder:jar:0.7.7: Failed to read artifact descriptor for org.monte:screen-recorder:jar:0.7.7: Could not transfer artifact org.monte:screen-recorder:pom:0.7.7 from/to maven.oracle.com (https://maven.oracle.com): Not authorized , ReasonPhrase:Authorization Required. -> [Help 1]
http://repo.jenkins-ci.org/releases/org/monte/screen-recorder/0.7.7/screen-recorder-0.7.7.pom do not return a real 404:
{
"errors" : [ {
"status" : 404,
"message" : "File not found."
} ]
}
My build crashes because it tries to go to the Oracle repository but I would like this to load the jar file which is on http://repo.jenkins-ci.org/releases/org/monte/screen-recorder/0.7.7/screen-recorder-0.7.7.jar
how can I configure this?
Your build crashes, because it's trying to download pom (metadata file) for the artifact:
Could not transfer artifact org.monte:screen-recorder:pom:0.7.7
which is not located in the repository (only the .jar file resides there).
I would recommend manually downloading the artifact from https://github.com/stephenc/monte-screen-recorder
and installing it in your local repository.
Maven:
<dependency>
<groupId>com.github.stephenc.monte</groupId>
<artifactId>monte-screen-recorder</artifactId>
<version>0.7.7.0</version>
</dependency>
I can't get my build to build successfully because the org.apache.maven.surefire:surefire-junit4:jar:2.18.1 plugin is missing the dummy.jar.
My maven downloads everything fine from my custom repository. So there is no network problem. Also, this Problem appears on different versions from maven-surefire-plugin.
Hopefully, someone can help me. I just can't figure out what the problem is.
Error:
[INFO] --------------------------------------------------------------------- ---
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.465 s
[INFO] Finished at: 2017-05-11T11:20:13+02:00
[INFO] Final Memory: 24M/262M
[INFO] --------------------------------------------------------------------- ---
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire- plugin:2.18.1:test (default-test) on project qds-mobile-selenium-tests: Unable to generate classpath: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException:
Missing:
[ERROR] ----------
[ERROR] 1) org.apache.maven.surefire:surefire-junit4:jar:2.18.1
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven.surefire -
DartifactId=surefire-junit4 -Dversion=2.18.1 -Dpackaging=jar - Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the
file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven.surefire -
DartifactId=surefire-junit4 -Dversion=2.18.1 -Dpackaging=jar -
Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) dummy:dummy:jar:1.0
[ERROR] 2) org.apache.maven.surefire:surefire-junit4:jar:2.18.1
[ERROR]
[ERROR] ----------
[ERROR] 1 required artifact is missing.
[ERROR]
[ERROR] for artifact:
[ERROR] dummy:dummy:jar:1.0
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] company-releases (https://company.jfrog.io/company/release-local,
releases=true, snapshots=false),
[ERROR] central (https://company.jfrog.io/company/libs-release,
releases=true, snapshots=false),
[ERROR] snapshots (https://company.jfrog.io/company/libs-snapshot,
releases=true, snapshots=true)
[ERROR]
[ERROR] -> [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/MojoExecutionException
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.company</groupId>
<artifactId>qds-selenium-tests-sourceLab</artifactId>
<version>1.0.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-
8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<selenium.version>2.53.1</selenium.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>com.github.stephenc.jcip</groupId>
<artifactId>jcip-annotations</artifactId>
<version>1.0-1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.company</groupId>
<artifactId>saucelabs-device-library</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>2.41.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<includes>
<include>**/MobileTestSuite.class</include>
<include>**/StationaryDevicesTestSuite.class</include>
</includes>
<failIfNoTests>true</failIfNoTests>
<rerunFailingTestsCount>3</rerunFailingTestsCount>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
And my maven settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0
http://maven.apache.org/xsd/settings-1.1.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>foo</username>
<password>bar</password>
<id>central</id>
</server>
<server>
<username>foo</username>
<password>bar</password>
<id>company-releases</id>
</server>
<server>
<username>foo</username>
<password>bar</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>company-releases</id>
<name>company-releases</name>
<url>https://company.jfrog.io/company/release-local</url>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>https://company.jfrog.io/company/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>https://company.jfrog.io/company/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>company-releases</id>
<name>company-releases</name>
<url>https://company.jfrog.io/company/release-local</url>
</pluginRepository>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>https://company.jfrog.io/company/libs-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>https://company.jfrog.io/company/libs-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
Maven can't find org.apache.maven.surefire:surefire-junit4:jar:2.18.1 in your custom repository. However that dependency is correct and available in the maven central. Since you've configured central to your custom repository, maven will not look for this dependency in maven central repository.
This is most likely due to a configuration error in your custom repository server or that server not having a working internet connection.
You can either try to troubleshoot your custom repository server, or change central to default maven central repository in your maven settings.xml.
I have following .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">
<profiles>
<profile>
<repositories>
<repository>
<id>jboss-ga-repository</id>
<url>http://maven.repository.redhat.com/techpreview/all</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-ga-plugin-repository</id>
<url>http://maven.repository.redhat.com/techpreview/all</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
When I try run mvn install against my project it says:
[INFO] Unable to find resource 'org.jboss.bom.eap:jboss-javaee-6.0-with-tools:pom:6.4.0.GA' in repository central (https://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.jboss.bom.eap:jboss-javaee-6.0-with-tools
Reason: POM 'org.jboss.bom.eap:jboss-javaee-6.0-with-tools' not found in repository: Unable to download the artifact from any repository
org.jboss.bom.eap:jboss-javaee-6.0-with-tools:pom:6.4.0.GA
from the specified remote repositories:
central (https://repo1.maven.org/maven2)
for project org.jboss.bom.eap:jboss-javaee-6.0-with-tools
But it tried only central (https://repo1.maven.org/maven2). Why did it ignore repositories specified in settings.xml?
Profiles need to be activated in your Maven build. There are several ways to activate them (see http://maven.apache.org/guides/introduction/introduction-to-profiles.html). For example, you can activate it at the command line using:
mvn ... -Pprofile-1
But obviously you'll need to declare the profile ID in the <profile> node that you showed.
I'm trying to create custom checkstyle. Already have SNAPSHOT on sonatype however the test project where I'm trying to test it on is not able to pull depencency. Error is
[INFO] Building TestProject 0.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-checkstyle-plugin:2.10:checkstyle (default-cli) # TestProject ---
Downloading: http://repository.apache.org/snapshots/com/novoda/novoda-checkstyle-checks/1.0-SNAPSHOT/maven-metadata.xml
Downloading: http://repository.apache.org/snapshots/com/novoda/novoda-checkstyle-checks/1.0-SNAPSHOT/novoda-checkstyle-checks-1.0-SNAPSHOT.pom
[WARNING] The POM for com.novoda:novoda-checkstyle-checks:jar:1.0-SNAPSHOT is missing, no dependency information available
Downloading: http://repository.apache.org/snapshots/com/novoda/novoda-checkstyle-checks/1.0-SNAPSHOT/novoda-checkstyle-checks-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.993s
[INFO] Finished at: Thu Aug 08 16:37:42 BST 2013
[INFO] Final Memory: 6M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.10:checkstyle (default-cli) on project TestProject: Execution default-cli of goal org.apache.maven.plugins:maven-checkstyle-plugin:2.10:checkstyle failed: Plugin org.apache.maven.plugins:maven-checkstyle-plugin:2.10 or one of its dependencies could not be resolved: Could not find artifact com.novoda:novoda-checkstyle-checks:jar:1.0-SNAPSHOT in apache.snapshots (http://repository.apache.org/snapshots) -> [Help 1]
Here is project pom
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>TestProject</groupId>
<artifactId>TestProject</artifactId>
<version>0.0.1</version>
<properties>
<checkstyle.config.location>properties/checkstyle-configuration.xml</checkstyle.config.location>
</properties>
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.10</version>
<dependencies>
<dependency>
<groupId>com.novoda</groupId>
<artifactId>novoda-checkstyle-checks</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Any idea why dependency plugin is not downloaded?
Solution is simple. Since it is plugin that I'm trying to fetch I need to use pluginRepositories instead of repositories
<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
You can see that maven is looking for the snapshot in the wrong repo http://repository.apache.org/snapshots/
Your artifact is in https://oss.sonatype.org/content/repositories/snapshots
Either the pom you are using to run is not the one that defines the sonatype <repository> or it is being overwriten. Check the effective pom in the folder where you run maven and find the definition, you will probably find it is apache.org and not sonatype's
Alternatively, it is usually not recommended to use <repository> in your poms since it makes the artifacts unusable by others that don't have access to the special repo, check this article. I prefer configuring the custom repo (sonatype snapshots) in settings.xml
Even after wiping out my settings.xml, I still get this error when trying to use this snapshot dependency. Given the dependency:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<configuration>
<path>/licensing</path>
<tomcatWebXml>${basedir}/src/main/mock/web.xml</tomcatWebXml>
</configuration>
</plugin>
And (in the POM), the plugin repository definition:
<pluginRepository>
<id>Codehaus Snapshots</id>
<url>http://snapshots.repository.codehaus.org</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled> <!-- Workaround for MNG-2974, see note below -->
</releases>
</pluginRepository>
I'm left with the following 404 error. If I actually navigate out to that repo, the jar it's looking for isn't there, just dated ones (I'm not familiar with the mechanics of how Maven ultimately resolves expected dependency names).
Ideas?
Downloading: http://snapshots.repository.codehaus.org/org/codehaus/mojo/tomcat-maven-plugin/1.0-SNAPSHOT/tomcat-maven-pl
ugin-1.0-SNAPSHOT.jar
[INFO] Unable to find resource 'org.codehaus.mojo:tomcat-maven-plugin:maven-plugin:1.0-SNAPSHOT' in repository Codehaus
Snapshots (http://snapshots.repository.codehaus.org)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] A required plugin was not found: Plugin could not be found - check that the goal name is correct: Unable to downl
oad the artifact from any repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.codehaus.mojo -DartifactId=tomcat-maven-plugin -Dversion=1.0-SNAPSHOT -Dpacka
ging=maven-plugin -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.codehaus.mojo -DartifactId=tomcat-maven-plugin -Dversion=1.0-SNAPSHOT -Dpackagi
ng=maven-plugin -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
org.codehaus.mojo:tomcat-maven-plugin:maven-plugin:1.0-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
Codehaus Snapshots (http://snapshots.repository.codehaus.org)
org.codehaus.mojo:tomcat-maven-plugin:maven-plugin:1.0-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
Codehaus Snapshots (http://snapshots.repository.codehaus.org)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Wed Jan 06 10:06:49 EST 2010
[INFO] Final Memory: 14M/36M
[INFO] ------------------------------------------------------------------------
I rechecked and, with the following pom fragments:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
...
<pluginRepositories>
<pluginRepository>
<id>Codehaus Snapshots</id>
<url>http://snapshots.repository.codehaus.org/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled> <!-- Workaround for MNG-2974, see note below -->
</releases>
</pluginRepository>
</pluginRepositories>
...
<build>
<finalName>my-webapp</finalName>
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
</plugin>
...
</plugins>
...
</build>
</project>
The SNAPSHOT of the plugin has been downloaded successfully:
$ mvn clean
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building my-webapp Maven Webapp
[INFO] task-segment: [clean]
[INFO] ------------------------------------------------------------------------
[INFO] snapshot org.codehaus.mojo:tomcat-maven-plugin:1.0-SNAPSHOT: checking for updates from Codehaus Snapshots
[INFO] snapshot org.codehaus.mojo:tomcat-maven-plugin:1.0-SNAPSHOT: checking for updates from maven2-repository.dev.java.net
Downloading: http://snapshots.repository.codehaus.org//org/codehaus/mojo/tomcat-maven-plugin/1.0-SNAPSHOT/tomcat-maven-plugin-1.0-20091222.232027-11.pom
5K downloaded (tomcat-maven-plugin-1.0-20091222.232027-11.pom)
Downloading: http://snapshots.repository.codehaus.org//org/codehaus/mojo/tomcat-maven-plugin/1.0-SNAPSHOT/tomcat-maven-plugin-1.0-20091222.232027-11.jar
48K downloaded (tomcat-maven-plugin-1.0-20091222.232027-11.jar)
[INFO] [clean:clean {execution: default-clean}]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9 seconds
[INFO] Finished at: Wed Jan 06 16:13:28 CET 2010
[INFO] Final Memory: 7M/78M
[INFO] ------------------------------------------------------------------------
It's very weird because I can't see any difference, but things are working as expected. In other words, I can't reproduce...
In your local repository, do you have maven-metadata*.xml files in the 1.0-SNAPSHOT directory for the tomcat-maven-plugin artifact? Do they match the ones on the remote server? Do they correctly specify the build number and timestamp?
If they are incorrect locally, running maven with -U might help.
You might also check mvn help:effective-pom and see what Maven thinks the updatePolicy is for snapshots on that repository.
Or maybe just delete your tomcat-maven-plugin artifact from your local repository and try again.
If nothing helps, try to install it manually (download the plugin from the repository and use the mvn install:install-file mojo) or checkout the sources from the VCS and build it locally. But these options are just workarounds, you have a problem somewhere (what version of maven are you using?).
I know this post is a little old, but the tomcat maven plugin has been moved to the apache maven repository. Codehaus only hosts version 1.0 of the plugin. If you want 2.0-snapshot (so you can run tomcat 7), you need to change your pom.xml a little bit. Note that 2.0 is under development.
<repositories>
...
<repository>
<id>people.apache.snapshots</id>
<url>http://repository.apache.org/content/groups/snapshots-group/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>apache.snapshots</id>
<name>Apache Snapshots</name>
<url>http://repository.apache.org/content/groups/snapshots-group/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
And your plugin configuration goes like this:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
</plugin>
Not sure exactly, but looks like they might be using some form of the "buildnumber" maven plugin to include version control revision numbers.
Take a look at http://snapshots.repository.codehaus.org//org/codehaus/mojo/tomcat-maven-plugin/1.0-SNAPSHOT/maven-metadata.xml and you'll notice that in addition to the normal stuff, theres a xml tag for buildnumber and timestamp.
This may not be ideal, but you might be able to replace:
<version>1.0-SNAPSHOT</version>
with:
<version>1.0-20091222.232027-11</version>
To at least get up and running with the latest version of the plugin.
First off let me say that you do not download the TomCat-Maven-Plugin for Eclipse like other Eclipse plugins.
You simply use the maven tools in Eclipse, to insert the correct maven plugin build commands into your maven pom.xml file.....
If anyone is having trouble understanding how to get their Maven project to run as a maven Build configuration, there are a couple of things you may need to look for:
I would like to upload an image but oh well....
In your Eclipse Web App, hopefully you have a Maven POM.xml file, if not you need to set that up first.
Then, you can right click on it and then find Maven in your menu, then the sub menu item comes up, with a choice called Add Plugin.
There is a field called "Enter groupId, artifactId or sha1, etc....
Type in the word Tomcat there.
It will then load search results in the box below.
Basically what this does is load details in your pom.xml as to which plugins to download when building with Maven.
After that you need to do the Maven build.
Then, you want to go to Run Configurations and make sure you have the correct path to where your webapp lives.
Also in that page, under goals type TomCat:run
Then apply
Finally run.
If all goes well you will have a Tomcat server running the web app.
Then you can go to a browser and enter [http://localhost:8080/webappname/defaultpagename]
and walla!