Maven: mvn compile failure. "package does not exist". Dependency included in maven, Other SO Solutions Not Working. What am I missing?
<p>I know that there are a lot of other SO answers on this topic, and although <a href="https://stackoverflow.com/questions/7339264/maven-package-error-org-apache-commons-lang-does-not-exist-java">this question</a> seems to have been the most useful, none of those solutions have led me to a complete resolution of my problem. So I could use a bit more help.</p>

<p>I have a Netbeans project created by someone who worked at my company before me, that has never been built with Maven, and I have haven't fully dived into the source of the project yet. However, because the number of dependencies for the project seemed overwhelming to me, I decided that I needed to figure out a management solution. This led me to Maven, and then indirectly to Apache Archiva.</p>

<p>So I set up an Archiva repository and uploaded all of the dependencies needed by the project. All of these artifacts are JAR files. I then created a pom.xml file in the preexisting project directory and tweaked the build settings to match the project. Now the project directory looks like this:</p>

<p><a href="https://i.stack.imgur.com/n9spF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n9spF.jpg" alt="ProjectStructure and Import Error In Source Code"></a></p>

<p>In the above screenshot, you can also see the error on line 12. This error says "package.imgscalr does not exist" this is later echoed by mvn compile.</p>

<p>The full project POM looks like this:</p>

<pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;!--LISCENSE HEADER--&gt;
    &lt;project&gt;
        &lt;groupId&gt;com.glsarchives&lt;/groupId&gt;
        &lt;artifactId&gt;GLSLib&lt;/artifactId&gt;
        &lt;version&gt;1.0&lt;/version&gt;
        &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
        &lt;packaging&gt;jar&lt;/packaging&gt;
        &lt;dependencies&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;commons-lang&lt;/groupId&gt;
                &lt;artifactId&gt;commons-lang&lt;/artifactId&gt;
                &lt;version&gt;2.1&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;at.unbounded&lt;/groupId&gt;
                &lt;artifactId&gt;serialization.jar&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;com.businessobjects.sdk&lt;/groupId&gt;
                &lt;artifactId&gt;cecore&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;com.businessobjects.sdk&lt;/groupId&gt;
                &lt;artifactId&gt;celib&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;com.businessobjects.sdk&lt;/groupId&gt;
                &lt;artifactId&gt;ceplugins&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;com.businessobjects.sdk&lt;/groupId&gt;
                &lt;artifactId&gt;cereports&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;com.businessobjects.sdk&lt;/groupId&gt;
                &lt;artifactId&gt;cesession&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;com.businessobjects.sdk&lt;/groupId&gt;
                &lt;artifactId&gt;ceutils&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;com.businessobjects.sdk&lt;/groupId&gt;
                &lt;artifactId&gt;corbaidl&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;com.businessobjects.sdk&lt;/groupId&gt;
                &lt;artifactId&gt;ebus405&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;com.businessobjects.sdk&lt;/groupId&gt;
                &lt;artifactId&gt;MetafileRenderer&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;com.businessobjects.sdk&lt;/groupId&gt;
                &lt;artifactId&gt;rasapp&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;com.businessobjects.sdk&lt;/groupId&gt;
                &lt;artifactId&gt;rascore&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
                &lt;artifactId&gt;log4j&lt;/artifactId&gt;
                &lt;version&gt;1.2.17&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;org.dspace.xmlui.concurrent&lt;/groupId&gt;
                &lt;artifactId&gt;Concurrent&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
                &lt;artifactId&gt;eclipselink&lt;/artifactId&gt;
                &lt;version&gt;2.5.2&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;org.imgscalr&lt;/groupId&gt;
                &lt;artifactId&gt;imgscalr-lib&lt;/artifactId&gt;
                &lt;version&gt;4.2&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;org.lucee&lt;/groupId&gt;
                &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
                &lt;version&gt;1.1.1&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;org.lucee&lt;/groupId&gt;
                &lt;artifactId&gt;xml-apis&lt;/artifactId&gt;
                &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;javax.persistence&lt;/artifactId&gt;
              &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
              &lt;groupId&gt;org.netbeans.lib&lt;/groupId&gt;
              &lt;artifactId&gt;awtextra&lt;/artifactId&gt;
              &lt;version&gt;0.0&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
              &lt;groupId&gt;org.netbeans.external&lt;/groupId&gt;
              &lt;artifactId&gt;AbsoluteLayout&lt;/artifactId&gt;
              &lt;version&gt;0.0&lt;/version&gt;
            &lt;/dependency&gt;
        &lt;/dependencies&gt;

        &lt;build&gt;
            &lt;sourceDirectory&gt;./src&lt;/sourceDirectory&gt;
            &lt;finalName&gt;GLSLib&lt;/finalName&gt;
            &lt;plugins&gt;
                &lt;plugin&gt;
                    &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                    &lt;version&gt;3.1&lt;/version&gt;
                    &lt;configuration&gt;
                        &lt;source&gt;1.8&lt;/source&gt;
                        &lt;target&gt;1.8&lt;/target&gt;
                    &lt;/configuration&gt;
                &lt;/plugin&gt;
            &lt;/plugins&gt;
        &lt;/build&gt;

        &lt;repositories&gt;
            &lt;repository&gt;
              &lt;id&gt;GLS-Java-Repo&lt;/id&gt;
              &lt;name&gt;Java Repository&lt;/name&gt;
              &lt;url&gt;http://archiva:8080/repository/GLS-Java-Repo/&lt;/url&gt;
              &lt;releases&gt;
                &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/releases&gt;
              &lt;snapshots&gt;
                &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/snapshots&gt;
            &lt;/repository&gt;
          &lt;/repositories&gt;
          &lt;pluginRepositories&gt;
              &lt;pluginRepository&gt;
                  &lt;id&gt;GLS-Java-Repo&lt;/id&gt;
                  &lt;name&gt;Java Repository&lt;/name&gt;
                  &lt;url&gt;http://archiva:8080/repository/GLS-Java-Repo/&lt;/url&gt;
                  &lt;releases&gt;
                      &lt;enabled&gt;true&lt;/enabled&gt;
                  &lt;/releases&gt;
                  &lt;snapshots&gt;
                      &lt;enabled&gt;true&lt;/enabled&gt;
                  &lt;/snapshots&gt;
              &lt;/pluginRepository&gt;
          &lt;/pluginRepositories&gt;
    &lt;/project&gt;
</code></pre>

<p>When I run <code>mvn compile -X</code>, I get the following output:</p>

<pre><code>[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building GLSLib 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ GLSLib ---

[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\GLS_DEVELOPER\GLS_Projects\GLS_Lib
\Repositories\GIT\GLS-Lib_PR_Repo\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ GLSLib ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. b
uild is platform dependent!
[INFO] Compiling 91 source files to C:\GLS_DEVELOPER\GLS_Projects\GLS_Lib\Reposi
tories\GIT\GLS-Lib_PR_Repo\target\classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] /C:/GLS_DEVELOPER/GLS_Projects/GLS_Lib/Repositories/GIT/GLS-Lib_PR_Rep
o/src/gls/ui/emp/EmpComboBoxPanel.java: Some input files use unchecked or unsafe
 operations.
[WARNING] /C:/GLS_DEVELOPER/GLS_Projects/GLS_Lib/Repositories/GIT/GLS-Lib_PR_Rep
o/src/gls/ui/emp/EmpComboBoxPanel.java: Recompile with -Xlint:unchecked for deta
ils.
[INFO] 2 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/GLS_DEVELOPER/GLS_Projects/GLS_Lib/Repositories/GIT/GLS-Lib_PR_Repo/
src/gls/image/ImagePanel.java:[12,20] package org.imgscalr does not exist
[ERROR] /C:/GLS_DEVELOPER/GLS_Projects/GLS_Lib/Repositories/GIT/GLS-Lib_PR_Repo/
src/gls/image/ImagePanel.java:[106,18] cannot find symbol
  symbol:   variable Scalr
  location: class gls.image.ImagePanel
[ERROR] /C:/GLS_DEVELOPER/GLS_Projects/GLS_Lib/Repositories/GIT/GLS-Lib_PR_Repo/
src/gls/image/ImagePanel.java:[128,18] cannot find symbol
  symbol:   variable Scalr
  location: class gls.image.ImagePanel
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.154 s
[INFO] Finished at: 2016-09-14T12:31:34-04:00
[INFO] Final Memory: 17M/321M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
1:compile (default-compile) on project GLSLib: Compilation failure: Compilation
failure:
[ERROR] /C:/GLS_DEVELOPER/GLS_Projects/GLS_Lib/Repositories/GIT/GLS-Lib_PR_Repo/
src/gls/image/ImagePanel.java:[12,20] package org.imgscalr does not exist
[ERROR] /C:/GLS_DEVELOPER/GLS_Projects/GLS_Lib/Repositories/GIT/GLS-Lib_PR_Repo/
src/gls/image/ImagePanel.java:[106,18] cannot find symbol
[ERROR] symbol:   variable Scalr
[ERROR] location: class gls.image.ImagePanel
[ERROR] /C:/GLS_DEVELOPER/GLS_Projects/GLS_Lib/Repositories/GIT/GLS-Lib_PR_Repo/
src/gls/image/ImagePanel.java:[128,18] cannot find symbol
[ERROR] symbol:   variable Scalr
[ERROR] location: class gls.image.ImagePanel
[ERROR] -&gt; [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on p
roject GLSLib: Compilation failure
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre
adedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compila
tion failure
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(Abstrac
tCompilerMojo.java:858)
        at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.ja
va:129)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:207)
        ... 20 more
[ERROR]
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
</code></pre>

<p>So, the obvious problem is that maven can't seem to find the <code>org.imgscalr</code> package. But, none of my dependencies were overwritten or removed--based on the dependency tree produced by <code>mvn dependency:tree -Dverbose</code>, including the <code>imgscalr-lib</code> dependency (This is a JAR which contains the <code>org.imgscalr</code> package and <code>META-INF</code>).</p>

<p>Suspecting corruption, I deleted the imgscaler-lib folder in the local repository--and then the entire repository--neither of these worked. Upon compiling, Maven reacquired all of the files from my Archiva repository, but the problem persists.</p>

<p>I have checked <code>mvn help:effective-pom</code>, and it seems to match my pom.xml.</p>

<p>I have also tried running <code>mvn dependency:copy-dependencies</code> as suggested in the linked question, and all of my libraries are successfully copied into the target directory, including the library in question: <code>org.imgscalr</code></p>

<p>What am I missing here?</p>

<p>edit: Updated pom.xml to add repository information</p>

<p>edit: The reason I have very weird version numbers in my pom.xml is because I uploaded artifacts to Archiva from a folder given to me by my predecessor. A lot of loose artifacts didn't have any version numbers, so I labeled these unknown version numbers "0.0"</p>

<p>edit: Deleted repository again after adding repo information to pom.xml. Ran another clean goal and another compile goal. Maven reacquired dependencies. I have confirmed that maven is getting the artifact from my Archiva Repository. Problem persists.</p>