Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven tomcat7-maven-plugin not found error

I am new to working with Maven. Searched alot but no success. Tried my best. Someone explain to me what to do to fix this issue. Any of your current pom with struts2 and tomcat 7 will be very helpful.

I am using maven3

ERROR

Plugin 'org.apache.tomcat.maven:tomcat7-maven-plugin:2.0-SNAPSHOT' not found

I see this plugin is available at http://people.apache.org/repo/m2-snapshot-repository/org/apache/tomcat/ . Got link from here http://tomcat.apache.org/tomcat-7.0-doc/maven-jars.html#Using_Tomcat_libraries_With_Maven

My pom.xml

<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">
    <modelVersion>4.0.0</modelVersion>
    <groupId>Struts2_Maven_Web</groupId>
    <artifactId>Struts2_Maven_Web</artifactId>
    <packaging>war</packaging>
    <version>1.0</version>
    <name>Struts2_Maven_Web Maven Webapp</name>
    <url>http://maven.apache.org</url>
    <dependencies>

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-core</artifactId>
            <version>2.3.4.1</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>


    </dependencies>

    <repositories>
        <repository>
            <id>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>


    <build>
        <finalName>Struts2_Maven_Web</finalName>

        <plugins>

            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.0-SNAPSHOT</version>
                <configuration>
                    <path>/</path>
                </configuration>
            </plugin>
        </plugins>


    </build>


</project>

EDITED******

I just found version 2.0 and its resolved fine.

Should I use this. Difference between 2.0 and 2.0-SNAPSHOT. Anyone? .

 <plugin>
          <groupId>org.apache.tomcat.maven</groupId>
          <artifactId>tomcat7-maven-plugin</artifactId>
          <version>2.0</version>
        </plugin>
like image 367
Pirzada Avatar asked Sep 16 '12 19:09

Pirzada


1 Answers

You need to use the version 2.0, without the SNAPSHOT.

This is because the plugin was released on the 10th of September, and, as far as I have seen, when a plugin or dependency is released, the snapshot versions are removed from the repositories.

like image 79
Augusto Avatar answered Sep 19 '22 11:09

Augusto