Class is not imported although it is already present in the project libraries (by using maven)

I have created a maven project.
I've tried to use a class that is already imported in my libraries (since I declare it in the pom.xml) but IntelliJ Idea 13 Ultimate is not auto-importing it.
When I press the red bulb and ask it to import a maven dependency it finds the class in the previous version of the current library.

Here is my pom.xml file :

<?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/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <groupId>MavenVaadinClientSideApp</groupId>
     <artifactId>MavenVaadinClientSideApp</artifactId>
     <packaging>war</packaging>
     <version>1.0-SNAPSHOT</version>
     <name>Vaadin Web Application</name>

     <properties>
          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
          <vaadin.version>7.1.9</vaadin.version>
          <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
     </properties>
     <repositories>
          <repository>
               <id>vaadin-addons</id>
               <url>http://maven.vaadin.com/vaadin-addons</url>
          </repository>
          <repository>
               <id>vaadin-snapshots</id>
               <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
               <releases>
                    <enabled>false</enabled>
               </releases>
               <snapshots>
                    <enabled>true</enabled>
               </snapshots>
          </repository>
     </repositories>
     <pluginRepositories>
          <pluginRepository>
               <id>vaadin-snapshots</id>
               <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
               <releases>
                    <enabled>false</enabled>
               </releases>
               <snapshots>
                    <enabled>true</enabled>
               </snapshots>
          </pluginRepository>
     </pluginRepositories>
     <dependencies>
          <dependency>
               <groupId>com.vaadin</groupId>
               <artifactId>vaadin-server</artifactId>
               <version>${vaadin.version}</version>
          </dependency>
          <dependency>
               <groupId>com.vaadin</groupId>
               <artifactId>vaadin-client-compiled</artifactId>
               <version>${vaadin.version}</version>
          </dependency>
          <!--
            Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory).
            
            For widgetset compilation, vaadin-client-compiler is automatically added on the
            compilation classpath by vaadin-maven-plugin so normally there is no need for an
            explicit dependency.
          -->

          <dependency>
               <groupId>com.vaadin</groupId>
               <artifactId>vaadin-client-compiler</artifactId>
               <version>${vaadin.version}</version>
               <scope>provided</scope>
          </dependency>

          <dependency>
               <groupId>com.vaadin</groupId>
               <artifactId>vaadin-client</artifactId>
               <version>${vaadin.version}</version>
            <scope>provided</scope>
          </dependency>
          <dependency>
               <groupId>com.vaadin</groupId>
               <artifactId>vaadin-push</artifactId>
               <version>${vaadin.version}</version>
          </dependency>
          <dependency>
               <groupId>com.vaadin</groupId>
               <artifactId>vaadin-themes</artifactId>
               <version>${vaadin.version}</version>
          </dependency>
          <dependency>
               <groupId>javax.servlet</groupId>
               <artifactId>javax.servlet-api</artifactId>
               <version>3.0.1</version>
               <scope>provided</scope>
          </dependency>
     </dependencies>

     <build>
          <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>remove-old-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>remove-project-artifact</goal>
                        </goals>
                        <configuration>
                            <removeAll>true</removeAll><!-- remove all versions of built artifacts including all versions.  Install phase will regenerate -->
                        </configuration>
                    </execution>
                </executions>
            </plugin>
               <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                         <source>1.7</source>
                         <target>1.7</target>
                    </configuration>
               </plugin>
               <!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
               <!-- directory is cleaned properly -->
               <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.4.1</version>
                    <configuration>
                         <filesets>
                              <fileset>
                                   <directory>src/main/webapp/VAADIN/widgetsets</directory>
                              </fileset>
                         </filesets>
                    </configuration>
               </plugin>
               <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.2</version>
                    <configuration>
                         <failOnMissingWebXml>false</failOnMissingWebXml>
                    </configuration>
               </plugin>
               <plugin>
                    <groupId>com.vaadin</groupId>
                    <artifactId>vaadin-maven-plugin</artifactId>
                    <version>${vaadin.plugin.version}</version>
                    <configuration>
                         <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                         <!-- <runTarget>mobilemail</runTarget> -->
                         <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This
                              way compatible with Vaadin eclipse plugin. -->
                         <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets
                         </webappDirectory>
                         <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets
                         </hostedWebapp>
                         <noServer>true</noServer>
                         <!-- Remove draftCompile when project is ready -->
                         <draftCompile>false</draftCompile>
                         <compileReport>true</compileReport>
                         <style>OBF</style>
                         <strict>true</strict>
                         <runTarget>http://localhost:8080/</runTarget>
                    </configuration>
                    <executions>
                         <execution>
                              <configuration>
                                   <!-- if you don't specify any modules, the plugin will find them -->
                                   <!-- <modules> <module>com.vaadin.demo.mobilemail.gwt.ColorPickerWidgetSet</module>
                                        </modules> -->
                              </configuration>
                              <goals>
                                   <goal>clean</goal>
                                   <goal>resources</goal>
                                   <goal>update-theme</goal>
                                   <goal>update-widgetset</goal>
                                   <goal>compile-theme</goal>
                                   <goal>compile</goal>
                              </goals>
                         </execution>
                    </executions>
               </plugin>
               <plugin>
                    <groupId>org.mortbay.jetty</groupId>
                    <artifactId>jetty-maven-plugin</artifactId>
               </plugin>
          </plugins>
          <pluginManagement>
               <plugins>
                    <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                    <plugin>
                         <groupId>org.eclipse.m2e</groupId>
                         <artifactId>lifecycle-mapping</artifactId>
                         <version>1.0.0</version>
                         <configuration>
                              <lifecycleMappingMetadata>
                                   <pluginExecutions>
                                        <pluginExecution>
                                             <pluginExecutionFilter>
                                                  <groupId>com.vaadin</groupId>
                                                  <artifactId>
                                                       vaadin-maven-plugin
                                                  </artifactId>
                                                  <versionRange>
                                                       [7.1.9,)
                                                  </versionRange>
                                                  <goals>
                                                       <goal>resources</goal>
                                                       <goal>update-widgetset</goal>
                                                       <goal>compile</goal>
                                                       <goal>update-theme</goal>
                                                       <goal>compile-theme</goal>
                                                  </goals>
                                             </pluginExecutionFilter>
                                             <action>
                                                  <ignore></ignore>
                                             </action>
                                        </pluginExecution>
                                   </pluginExecutions>
                              </lifecycleMappingMetadata>
                         </configuration>
                    </plugin>
               </plugins>
          </pluginManagement>
     </build>
</project>



The class that I want to use is in the vaadin-client artifact and it is this : com.google.gwt.core.client.EntryPoint

The maven archetype that was used to create this project is vaadin-archetype-application:7.1.9
1 comment
Comment actions Permalink

Hello.

Thank you for the full sample, but sorry, cannot reproduce the problem. I've added new maven module (independent to others) to my test project, and a dummy source code reference to EntryPoint is perfectly green.

My EntryPoint is resolved to module library "Maven:com.vaadin:vaadin-client:7.1.9" added with "provided" scope. Has this library (_IDEA_ module library) been created on your side? Is this dependency shown in the tree in Maven tool window?

Thanks,
Alexander.

0

Please sign in to leave a comment.