Tom
Tom

Reputation: 2847

Why can't maven plugin work with eclipse java compiler?

I installed m2eclipse plugin in my eclipse.I have a java project in eclipse. Then I add a pom.xml into the root folder of my project. Convert my project into maven project. Now the problem comes: I can download jar contained in pom.xml, but can't import it into my java file. Always got java compile error in my project. In package explorer view,I can see maven dependencies.

I have tried this:maven clean, restart eclipse, project clean.

Here is 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>TomLabs</groupId>
    <artifactId>TomLabs</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>test</name>
    <description>Tom source code</description>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>javax.media</groupId>
            <artifactId>jmf</artifactId>
            <version>2.1.1e</version>
        </dependency>
    </dependencies>
</project>

Upvotes: 0

Views: 122

Answers (1)

Maniganda Prakash
Maniganda Prakash

Reputation: 4732

One possibility could be the package/class what you are trying to import is not available in the version of the jar file you have mentioned in the pom.xml.

Upvotes: 1

Related Questions