0
votes

I try to use the tomcat7 plugin for maven. I am using Maven 2.2.1 and Java 1.7. I included the plugin in my pom.xml like this:

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.2</version>
</plugin>

When I try to run 'mvn tomcat7:run', I get this error:

The plugin 'org.apache.maven.plugins:maven-tomcat7-plugin' does not exist or no valid version could be found

I deleted my local repository from ~/.2m to make sure there is nothing wrong there. Also nox proxies etc. are set. When I try to dig into this with 'mvn tomcat7:run -X -U', I get this trace:

  • Error stacktraces are turned on. Apache Maven 2.2.1 (rdebian-14) Java version: 1.7.0_65 Java home: /usr/lib/jvm/java-7-oracle/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux" version: "3.13.0-32-generic" arch: "amd64" Family: "unix" [DEBUG] Building Maven user-level plugin registry from: '/home/brost/.m2/plugin-registry.xml' [DEBUG] Building Maven global-level plugin registry from: '/usr/share/maven2/conf/plugin-registry.xml' [INFO] Scanning for projects... [DEBUG] Adding managed dependencies for com.google.gwt:gwt-user:jar:2.6.1:provided [DEBUG]
    com.google.gwt:gwt-servlet:jar:2.6.1 [DEBUG]
    com.google.gwt:gwt-dev:jar:2.6.1:test [DEBUG]
    javax.servlet:javax.servlet-api:jar:3.0.1:provided [DEBUG]
    com.gwtplatform:gwtp-all:jar:1.3 [DEBUG]
    com.google.inject:guice:jar:3.0 [DEBUG]
    com.google.inject.extensions:guice-servlet:jar:3.0 [DEBUG]
    com.google.inject.extensions:guice-assistedinject:jar:3.0 [DEBUG]
    com.google.gwt.inject:gin:jar:2.1.2 [DEBUG]
    com.lambdaworks:scrypt:jar:1.4.0 [DEBUG] junit:junit:jar:4.7:test [DEBUG] org.jukito:jukito:jar:1.4:test [DEBUG]
    org.hibernate:hibernate-entitymanager:jar:4.3.5.Final [DEBUG]
    org.hsqldb:hsqldb:jar:2.3.2 [DEBUG]
    org.slf4j:slf4j-log4j12:jar:1.7.7:provided [DEBUG]
    com.allen-sauer.gwt.log:gwt-log:jar:3.3.0 [DEBUG] Adding managed dependencies for unknown:mdm-client [DEBUG]
    com.google.gwt:gwt-user:jar:2.6.1:provided [DEBUG]
    com.google.gwt:gwt-servlet:jar:2.6.1 [DEBUG]
    com.google.gwt:gwt-dev:jar:2.6.1:test [DEBUG]
    javax.servlet:javax.servlet-api:jar:3.0.1:provided [DEBUG]
    com.gwtplatform:gwtp-all:jar:1.3 [DEBUG]
    com.google.inject:guice:jar:3.0 [DEBUG]
    com.google.inject.extensions:guice-servlet:jar:3.0 [DEBUG]
    com.google.inject.extensions:guice-assistedinject:jar:3.0 [DEBUG]
    com.google.gwt.inject:gin:jar:2.1.2 [DEBUG]
    com.lambdaworks:scrypt:jar:1.4.0 [DEBUG] junit:junit:jar:4.7:test [DEBUG] org.jukito:jukito:jar:1.4:test [DEBUG]
    org.hibernate:hibernate-entitymanager:jar:4.3.5.Final [DEBUG]
    org.hsqldb:hsqldb:jar:2.3.2 [DEBUG]
    org.slf4j:slf4j-log4j12:jar:1.7.7:provided [DEBUG]
    com.allen-sauer.gwt.log:gwt-log:jar:3.3.0 [DEBUG] Adding managed dependencies for unknown:mdm-shared [DEBUG]
    com.google.gwt:gwt-user:jar:2.6.1:provided [DEBUG]
    com.google.gwt:gwt-servlet:jar:2.6.1 [DEBUG]
    com.google.gwt:gwt-dev:jar:2.6.1:test [DEBUG]
    javax.servlet:javax.servlet-api:jar:3.0.1:provided [DEBUG]
    com.gwtplatform:gwtp-all:jar:1.3 [DEBUG]
    com.google.inject:guice:jar:3.0 [DEBUG]
    com.google.inject.extensions:guice-servlet:jar:3.0 [DEBUG]
    com.google.inject.extensions:guice-assistedinject:jar:3.0 [DEBUG]
    com.google.gwt.inject:gin:jar:2.1.2 [DEBUG]
    com.lambdaworks:scrypt:jar:1.4.0 [DEBUG] junit:junit:jar:4.7:test [DEBUG] org.jukito:jukito:jar:1.4:test [DEBUG]
    org.hibernate:hibernate-entitymanager:jar:4.3.5.Final [DEBUG]
    org.hsqldb:hsqldb:jar:2.3.2 [DEBUG]
    org.slf4j:slf4j-log4j12:jar:1.7.7:provided [DEBUG]
    com.allen-sauer.gwt.log:gwt-log:jar:3.3.0 [DEBUG] Adding managed dependencies for unknown:mdm-server [DEBUG]
    com.google.gwt:gwt-user:jar:2.6.1:provided [DEBUG]
    com.google.gwt:gwt-servlet:jar:2.6.1 [DEBUG]
    com.google.gwt:gwt-dev:jar:2.6.1:test [DEBUG]
    javax.servlet:javax.servlet-api:jar:3.0.1:provided [DEBUG]
    com.gwtplatform:gwtp-all:jar:1.3 [DEBUG]
    com.google.inject:guice:jar:3.0 [DEBUG]
    com.google.inject.extensions:guice-servlet:jar:3.0 [DEBUG]
    com.google.inject.extensions:guice-assistedinject:jar:3.0 [DEBUG]
    com.google.gwt.inject:gin:jar:2.1.2 [DEBUG]
    com.lambdaworks:scrypt:jar:1.4.0 [DEBUG] junit:junit:jar:4.7:test [DEBUG] org.jukito:jukito:jar:1.4:test [DEBUG]
    org.hibernate:hibernate-entitymanager:jar:4.3.5.Final [DEBUG]
    org.hsqldb:hsqldb:jar:2.3.2 [DEBUG]
    org.slf4j:slf4j-log4j12:jar:1.7.7:provided [DEBUG]
    com.allen-sauer.gwt.log:gwt-log:jar:3.3.0 [INFO] Reactor build order: Searching repository for plugin with prefix: 'tomcat7'. [DEBUG] Loading plugin prefixes from group: org.apache.maven.plugins [INFO] org.apache.maven.plugins: checking for updates from central [DEBUG] Using Wagon implementation lightweight from default mapping for protocol http [DEBUG] Checking for pre-existing User-Agent configuration. [DEBUG] Adding User-Agent configuration. [DEBUG] Connecting to repository: 'central' with url: 'http://repo1.maven.org/maven2'. [DEBUG] Using Wagon implementation lightweight from default mapping for protocol http [DEBUG] Loading plugin prefixes from group: org.codehaus.mojo [INFO] org.codehaus.mojo: checking for updates from central [DEBUG] Using Wagon implementation lightweight from default mapping for protocol http [DEBUG] Checking for pre-existing User-Agent configuration. [DEBUG] Adding User-Agent configuration. [DEBUG] Connecting to repository: 'central' with url: 'http://repo1.maven.org/maven2'. [DEBUG] Using Wagon implementation lightweight from default mapping for protocol http [INFO] artifact org.apache.maven.plugins:maven-tomcat7-plugin: checking for updates from central [DEBUG] Using Wagon implementation lightweight from default mapping for protocol http [DEBUG] Checking for pre-existing User-Agent configuration. [DEBUG] Adding User-Agent configuration. [DEBUG] Connecting to repository: 'central' with url: 'http://repo1.maven.org/maven2'. [DEBUG] Using Wagon implementation lightweight from default mapping for protocol http [DEBUG] repository metadata for: 'artifact org.apache.maven.plugins:maven-tomcat7-plugin' could not be found on repository: central [DEBUG] maven-tomcat7-plugin: using locally installed snapshot [DEBUG] Artifact not found - using stub model: Unable to determine the latest version

    org.apache.maven.plugins:maven-tomcat7-plugin:pom:LATEST

[DEBUG] Using defaults for missing POM org.apache.maven.plugins:maven-tomcat7-plugin:pom:LATEST [DEBUG] maven-tomcat7-plugin: using locally installed snapshot [DEBUG] Artifact not found - using stub model: Unable to determine the release version

org.apache.maven.plugins:maven-tomcat7-plugin:pom:RELEASE

[DEBUG] Using defaults for missing POM org.apache.maven.plugins:maven-tomcat7-plugin:pom:RELEASE [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] The plugin 'org.apache.maven.plugins:maven-tomcat7-plugin' does not exist or no valid version could be found [INFO] ------------------------------------------------------------------------ [DEBUG] Trace org.apache.maven.lifecycle.LifecycleExecutionException: The plugin 'org.apache.maven.plugins:maven-tomcat7-plugin' does not exist or no valid version could be found at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1569) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1851) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:462) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:175) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.version.PluginVersionNotFoundException: The plugin 'org.apache.maven.plugins:maven-tomcat7-plugin' does not exist or no valid version could be found at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:229) at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:91) at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:179) at org.apache.maven.plugin.DefaultPluginManager.loadPluginDescriptor(DefaultPluginManager.java:1642) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1540) ... 15 more

But for sure the plugin is available at the maven repository as can be seen here.

We have three sub-modules defined in the pom.xml. But if I remove them, the error remains the same. So this should not be related to underlying pom.xml files.

What can I do to debug that further?

EDIT: This is the complete 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>testproject</groupId>
    <artifactId>mdm</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>

    <prerequisites>
        <maven>${mavenVersion}</maven>
    </prerequisites>

    <properties>
        <!-- client -->
        <gwt.version>2.6.1</gwt.version>
        <gwtp.version>1.3</gwtp.version>
        <gin.version>2.1.2</gin.version>
        <gwt-maven-plugin.version>2.6.1</gwt-maven-plugin.version>

        <!-- server -->
        <guice.version>3.0</guice.version>

        <!-- testing -->
        <junit.version>4.7</junit.version>
        <jukito.version>1.4</jukito.version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-user</artifactId>
                <version>${gwt.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-servlet</artifactId>
                <version>${gwt.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-dev</artifactId>
                <version>${gwt.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.0.1</version>
                <scope>provided</scope>
            </dependency>

            <!-- GWT-Platform -->
            <dependency>
                <groupId>com.gwtplatform</groupId>
                <artifactId>gwtp-all</artifactId>
                <version>${gwtp.version}</version>
            </dependency>

            <!-- DI -->
            <dependency>
                <groupId>com.google.inject</groupId>
                <artifactId>guice</artifactId>
                <version>${guice.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.inject.extensions</groupId>
                <artifactId>guice-servlet</artifactId>
                <version>${guice.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.inject.extensions</groupId>
                <artifactId>guice-assistedinject</artifactId>
                <version>${guice.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.gwt.inject</groupId>
                <artifactId>gin</artifactId>
                <version>${gin.version}</version>
            </dependency>

            <!-- Password Hashing scrypt -->
            <dependency>
                <groupId>com.lambdaworks</groupId>
                <artifactId>scrypt</artifactId>
                <version>1.4.0</version>
            </dependency>

            <!-- Test -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jukito</groupId>
                <artifactId>jukito</artifactId>
                <version>${jukito.version}</version>
                <scope>test</scope>
            </dependency>
            <!-- Hibernate -->
            <!-- for JPA, use hibernate-entitymanager instead of hibernate-core -->
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-entitymanager</artifactId>
                <version>4.3.5.Final</version>
            </dependency>
            <!-- hSQLDB -->
            <dependency>
                <groupId>org.hsqldb</groupId>
                <artifactId>hsqldb</artifactId>
                <version>2.3.2</version>
            </dependency>
            <!-- Server Logging -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>1.7.7</version>
                <scope>provided</scope>
            </dependency>
            <!-- GWT-Log -->
            <dependency>
                <groupId>com.allen-sauer.gwt.log</groupId>
                <artifactId>gwt-log</artifactId>
                <version>3.3.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.8</version>
                </plugin>
                <plugin>
                    <groupId>org.eclipse.jetty</groupId>
                    <artifactId>jetty-maven-plugin</artifactId>
                    <version>9.2.1.v20140609</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>gwt-maven-plugin</artifactId>
                    <version>2.6.1</version>
                    <configuration>
                        <deploy>${project.build.directory}/gwtc/extra</deploy>
                        <extra>${project.build.directory}/gwtc/extra</extra>
                        <gen>${project.build.directory}/gwtc/gen</gen>
                        <!-- There's an issue on Mac: see http://code.google.com/p/google-web-toolkit/issues/detail?id=7474 
                            <workDir>${project.build.directory}/gwtc/work</workDir> <codeServerWorkDir>${project.build.directory}/gwtc/superDevMode</codeServerWorkDir> -->
                    </configuration>
                    <executions>
                        <execution>
                            <id>gwt-compile</id>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.2.1</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.tomcat.maven</groupId>
                    <artifactId>tomcat6-maven-plugin</artifactId>
                    <version>2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.tomcat.maven</groupId>
                    <artifactId>tomcat7-maven-plugin</artifactId>
                    <version>2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
                        <archive>
                            <addMavenDescriptor>false</addMavenDescriptor>
                        </archive>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>
1
Post your whole POM, so we can check it. - watery
I'm succesfully using that plugin, by your explanation the only difference I can tell is that I run Maven 3. - watery
I posted the whole pom.xml. I just did not want to overload the posting, but you are right. - Fluffy
At first, the POM seems OK, but you're requesting both plugins, for Tomcat 6 and 7. I don't know if that's a problem, but - unless there's a specific reason for this - just choose one (match it with your server version). - watery
That was for compatibility reasons between two machines. I removed the tomcat6 one, but still to no avail :( - Fluffy

1 Answers

0
votes

It looks like an error in your pom.xml. You probably forgot to include the group id for the plugin in the <build> section, which would make maven assume the default/automagic group id org.apache.maven.plugins

It should look like this:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.tomcat.maven</groupId>
      <artifactId>tomcat7-maven-plugin</artifactId>
      ...