0

I have an issue when I try to compile as Java App because it doesn't find that class.

After searching the web, and stack overflow I found that I had to copy the class into the class path, but as you can see in the picture I don't have that dependency, or that class in my project.

Here the picture:

Error image + maven dependency

This is my pom.xml:

  <dependencies>
 <dependency>
    <groupId>org.apache.xmlbeans</groupId>
    <artifactId>xmlbeans</artifactId>
    <version>2.6.0</version>
    <type>jar</type>
    <scope>compile</scope>
</dependency>
<dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-math</artifactId>
        <version>2.2</version>
        <scope>compile</scope>
    </dependency>

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>xmlbeans-maven-plugin</artifactId>
            <version>2.3.3</version>
            <inherited>true</inherited>
            <configuration>
                <download>true</download>
                <schemaDirectory>src/main/resources</schemaDirectory>
                <sourceGenerationDirectory>src/main/java</sourceGenerationDirectory>
                <classGenerationDirectory>target/classes</classGenerationDirectory>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
                <execution>
                    <id>package-jar-with-dependencies</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                    <configuration>
                        <appendAssemblyId>false</appendAssemblyId>
                        <descriptorRefs>
                            <descriptorRef>jar-with-dependencies</descriptorRef>
                        </descriptorRefs>
                        <archive>
                            <manifest>
                                <mainClass>se.sigma.educational.Main</mainClass>
                            </manifest>
                        </archive>
                    </configuration>
                </execution>
            </executions>
        </plugin>

    </plugins>

    <resources>
    <resource>
        <directory>target/generated-sources/axis2/wsdl2code/resources</directory>
    </resource>
    <resource>
        <directory>target/generated-sources/xmlbeans/resources</directory>
    </resource>
    <resource>
        <directory>src/main/resources</directory>
    </resource>
</resources>
</build>  

(< / dependencies > tag is added but not showed here).

Would like to show you, that that class is into this package but I'm not sure if I can use it:

Class into package

I ran as maven build and after that I ran as maven install, all fine at this point (build success), but when I try to call it from a main class I get the error.

If you need more information, just ask for it.

KItis
  • 5,476
  • 19
  • 64
  • 112
  • Hi Hector pls check with this link .You can delete target folder and add the jar to the project dependencies and give a try.Since class not found comes when the class is compiled and not able to get during runtime. – Pradeep Apr 03 '17 at 06:51
  • http://stackoverflow.com/questions/8518301/error-when-using-xmlbeans-generated-classes – Pradeep Apr 03 '17 at 06:51
  • How do you call the main method? You should be using `java -jar --jar-with-dependencies.jar` – Luciano van der Veekens Apr 03 '17 at 07:29
  • try to update the maven project , then it might show the errors if it is not sync properly. right click project -> maven -> update maven project – KItis Apr 03 '17 at 09:03

0 Answers0