1

I can see the jar in my local maven repository but still I am getting classpath issues on executing maven clean install.

pom.xml -

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <parent>
    <artifactId>dummy</artifactId>
    <groupId>com.getpoint.dummy</groupId>
    <version>2.0.0.user-SNAPSHOT</version>
  </parent>

  <artifactId>user</artifactId>
  <packaging>pom</packaging>
  <name>user</name>
  <modelVersion>4.0.0</modelVersion>

  <properties>
  </properties>

 <dependencyManagement>
    <dependencies>
    </dependencies>
  </dependencyManagement> 

  <dependencies>
      <dependency>
        <groupId>com.getpoint.dummy</groupId>
        <artifactId>user2_0a</artifactId>
        <version>1.0.1</version>
      </dependency>
     <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
     </dependency>

     <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>3.1</version>
     </dependency>

     <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.6</version>
     </dependency>

  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
      </plugins>
    </pluginManagement>
  </build>

  <modules>
    <module>testserver</module>
    <module>core</module>
    <module>usernoc_pull</module>
  </modules>
</project>

In the above pom file, the following dependency is the one that is causing errors -

      <dependency>
        <groupId>com.getpoint.dummy</groupId>
        <artifactId>user2_0a</artifactId>
        <version>1.0.1</version>
      </dependency>

The error on doing mvn clean install -

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project user-core: Compilation failure: Compilation failure:
[ERROR] D:\Eclipse_Kepler\Workspace\dummyPro\user\core\src\main\java\com\getpoint\dummy\user\main\DRCoreMain.java:[6,57] error: package main.java.com.getpoint.dummy.user.shared.main does not exist
[ERROR] 
[ERROR] could not parse error message:   symbol:   class UserEvent

NOTE: I have this package already in my directory structure.

sjain
  • 23,126
  • 28
  • 107
  • 185
  • 2
    Please atach your `pom.xml` and highlite dependency which should contain required class. Also what is the filename and path to jar you think should be included in your classpath? – Ondrej Bozek Jan 10 '15 at 14:29
  • Updated. Path to jar is none other then the one in maven repository i.e. `C:\Users\user\.m2\repository\com\getpoint\dummy\user2_0a\1.0.1\user2_0a-1.0.1.jar` – sjain Jan 10 '15 at 14:42
  • `package main.java.com.getpoint.dummy.user.shared.main`, that's a weird package. Don't you think it should start with com.getpoint..? – Robert Scholte Jan 10 '15 at 14:51
  • I agree and there are lots of small things to modify but this error is hard to rectify. I can't find package error issue as a java project but when its built then it complains. Its becoming hard to tell maven that my package is at that location. – sjain Jan 10 '15 at 15:04
  • I suggest you should try to compile your Maven project from plain command line. The way how Eclipse handles Maven projects is not very clean. Eclipse needs to import Maven projects somehow and introduce few eclipse specific build files. From this behavior various issues arise i.e. sometimes maven projects in eclipse needs to be occasionally updated with special eclipse maven goal. – Ondrej Bozek Jan 10 '15 at 15:51

0 Answers0