I'm trying to build a new Ambari view (Ambari is an open source project by Apache) that will allow users to manage their OneFS cluster at the same time they're managing Hadoop. I'm pretty new to Maven so I'm hoping this problem is trivially easy to fix (it seems like it would be but so far I haven't been able to figure it out).
I have the following imports defined in a .java file:
package org.apache.ambari.view;
import java.lang.Integer; // Provides several methods for converting an int to a String and a String to an int.
import java.io.IOException; // Signals that an I/O exception of some sort has occurred.
import java.net.UnknownHostException; // Thrown to indicate that the IP address of a host could not be determined.
import java.net.URL; // Uniform Resource Locator - a pointer to a "resource" on the World Wide Web.
import java.net.Socket; // An endpoint for communication between two machines.
import java.util.ArrayList; // Resizable-array implementation of the List interface.
import org.apache.commons.codec.binary.Base64; // Provides Base64 encoding and decoding as defined by RFC 2045.
import org.apache.http.HttpEntity; // An entity that can be sent or received with an HTTP message.
import org.apache.http.util.EntityUtils; // Static helpers for dealing with HttpEntitys.
import org.apache.http.message.BasicNameValuePair; // NameValuePair dictionary type.
import org.apache.http.impl.client.CloseableHttpClient; // Base implementation of HttpClient that also implements Closeable.
import org.apache.http.impl.client.HttpClients; // Factory methods for CloseableHttpClient instances.
import org.apache.http.client.methods.CloseableHttpResponse;// Extended version of the HttpResponse interface that also extends Closeable.
import org.apache.http.client.entity.UrlEncodedFormEntity; // An entity composed of a list of url-encoded pairs for sending HTTP POST requests.
import org.apache.http.client.methods.HttpPost; // An HTTP POST class as defined by section 9.5 of RFC2616
public class Papi {
private String m_clustername;
private String m_username;
private String m_password;
private String m_url;
private String m_sessionurl;
private String m_ipaddress;
private int m_timeout;
private int m_responsecode;
public Papi(String clustername, String username, String password, int port) {
Socket socket;
try {
socket = new Socket(clustername, port);
m_ipaddress = socket.getInetAddress().getHostAddress();
socket.close();
} catch(UnknownHostException e) {
System.out.println("ERROR 1: Failed to open session (UnknownHostException)");
} catch(IOException e) {
System.out.println("ERROR 1: Failed to open session (IOException)");
}
m_url = "https://" + m_ipaddress + ":" + Integer.toString(port);
m_sessionurl = m_url + "/platform" + "/1?describe&list&all";
m_username = username;
m_password = password;
m_responsecode = 0;
}
public int GetResponseCode() {
return m_responsecode;
}
public String GetSessionURL() {
return m_sessionurl;
}
// Makes an https POST request to OneFS.
public String DoPost() throws Exception {
String response;
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(m_sessionurl);
ArrayList <BasicNameValuePair> basicNameValuePair = new ArrayList <BasicNameValuePair>();
basicNameValuePair.add(new BasicNameValuePair("username", m_username));
basicNameValuePair.add(new BasicNameValuePair("password", m_password));
httpPost.setEntity(new UrlEncodedFormEntity(basicNameValuePair));
CloseableHttpResponse reply = httpclient.execute(httpPost);
try {
System.out.println(reply.getStatusLine());
HttpEntity entity = reply.getEntity();
// Parse response body and return as a string.
response = EntityUtils.toString(entity);
System.out.println(response);
// Dispose entity contents.
EntityUtils.consume(entity);
return response;
} finally {
reply.close();
return null;
}
return null;
}
}
However, when I try to build the program using mvn clean package I get the following errors:
root#Martell-AMBARI:/home/tmunson/ambari/ambari-views/examples/onefs-view# mvn clean package
Picked up _JAVA_OPTIONS: -Xmx2048m -XX:MaxPermSize=512m -Djava.awt.headless=true
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Isilon OneFS View 2.1.3
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # onefs-view ---
[INFO] Deleting /home/tmunson/ambari/ambari-views/examples/onefs-view/target
[INFO] Deleting /home/tmunson/ambari/ambari-views/examples/onefs-view (includes = [**/*.pyc], excludes = [])
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:regex-property (parse-package-version) # onefs-view ---
[INFO] No match to regex '^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)((\.|-).*)?' found in '2.1.3'. The initial value '2.1.3' is left as-is...
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:regex-property (parse-package-release) # onefs-view ---
[INFO] No match to regex '^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)((\.|-)(([0-9]+)|(SNAPSHOT)|(techwin)).*)?' found in '2.1.3'. The initial value '2.1.3' is left as-is...
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # onefs-view ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) # onefs-view ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/tmunson/ambari/ambari-views/examples/onefs-view/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[28,39] package org.apache.commons.codec.binary does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[30,28] package org.apache.http.util does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[31,31] package org.apache.http.message does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[32,35] package org.apache.http.impl.client does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[33,38] package org.apache.http.client.methods does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[34,35] package org.apache.http.impl.client does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[35,23] package org.apache.http does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[37,37] package org.apache.http.client.entity does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[38,38] package org.apache.http.client.methods does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[39,35] package org.apache.http.impl.client does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[41,1] package org.json does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[86,17] cannot find symbol
symbol: class CloseableHttpClient
location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[86,50] cannot find symbol
symbol: variable HttpClients
location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[87,17] cannot find symbol
symbol: class HttpPost
location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[87,41] cannot find symbol
symbol: class HttpPost
location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[89,28] cannot find symbol
symbol: class BasicNameValuePair
location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[89,84] cannot find symbol
symbol: class BasicNameValuePair
location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[90,44] cannot find symbol
symbol: class BasicNameValuePair
location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[91,44] cannot find symbol
symbol: class BasicNameValuePair
location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[93,40] cannot find symbol
symbol: class UrlEncodedFormEntity
location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[94,17] cannot find symbol
symbol: class CloseableHttpResponse
location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[98,21] cannot find symbol
symbol: class HttpEntity
location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[101,32] cannot find symbol
symbol: variable EntityUtils
location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[104,21] cannot find symbol
symbol: variable EntityUtils
location: class org.apache.ambari.view.Papi
[INFO] 24 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.002s
[INFO] Finished at: Mon Nov 09 01:06:46 PST 2015
[INFO] Final Memory: 14M/240M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project onefs-view: Compilation failure: Compilation failure:
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[28,39] package org.apache.commons.codec.binary does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[30,28] package org.apache.http.util does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[31,31] package org.apache.http.message does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[32,35] package org.apache.http.impl.client does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[33,38] package org.apache.http.client.methods does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[34,35] package org.apache.http.impl.client does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[35,23] package org.apache.http does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[37,37] package org.apache.http.client.entity does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[38,38] package org.apache.http.client.methods does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[39,35] package org.apache.http.impl.client does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[41,1] package org.json does not exist
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[86,17] cannot find symbol
[ERROR] symbol: class CloseableHttpClient
[ERROR] location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[86,50] cannot find symbol
[ERROR] symbol: variable HttpClients
[ERROR] location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[87,17] cannot find symbol
[ERROR] symbol: class HttpPost
[ERROR] location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[87,41] cannot find symbol
[ERROR] symbol: class HttpPost
[ERROR] location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[89,28] cannot find symbol
[ERROR] symbol: class BasicNameValuePair
[ERROR] location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[89,84] cannot find symbol
[ERROR] symbol: class BasicNameValuePair
[ERROR] location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[90,44] cannot find symbol
[ERROR] symbol: class BasicNameValuePair
[ERROR] location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[91,44] cannot find symbol
[ERROR] symbol: class BasicNameValuePair
[ERROR] location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[93,40] cannot find symbol
[ERROR] symbol: class UrlEncodedFormEntity
[ERROR] location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[94,17] cannot find symbol
[ERROR] symbol: class CloseableHttpResponse
[ERROR] location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[98,21] cannot find symbol
[ERROR] symbol: class HttpEntity
[ERROR] location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[101,32] cannot find symbol
[ERROR] symbol: variable EntityUtils
[ERROR] location: class org.apache.ambari.view.Papi
[ERROR] /home/tmunson/ambari/ambari-views/examples/onefs-view/src/main/java/org/apache/ambari/view/isilon/Papi.java:[104,21] cannot find symbol
[ERROR] symbol: variable EntityUtils
[ERROR] location: class org.apache.ambari.view.Papi
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
I thought I had included all the necessary dependencies in my pom.xml file for the view, but apparently this is not the correct way to do it:
<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">
<parent>
<groupId>org.apache.ambari</groupId>
<artifactId>ambari-view-examples</artifactId>
<version>2.1.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>onefs-view</artifactId>
<packaging>jar</packaging>
<name>Isilon OneFS View</name>
<version>2.1.3</version>
<url>http://maven.apache.org</url>
<properties>
<ambari.dir>${project.parent.parent.parent.basedir}</ambari.dir>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.ambari</groupId>
<artifactId>ambari-views</artifactId>
<version>[1.7.0.0,)</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.3</version>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.8</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.0.1</version>
<executions>
<execution>
<phase>none</phase>
<goals>
<goal>rpm</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
So my questions are as follows:
1) Why won't Maven recognize the dependencies I've specified in my pom.xml file?
2) How would I go about making it recognize those dependencies? I'm kinda wondering if I just have the dependencies listed in the wrong place or something, but my understanding of how Maven works is that it will find the dependencies that you've specified in the pom.xml file and then download them and include them in your build. Since I'm including the dependencies but it's not recognizing them, I must be doing that wrong, but I have no clue what the right way to do it would be.
Thanks in advance for any help you all can offer!
If you define dependencies within the dependencyManagement section (like you did), those dependencies are not added to the project. They are only configured, so that POMs, which have this POM as parent, don't need to specify the version for a dependency (the dependency version becomes managed by the parent).
So in your case to resolve the problem, just remove the <dependencyManagement> and </dependencyManagement> tags.
Related
I am fairly new to Maven and trying to compile a very simple project. This 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bharani.aws</groupId>
<artifactId>com.bharani.aws.dynamo</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-bom</artifactId>
<version>1.11.106</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.16</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
When I do mvn compile, I get a bunch of cannot find symbol errors. Clearly, the dependencies are not downloaded and used. Here is the error log:
f45c89aa1b75:bharani-aws-dynamo janakiab$ mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building com.bharani.aws.dynamo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # com.bharani.aws.dynamo ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # com.bharani.aws.dynamo ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 2 source files to /Users/janakiab/code/bharani-aws-dynamo/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[3,54] package com.amazonaws.services.dynamodbv2.datamodeling does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[4,54] package com.amazonaws.services.dynamodbv2.datamodeling does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[5,54] package com.amazonaws.services.dynamodbv2.datamodeling does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[6,54] package com.amazonaws.services.dynamodbv2.datamodeling does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[7,14] package lombok does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[8,14] package lombok does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[9,14] package lombok does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[10,14] package lombok does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[11,14] package lombok does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[16,2] cannot find symbol
symbol: class Data
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[17,2] cannot find symbol
symbol: class Builder
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[18,2] cannot find symbol
symbol: class ToString
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[19,2] cannot find symbol
symbol: class NoArgsConstructor
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[20,2] cannot find symbol
symbol: class AllArgsConstructor
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[21,2] cannot find symbol
symbol: class DynamoDBTable
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[3,26] package com.amazonaws.auth does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[4,26] package com.amazonaws.auth does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[5,29] package com.amazonaws.regions does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[6,41] package com.amazonaws.services.dynamodbv2 does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[7,41] package com.amazonaws.services.dynamodbv2 does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[8,54] package com.amazonaws.services.dynamodbv2.datamodeling does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[33,13] cannot find symbol
symbol: class AmazonDynamoDB
location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[41,44] cannot find symbol
symbol: class AmazonDynamoDB
location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[41,13] cannot find symbol
symbol: class DynamoDBMapper
location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[24,6] cannot find symbol
symbol: class DynamoDBAutoGeneratedKey
location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[25,6] cannot find symbol
symbol: class DynamoDBHashKey
location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[28,6] cannot find symbol
symbol: class DynamoDBAttribute
location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[31,6] cannot find symbol
symbol: class DynamoDBAttribute
location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[34,6] cannot find symbol
symbol: class DynamoDBAttribute
location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[37,6] cannot find symbol
symbol: class DynamoDBAttribute
location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[40,6] cannot find symbol
symbol: class DynamoDBAttribute
location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[22,15] cannot find symbol
symbol: class AmazonDynamoDB
location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[23,15] cannot find symbol
symbol: class DynamoDBMapper
location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[36,38] cannot find symbol
symbol: class AWSStaticCredentialsProvider
location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[37,29] cannot find symbol
symbol: class BasicAWSCredentials
location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[35,29] cannot find symbol
symbol: variable Regions
location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[34,16] cannot find symbol
symbol: variable AmazonDynamoDBClientBuilder
location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[42,20] cannot find symbol
symbol: class DynamoDBMapper
location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[46,28] cannot find symbol
symbol: method builder()
location: class com.bharani.aws.CustomerInfo
[INFO] 39 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.560 s
[INFO] Finished at: 2017-10-04T18:46:40-07:00
[INFO] Final Memory: 15M/302M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project com.bharani.aws.dynamo: Compilation failure: Compilation failure:
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[3,54] package com.amazonaws.services.dynamodbv2.datamodeling does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[4,54] package com.amazonaws.services.dynamodbv2.datamodeling does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[5,54] package com.amazonaws.services.dynamodbv2.datamodeling does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[6,54] package com.amazonaws.services.dynamodbv2.datamodeling does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[7,14] package lombok does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[8,14] package lombok does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[9,14] package lombok does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[10,14] package lombok does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[11,14] package lombok does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[16,2] cannot find symbol
[ERROR] symbol: class Data
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[17,2] cannot find symbol
[ERROR] symbol: class Builder
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[18,2] cannot find symbol
[ERROR] symbol: class ToString
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[19,2] cannot find symbol
[ERROR] symbol: class NoArgsConstructor
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[20,2] cannot find symbol
[ERROR] symbol: class AllArgsConstructor
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[21,2] cannot find symbol
[ERROR] symbol: class DynamoDBTable
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[3,26] package com.amazonaws.auth does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[4,26] package com.amazonaws.auth does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[5,29] package com.amazonaws.regions does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[6,41] package com.amazonaws.services.dynamodbv2 does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[7,41] package com.amazonaws.services.dynamodbv2 does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[8,54] package com.amazonaws.services.dynamodbv2.datamodeling does not exist
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[33,13] cannot find symbol
[ERROR] symbol: class AmazonDynamoDB
[ERROR] location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[41,44] cannot find symbol
[ERROR] symbol: class AmazonDynamoDB
[ERROR] location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[41,13] cannot find symbol
[ERROR] symbol: class DynamoDBMapper
[ERROR] location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[24,6] cannot find symbol
[ERROR] symbol: class DynamoDBAutoGeneratedKey
[ERROR] location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[25,6] cannot find symbol
[ERROR] symbol: class DynamoDBHashKey
[ERROR] location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[28,6] cannot find symbol
[ERROR] symbol: class DynamoDBAttribute
[ERROR] location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[31,6] cannot find symbol
[ERROR] symbol: class DynamoDBAttribute
[ERROR] location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[34,6] cannot find symbol
[ERROR] symbol: class DynamoDBAttribute
[ERROR] location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[37,6] cannot find symbol
[ERROR] symbol: class DynamoDBAttribute
[ERROR] location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/CustomerInfo.java:[40,6] cannot find symbol
[ERROR] symbol: class DynamoDBAttribute
[ERROR] location: class com.bharani.aws.CustomerInfo
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[22,15] cannot find symbol
[ERROR] symbol: class AmazonDynamoDB
[ERROR] location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[23,15] cannot find symbol
[ERROR] symbol: class DynamoDBMapper
[ERROR] location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[36,38] cannot find symbol
[ERROR] symbol: class AWSStaticCredentialsProvider
[ERROR] location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[37,29] cannot find symbol
[ERROR] symbol: class BasicAWSCredentials
[ERROR] location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[35,29] cannot find symbol
[ERROR] symbol: variable Regions
[ERROR] location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[34,16] cannot find symbol
[ERROR] symbol: variable AmazonDynamoDBClientBuilder
[ERROR] location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[42,20] cannot find symbol
[ERROR] symbol: class DynamoDBMapper
[ERROR] location: class com.bharani.aws.Main
[ERROR] /Users/janakiab/code/bharani-aws-dynamo/src/main/java/com/bharani/aws/Main.java:[46,28] cannot find symbol
[ERROR] symbol: method builder()
[ERROR] location: class com.bharani.aws.CustomerInfo
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
f45c89aa1b75:bharani-aws-dynamo janakiab$
Can someone point me if I am missing something?
Thanks.
Your dependencies are defined inside of the < dependencyManagement > section. In this section it defines dependencies in a parent project and allows the same version to be used in sub-modules. If you remove the < dependencyManagement > tags and/or add the same thing in just < dependencies > and it should work properly.
See maven dependency management page for more details.
I've been searching for a tool, which is able to show you unused dependecies. I soon stumbled over the maven command mvn dependency:analyze. The problem with this is, that it often detects "unused" dependencies which let the build fail if missing.
Here is an example from an optimized Project:
$ mvn dependency:analyze
[INFO] Building LogfileTool 0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-dependency-plugin:2.8:analyze (default-cli) > test-compile # LogfileTool >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # LogfileTool ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # LogfileTool ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to C:\Projects\LogfileToolMa\LogfileTool\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # LogfileTool ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Projects\LogfileToolMa\LogfileTool\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # LogfileTool ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< maven-dependency-plugin:2.8:analyze (default-cli) < test-compile # LogfileTool <<<
[INFO]
[INFO] --- maven-dependency-plugin:2.8:analyze (default-cli) # LogfileTool ---
[WARNING] Unused declared dependencies found:
[WARNING] log4j:apache-log4j-extras:jar:1.2.17:compile
[WARNING] org.projectlombok:lombok:jar:1.16.18:provided
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
Dependencies in Pom.xml
<dependencies>
<!-- Logger -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
<version>1.2.17</version>
</dependency>
<!-- Generating Getter, Setter etc. -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.18</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
<type>jar</type>
</dependency>
</dependencies>
The used Packages of Lombok are:
lombok.AccessLevel
lombok.Data
lombok.Getter
lombok.Setter
By Removing lombok from my POM i get the following Error by Buildig the Project
-------------------------------------------------------------
COMPILATION ERROR :
-------------------------------------------------------------
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[7,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[8,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[9,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[10,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[26,2] cannot find symbol
symbol: class Data
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[13,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[14,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[15,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[16,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[26,2] cannot find symbol
symbol: class Data
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[34,4] cannot find symbol
symbol: class Getter
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[35,4] cannot find symbol
symbol: class Setter
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[35,4] cannot find symbol
symbol: class Getter
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[36,4] cannot find symbol
symbol: class Setter
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[62,7] cannot find symbol
symbol: method setXmlToRead(java.lang.String)
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[63,7] cannot find symbol
symbol: method setPathToLogfiles(java.lang.String)
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[63,7] cannot find symbol
symbol: method setPathForStorage(java.lang.String)
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[64,7] cannot find symbol
symbol: method setPathToLogfile(java.lang.String)
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
ch/glue/logfiletool/logfiletool/log_handler/LogfileReader.java:[93,50] cannot find symbol
symbol: method getPathToLogfiles()
location: variable logfileSearchConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
ch/glue/logfiletool/logfiletool/log_handler/LogfileReader.java:[95,100] cannot find symbol
symbol: method getXmlToRead()
location: variable logfileSearchConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
ch/glue/logfiletool/logfiletool/Main.java:[61,51] cannot find symbol
symbol: method getPathToLogfile()
location: variable logfileToolConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
ch/glue/logfiletool/logfiletool/Main.java:[71,52] cannot find symbol
symbol: method getPathForStorage()
location: variable logfileToolConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
22 errors
-------------------------------------------------------------
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1.747 s
Finished at: 2017-09-27T10:04:20+02:00
Final Memory: 14M/210M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project LogfileTool: Compilation failure: Compilation failure:
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[7,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[8,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[9,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[10,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[26,2] cannot find symbol
symbol: class Data
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[13,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[14,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[15,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[16,14] package lombok does not exist
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[26,2] cannot find symbol
symbol: class Data
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[34,4] cannot find symbol
symbol: class Getter
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[35,4] cannot find symbol
symbol: class Setter
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[35,4] cannot find symbol
symbol: class Getter
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[36,4] cannot find symbol
symbol: class Setter
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[62,7] cannot find symbol
symbol: method setXmlToRead(java.lang.String)
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[63,7] cannot find symbol
symbol: method setPathToLogfiles(java.lang.String)
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[63,7] cannot find symbol
symbol: method setPathForStorage(java.lang.String)
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[64,7] cannot find symbol
symbol: method setPathToLogfile(java.lang.String)
location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
ch/glue/logfiletool/logfiletool/log_handler/LogfileReader.java:[93,50] cannot find symbol
symbol: method getPathToLogfiles()
location: variable logfileSearchConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
ch/glue/logfiletool/logfiletool/log_handler/LogfileReader.java:[95,100] cannot find symbol
symbol: method getXmlToRead()
location: variable logfileSearchConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
ch/glue/logfiletool/logfiletool/Main.java:[61,51] cannot find symbol
symbol: method getPathToLogfile()
location: variable logfileToolConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
ch/glue/logfiletool/logfiletool/Main.java:[71,52] cannot find symbol
symbol: method getPathForStorage()
location: variable logfileToolConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
-> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
And without log4j-extras i get following Error by running the Project
log4j:ERROR Could not instantiate class [org.apache.log4j.rolling.RollingFileAppender].
java.lang.ClassNotFoundException: org.apache.log4j.rolling.RollingFileAppender
Both log4j and lombok are used in my Project. Do you have an Idea how to fix this or where this is comming from?
thank you in advance
I have also been running into the issue where project Lombok has been marked by dependency:analyze as an Unused declared dependency. Project Lombok does most of its magic compile time, and as such most annotations are removed after compilation. This is why Maven's dependency analyzer does not recognize it. And why it also fails to detect dependencies that are loaded using SPI.
We have worked around this by explicitly telling the Dependency analyzer plugin to ignore Project Lombok. This can be done with the <usedDependency> configuration option, or the more fine-grained <ignoreUnusedDeclaredDependency> as such:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<ignoredUnusedDeclaredDependencies>
<ignoredUnusedDeclaredDependency>org.projectlombok:lombok</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</plugin>
</plugins>
</pluginManagement>
PS regarding scopes: Lombok is a compile time dependency, but need not be on the classpath at runtime (or end up in your lib folder). The provided dependency states that the jar should be present for compilation, but at run-time it is expected to be provided by the runtime environment (e.g. the container you run it in). Since Lombok is not needed at runtime, there will be no problems when your runtime does not provide Lombok, contrary to what you'd expect from the Maven dependency declaration.
I added the following dependency list in pom.xml for my Rest assured project with maven:
<dependency>
<groupId>com.jayway.restassured</groupId>
<artifactId>rest-assured</artifactId>
<version>2.1.0</version>
<scope>test</scope>
</dependency>
Now I am trying to run following sample code:
import static com.jayway.restassured.RestAssured.*;
import static com.jayway.restassured.matcher.RestAssuredMatchers.*;
import static org.hamcrest.Matchers.*;
import java.util.*;
import org.testng.Assert;
import org.testng.annotations.*;
public class TestNGTest1 {
private Collection collection;
#Test
public void testGetSingleUserProgrammatic() {
Response res = get("/service/single-user");
assertEquals(200, res.getStatusCode());
String json = res.asString();
JsonPath jp = new JsonPath(json);
assertEquals("test#hascode.com", jp.get("email"));
assertEquals("Tim", jp.get("firstName"));
assertEquals("Testerman", jp.get("lastName"));
assertEquals("1", jp.get("id"));
}
}
But this is throwing error while doing mvn test
Error is:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (default-testCompile) on project GBAppAuomation: Compilation failure: Compilation failure:
[ERROR] /home/jay/temp/GB_MVN_Proj/GBAppAuomation/src/test/java/com/glassbeam/app/TestNGTest1.java:[50,2] error: cannot find symbol
[ERROR] class TestNGTest1
[ERROR] /home/jay/temp/GB_MVN_Proj/GBAppAuomation/src/test/java/com/glassbeam/app/TestNGTest1.java:[53,2] error: cannot find symbol
Corresponding symbols are get etc, which rest assured uses.
As asked here is complete error message::
Here is the complete error message:: **
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # GBAppAuomation ---
[INFO] Compiling 1 source file to /home/jay/temp/GB_MVN_Proj/GBAppAuomation/target/test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/jay/temp/GB_MVN_Proj/GBAppAuomation/src/test/java/com/glassbeam/app/TestNGTest1.java:[50,1] error: cannot find symbol
[ERROR] class TestNGTest1
/home/jay/temp/GB_MVN_Proj/GBAppAuomation/src/test/java/com/glassbeam/app/TestNGTest1.java:[50,17] error: cannot find symbol
[ERROR] class TestNGTest1
/home/jay/temp/GB_MVN_Proj/GBAppAuomation/src/test/java/com/glassbeam/app/TestNGTest1.java:[53,2] error: cannot find symbol
[ERROR] class TestNGTest1
/home/jay/temp/GB_MVN_Proj/GBAppAuomation/src/test/java/com/glassbeam/app/TestNGTest1.java:[53,20] error: cannot find symbol
[INFO] 4 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.384s
[INFO] Finished at: Sat Jan 04 15:26:57 IST 2014
[INFO] Final Memory: 16M/202M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (default-testCompile) on project GBAppAuomation: Compilation failure: Compilation failure:
[ERROR] /home/jay/temp/GB_MVN_Proj/GBAppAuomation/src/test/java/com/glassbeam/app/TestNGTest1.java:[50,1] error: cannot find symbol
[ERROR] class TestNGTest1
[ERROR] /home/jay/temp/GB_MVN_Proj/GBAppAuomation/src/test/java/com/glassbeam/app/TestNGTest1.java:[50,17] error: cannot find symbol
[ERROR] class TestNGTest1
[ERROR] /home/jay/temp/GB_MVN_Proj/GBAppAuomation/src/test/java/com/glassbeam/app/TestNGTest1.java:[53,2] error: cannot find symbol
[ERROR] class TestNGTest1
[ERROR] /home/jay/temp/GB_MVN_Proj/GBAppAuomation/src/test/java/com/glassbeam/app/TestNGTest1.java:[53,20] error: cannot find symbol
The problem seems to be related with dependencies.
Were there any compilation errors in the IDE?
Because the interface Response from the line below (probably line 50 from the error)
Response res = get("/service/single-user");
belongs to package com.jayway.restassured.response, whereas the only imports in the class related to restassured are
import static com.jayway.restassured.RestAssured.*;
import static com.jayway.restassured.matcher.RestAssuredMatchers.*;
And the JsonPath class from (probably line 53 from the error)
JsonPath jp = new JsonPath(json);
belongs to package com.jayway.jsonpath and also not imported.
This package should be also included into the POM as a dependency:
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>0.9.1</version>
</dependency>
Please pay attention to the groupId. There are two of them available. The one you need for the Restassured jars is: io.rest-assured.
Currently, this is the latest version :
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>3.0.3</version>
<scope>test</scope>
</dependency>
If a newer version becomes available, all you need to do is to change the version number in the dependency from 3.0.3 to the new one.
For your information, there is no longer a need to add a standalone JsonPath dependency as it is now fully embedded in the rest-assured artifact as given as above
I've got an application with Groovy and Java classes. Compilation under IDEA 11 works fine, but when i'm trying to compile with Maven it fails.
Project structure: src/main/groovy - for groovy classes, src/main/java - for java classes. For example, class TemplateWriter tries to use groovy class AbstractTemplate.
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\io\TemplateWriter.java:[16,29] cannot find symbol
symbol : class AbstractTemplate
Similar answers here. But nothing helps :(
My 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>adapter-builder</groupId>
<artifactId>adapter-builder</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.0.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>compile</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
The whole output from maven:compile
"C:\Program Files (x86)\Java\jdk1.6.0_31\bin\java" -Dclassworlds.conf=C:\apache-maven-2.2.1\bin\m2.conf -Dmaven.home=C:\apache-maven-2.2.1 -Didea.launcher.port=7535 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 11.0\bin" -Dfile.encoding=UTF-8 -classpath "C:\apache-maven-2.2.1\boot\classworlds-1.1.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 11.0\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher --no-plugin-registry --fail-fast --no-plugin-updates --strict-checksums --update-snapshots -f D:\Projects\SMEV\_Generator\adapter-builder\pom.xml compile
+ Enabling strict checksum verification on all artifact downloads.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - adapter-builder:adapter-builder:jar:1.0
[INFO] task-segment: [compile]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\Projects\SMEV\_Generator\adapter-builder\src\main\resources
[INFO] [compiler:compile {execution: default-compile}]
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 37 source files to D:\Projects\SMEV\_Generator\adapter-builder\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[7,0] package com.itransition.smev.builder.templates does not exist
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\io\TemplateWriter.java:[3,45] package com.itransition.smev.builder.templates does not exist
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\io\TemplateWriter.java:[16,29] cannot find symbol
symbol : class AbstractTemplate
location: class com.itransition.smev.builder.io.TemplateWriter
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[23,8] cannot find symbol
symbol : class VarTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[23,35] cannot find symbol
symbol : class VarTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[38,8] cannot find symbol
symbol : class WsXwikiSetDocTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[38,45] cannot find symbol
symbol : class WsXwikiSetDocTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[46,8] cannot find symbol
symbol : class WsXwikiSetDocRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[46,52] cannot find symbol
symbol : class WsXwikiSetDocRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[57,8] cannot find symbol
symbol : class WsXwikiSetDocResponseTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[57,53] cannot find symbol
symbol : class WsXwikiSetDocResponseTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[68,8] cannot find symbol
symbol : class WsXwikiGetSignRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[68,53] cannot find symbol
symbol : class WsXwikiGetSignRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[79,8] cannot find symbol
symbol : class WsFoivRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[79,45] cannot find symbol
symbol : class WsFoivRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[89,8] cannot find symbol
symbol : class TplRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[89,42] cannot find symbol
symbol : class TplRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[99,8] cannot find symbol
symbol : class TplResponseTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[ERROR] \Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[99,43] cannot find symbol
symbol : class TplResponseTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[INFO] 19 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[7,0] package com.itransition.smev.builder.templates does not exist
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\io\TemplateWriter.java:[3,45] package com.itransition.smev.builder.templates does not exist
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\io\TemplateWriter.java:[16,29] cannot find symbol
symbol : class AbstractTemplate
location: class com.itransition.smev.builder.io.TemplateWriter
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[23,8] cannot find symbol
symbol : class VarTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[23,35] cannot find symbol
symbol : class VarTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[38,8] cannot find symbol
symbol : class WsXwikiSetDocTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[38,45] cannot find symbol
symbol : class WsXwikiSetDocTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[46,8] cannot find symbol
symbol : class WsXwikiSetDocRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[46,52] cannot find symbol
symbol : class WsXwikiSetDocRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[57,8] cannot find symbol
symbol : class WsXwikiSetDocResponseTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[57,53] cannot find symbol
symbol : class WsXwikiSetDocResponseTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[68,8] cannot find symbol
symbol : class WsXwikiGetSignRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[68,53] cannot find symbol
symbol : class WsXwikiGetSignRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[79,8] cannot find symbol
symbol : class WsFoivRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[79,45] cannot find symbol
symbol : class WsFoivRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[89,8] cannot find symbol
symbol : class TplRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[89,42] cannot find symbol
symbol : class TplRequestTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[99,8] cannot find symbol
symbol : class TplResponseTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
\Projects\SMEV\_Generator\adapter-builder\src\main\java\com\itransition\smev\builder\core\AdapterFileGenerator.java:[99,43] cannot find symbol
symbol : class TplResponseTemplate
location: class com.itransition.smev.builder.core.AdapterFileGenerator
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Fri Dec 07 04:57:10 VET 2012
[INFO] Final Memory: 12M/33M
[INFO] ------------------------------------------------------------------------
Process finished with exit code 1
I have an app with these class:
(part of class):
#SessionScoped
#Named
public class UserSessionBean implements Serializable {
#javax.ws.rs.core.Context private HttpServletRequest httpRequest;
and during mvn compile, I have this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project highway-web: Compilation failure: Compilation failure:
[ERROR] /home/kelevra/java/git/ttkHighway/highway-web/src/main/java/com/kmware/ttk/highway/beans/session/UserSessionBean.java:[28,25] package javax.servlet.http does not exist
[ERROR]
[ERROR] /home/kelevra/java/git/ttkHighway/highway-web/src/main/java/com/kmware/ttk/highway/beans/session/UserSessionBean.java:[40,38] cannot find symbol
[ERROR] symbol : class HttpServletRequest
[ERROR] location: class com.kmware.ttk.highway.beans.session.UserSessionBean
[ERROR] -> [Help 1]
While making in IDEA there is no such problems. What it could be?
Java file UserSessionBean can not find the class HttpServletRequest.
You should check the dependencies declared in the pom file. Make sure that you include
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
Could you try a mvn clean install and see if it produces the same error.
P.S. Are you running the project from console or from an IDE.