java - Issues with javac compilation errors and Maven dependency resolution -


i'm "noob" when comes maven. i've used ant in past, not enough maven make "stick" me.

here problem. i'm attempting write java program parse json files relevant information , generate csv files upload using proprietary tool uploads csv files. built project using maven. program use google gson library, listed dependency in pom file (included below). when execute "mvn compile", maven returns error indicating package maven should resolving via dependency management features doesn't exist.

specific error:

"error: package com.google.code.gson not exist" 

here pom file:

<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>com.acumen.app</groupid>   <artifactid>catalogconverter</artifactid>   <packaging>jar</packaging>   <version>1.0-snapshot</version>   <name>catalogconverter</name>   <url>http://maven.apache.org</url>   <build>     <plugins>       <plugin>       <artifactid>maven-compiler-plugin</artifactid>       <version>2.3.2</version>       <configuration>         <source>1.7</source>         <target>1.7</target>       </configuration>       </plugin>     </plugins>   </build>   <dependencies>     <dependency>       <groupid>junit</groupid>       <artifactid>junit</artifactid>       <version>3.8.1</version>       <scope>test</scope>     </dependency>     <dependency>       <groupid>com.google.code.gson</groupid>       <artifactid>gson</artifactid>       <version>2.3.1</version>       <scope>compile</scope>     </dependency>   </dependencies>   <properties>     <project.build.sourceencoding>utf-8</project.build.sourceencoding>   </properties> </project> 

i have import statement in java application class should resolvable based upon maven downloading dependencies, if understanding of maven correct. here import statement.

import com.google.code.gson.gson; 

so question is, why maven not compile code? don't think have misconfigured import nor pom file. though, debatable! can go local maven "repo" , see jars were, in fact, downloaded. i'm error "user error", making mistakes?

i don't believe "provided" correct dependency because jar files needed successful compilation , must downloaded (since no container server or other mechanism resolve them me). application execute jar itself.

in version of gson must

import com.google.gson.gson; 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -