Dependency Resolution Is Failing The Build Process on Circle CI : androidx.annotation - scala

My Circle CI build is failing because of this error:
[error] sbt.librarymanagement.ResolveException: Error downloading androidx.annotation:annotation:1.1.0
[error] Not found
[error] Not found
[error] not found: /home/circleci/.ivy2/local/androidx.annotation/annotation/1.1.0/ivys/ivy.xml
[error] not found: https://repo1.maven.org/maven2/androidx/annotation/annotation/1.1.0/annotation-1.1.0.pom
[error] at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:246)
[error] at lmcoursier.CoursierDependencyResolution.$anonfun$update$34(CoursierDependencyResolution.scala:215)
Locally my project builds w/o an issue so not sure why the Circle CI build doesn't work. Any ideas how to fix this?

According to https://mvnrepository.com/artifact/androidx.annotation/annotation/1.1.0, this artifact is only available from the Google repository.
You probably have this added as a resolver on your local machine?
resolvers += "google" at "https://maven.google.com/"

Related

Maven dependency: import cannot be resolved but is present in local repository (Eclipse Oomph Unzip Setup Task)

I have problems using Maven.
A Maven mvn clean package of the submodule "task-unzip" from the Eclipse Oomph's Unzip Setup Task repository (https://github.com/maybeec/oomph-task-unzip) fails with the following error on several machines/setups:
[INFO] --- tycho-compiler-plugin:0.22.0:compile (default-compile) # com.github.maybeec.oomph.task.unzip ---
[INFO] Compiling 13 source files to C:\FOLDER\repositories\oomph-task-unzip\task-unzip\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.983 s
[INFO] Finished at: 2020-10-28T18:35:49+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.22.0:compile (default-compile) on project com.github.maybeec.oomph.task.unzip: Compilation failure: Compilation failure:
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[7]
[ERROR] import org.apache.commons.compress.archivers.ArchiveEntry;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[8]
[ERROR] import org.apache.commons.compress.archivers.ArchiveInputStream;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[9]
[ERROR] import org.apache.commons.compress.archivers.ArchiveStreamFactory;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[10]
[ERROR] import org.apache.commons.compress.compressors.CompressorInputStream;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[11]
[ERROR] import org.apache.commons.compress.compressors.CompressorStreamFactory;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[12]
[ERROR] import org.apache.commons.compress.utils.IOUtils;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[47]
[ERROR] CompressorInputStream cIS = new CompressorStreamFactory().createCompressorInputStream(in);
[ERROR] ^^^^^^^^^^^^^^^^^^^^^
[ERROR] CompressorInputStream cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[47]
[ERROR] CompressorInputStream cIS = new CompressorStreamFactory().createCompressorInputStream(in);
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] CompressorStreamFactory cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[64]
[ERROR] ArchiveInputStream archiveIS = new ArchiveStreamFactory().createArchiveInputStream(fileIS);
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] ArchiveInputStream cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[64]
[ERROR] ArchiveInputStream archiveIS = new ArchiveStreamFactory().createArchiveInputStream(fileIS);
[ERROR] ^^^^^^^^^^^^^^^^^^^^
[ERROR] ArchiveStreamFactory cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[65]
[ERROR] ArchiveEntry entry;
[ERROR] ^^^^^^^^^^^^
[ERROR] ArchiveEntry cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[77]
[ERROR] IOUtils.copy(archiveIS, out);
[ERROR] ^^^^^^^
[ERROR] IOUtils cannot be resolved
[ERROR] 12 problems (12 errors)
[ERROR] -> [Help 1]
Maven is actually downloading the Apache commons-compress-1.19.jar to the local Maven repository and it is also being copied to the project's lib folder. So that is working and the dependency is actually present on the filesystem.
However, Maven can not find this dependency. Adding it manually to the project, the resolve failure can be solved, but that is not a solution to the problem it's not working with Maven.
Importing the submodule in Eclipse shows the same. Eclipse isn't able to auto-complete an "import" statement to "org.apache.commons.*":
The Properties > Build path of that submodule doesn't show any Maven dependencies (actually the "Maven Dependencies" list wasn't even there! I had to follow https://stackoverflow.com/a/27337064/5446400 and edit the .classpath file for that). However it's still empty:
Searching and working for hours on that problem I couldn't come up with an explanation why Maven behaves the way it does.
Thank you for any support!
Maven dependencies shouldn't need to be added to the build path of Eclipse plugins. The plugin dependencies are enough and in this case commons-compress-1.19.jar will be loaded as a library from within the plugin's lib directory (this is defined in the build.properties file), not directly as a Maven dependency.
I'm not sure if downloading a Maven dependency and using it in the same build will work this way. If it gets copied to the correct location, you might just need to refresh the workspace, otherwise the jar could get ignored in the Eclipse build.
For debugging the issue I would probably download the artifact and place the jar in the lib directory manually once and ditch the automated process. Then at least you see if this unusual handling of Maven dependencies is the issue or something else.

How to include a library on bintray in Scala Maven project

I'm making a project in Scala (2.11), using Maven as my build tool. I'd like to use this library, but I can't get it to work.
I have a minimal (2 files) example repository here: https://github.com/evertheylen/scala-maven-bintray-example
I added two dependencies, kafka and scala-kafka-client. Both times I followed the instructions on their respective websites, but the last one (from bintray) is giving me problems. I would like the repository to be defined in the project, and not in my personal settings.xml (though I did try that and it didn't work).
The error given to me by mvn package exec:java -Dexec.mainClass=be.evertheylen.SampleApplication is:
[ERROR] .../src/main/scala/SampleApplication.scala:3: error: not found: object cakesolutions
[ERROR] import cakesolutions.kafka.KafkaProducer
[ERROR] ^
[ERROR] .../src/main/scala/SampleApplication.scala:4: error: not found: object cakesolutions
[ERROR] import cakesolutions.kafka.KafkaProducer.Conf
[ERROR] ^
[ERROR] two errors found
Although mvn dependency:list does in fact list the library:
[INFO] The following files have been resolved:
...
[INFO] net.cakesolutions:scala-kafka-client_2.11:pom:0.10.0.0-RC2:compile
...
Try removing <type>pom</type> from the dependency declaration in your pom.xml.

How to install sbt-sh plugin

https://github.com/steppenwells/sbt-sh
I'm using sbt 0.13.9 and try to install sbt-sh with given instructions. However sbt does not recognize sh command:
> sh ls
[error] Expected ID character
[error] Not a valid command: sh
[error] Expected 'show'
[error] Expected project ID
[error] Expected configuration
[error] Expected ':' (if selecting a configuration)
[error] Expected key
[error] Not a valid key: sh
[error] sh ls
[error] ^
>
Instructions are for sbt 0.10, maybe things have changed since those days and this guide is out of date?
The instructions are a bit outdated. Instead of ~/.sbt/plugins/project, you should put the MyPlugins object in ~/.sbt/0.13/plugins/project/MyPlugins.scala.
However, sbt-sh doesn't seem to work, even with that correction:
[error] $HOME/.sbt/0.13/staging/1375c2d4ab8153e18523/sbt-sh/src/main/scala/org/sbtsh/SbtShPlugin.scala:4: object CommandSupport is not a member of package sbt
[error] import sbt.CommandSupport._
[error] ^
[error] one error found
[error] ({git://github.com/steppenwells/sbt-sh.git}sbt-sh/compile:compileIncremental) Compilation failed
Can you try xsbt-sh instead?
Create a file ~/.sbt/0.13/plugins/xsbt-sh.sbt with this content:
resolvers += "Element Releases" at "http://repo.element.hr/nexus/content/repositories/releases/"
addSbtPlugin("hr.element.xsbt" % "xsbt-sh" % "0.0.2")
The Github README refers to 0.1.0 but that doesn't seem to have been yet released to the repository.

I'm getting the following when trying to compile the Program

I am getting a mojofailure exception error.
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project maven-war-plugin: Compilation failure: Compilation failure:
[ERROR] \Users\admin\Desktop\Virtual_class\src\main\java\com\iws\controller\LoginController.java:[42,25] error: package javax.servlet.http does not exist
[ERROR] \Users\admin\Desktop\Virtual_class\src\main\java\com\iws\controller\LoginController.java:[43,25] error: package javax.servlet.http does not exist
[ERROR] \Users\admin\Desktop\Virtual_class\src\main\java\com\iws\controller\LoginController.java:[92,3] error: cannot find symbol
[ERROR] \Users\admin\Desktop\Virtual_class\src\main\java\com\iws\controller\LoginController.java:[93,3] error: cannot find symbol
[ERROR] \Users\admin\Desktop\Virtual_class\src\main\java\com\iws\controller\LoginController.java:[117,3] error: cannot find symbol
[ERROR] \Users\admin\Desktop\Virtual_class\src\main\java\com\iws\controller\LoginController.java:[117,31] error: cannot find symbol
[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 have seen this happen when you do not include the servlet-api.jar on your classpath. The servlet-api.jar is found in your container or application server.
For example, if you are running your application on Tomcat, be sure that tomcat is included on your classpath.

i want to build the developing environment of sakai oae on windows 7,but i don't know how to do it?

my OS is windows7.in the cmd, i run:
cd sakai3/3akai-ux
mvn clean install
i got:
[INFO] BUILD SUCCESS
then i run:
cd sakai3/nakamura
set MAVEN_OPTS="-Xmx256m -XX:PermSize=256m"
mvn clean install
i got this error:
[ERROR] Failed to execute goal org.apache.sling:maven-launchpad-plugin:2.1.0:pre
pare-package (prepare-package-jar) on project org.sakaiproject.nakamura.app: Una
ble to find artifact. Failure to find org.sakaiproject.nakamura:org.sakaiproject
.nakamura.ojdbc:jar:CURRENT-VERSION in http://repo1.maven.org/maven2/ was cached
in the local repository, resolution will not be reattempted until the update in
terval of maven repo has elapsed or updates are forced
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.sakaiproject.nakamura -DartifactI
d=org.sakaiproject.nakamura.ojdbc -Dversion=CURRENT-VERSION -Dpackaging=jar -Dfi
le=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file t
here:
[ERROR] mvn deploy:deploy-file -DgroupId=org.sakaiproject.nakamura -DartifactId=
org.sakaiproject.nakamura.ojdbc -Dversion=CURRENT-VERSION -Dpackaging=jar -Dfile
=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR]
[ERROR] org.sakaiproject.nakamura:org.sakaiproject.nakamura.ojdbc:jar:CURRENT-VE
RSION
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] maven repo (http://repo1.maven.org/maven2/, releases=true, snapshots=fal
se),
[ERROR] apache-snapshots (http://repository.apache.org/snapshots/, releases=fals
e, snapshots=true),
[ERROR] sakai-releases (http://source.sakaiproject.org/maven2/, releases=true, s
napshots=false),
[ERROR] sakai-snapshots (http://source.sakaiproject.org/maven2-snapshots, releas
es=false, snapshots=true),
[ERROR] java.net (http://download.java.net/maven/2, releases=true, snapshots=fal
se),
[ERROR] modularity-releases (http://m2.modularity.net.au/releases, releases=true
, snapshots=false),
[ERROR] modularity-snapshots (http://m2.modularity.net.au/snapshots, releases=fa
lse, snapshots=true),
[ERROR] OPS4J (http://repository.ops4j.org/maven2, releases=true, snapshots=fals
e),
[ERROR] sonatype (https://oss.sonatype.org/content/repositories/releases/, relea
ses=true, snapshots=false),
[ERROR] sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/
snapshots, releases=false, snapshots=true),
[ERROR] central (http://repo.maven.apache.org/maven2, releases=true, snapshots=f
alse)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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/MojoExecutionE
xception
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :org.sakaiproject.nakamura.app
then i install the org.sakaiproject.nakamura.ojdbc.jar use this command under the folder D:\sakai3\nakamura\contrib\oracle-jdbc:
mvn deploy:deploy-file -DgroupId=org.sakaiproject.nakamura -DartifactId=org.sakaiproject.nakamura.ojdbc -Dversion=1.4.2 -Dpackaging=jar -Dfile=ojdbc6.jar -Durl=url -DrepositoryId=repositoryId
mvn install:install-file -DgroupId=org.sakaiproject.nakamura -DartifactI
d=com.oracle-jdbc -Dversion=1.4.2 -Dpackaging=jar -Dfi
le=ojdbc6.jar
then i got a new error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
deploy-file (default-cli) on project org.sakaiproject.nakamura.ojdbc: No transfe
r protocol found. -> [Help 1]
what should i do next???i have searched many website,but i haven't got a good idea.i don't know where i wrong or what i missing?
I an a chinese.please forgive my broken English.Thank you!
Your best bet is to ask on the Sakai OAE developers list.
But I believe the problem is the same as what I answered here.