Installing Enclosure with Netbeans - netbeans

I am having trouble installing Enclosure and getting it to work. I have followed this guide http://www.enclojure.org/gettingstarted and successfully installed Enclosure (I think). However, when I try to build the sample application (labrepl) I get a bunch of errors and a failed build. I haven't used Java in a long time and I've never used Netbeans, and the error doesn't seem very helpful with my limited knowledge of this domain. I'm using the latest Netbeans and the Enclosure URL from the guide. Since I am on Windows, I can't use git to clone the repo, so I'm not sure what to do from here.
Anyway, here are the error messages.
WARNING: You are running embedded Maven builds, some build may fail due to incompatibilities with latest Maven release.
To set Maven instance to use for building, click here.
Scanning for projects...
[#process-resources]
[resources:resources]
Using default encoding to copy filtered resources.
[#compile]
[ERROR]Transitive dependency resolution for scope: compile has failed for your project.
[ERROR]Error message: Missing:
[ERROR]----------
[ERROR]1) org.clojure:clojure-contrib:jar:1.2.0-master-SNAPSHOT
[ERROR] Try downloading the file manually from the project website.
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.clojure -DartifactId=clojure-contrib -Dversion=1.2.0-master-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.clojure -DartifactId=clojure-contrib -Dversion=1.2.0-master-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] Path to dependency:
[ERROR] 1) labrepl:labrepl:jar:0.0.1
[ERROR] 2) org.clojure:clojure-contrib:jar:1.2.0-master-SNAPSHOT
[ERROR]----------
[ERROR]1 required artifact is missing.
[ERROR]for artifact:
[ERROR] labrepl:labrepl:jar:0.0.1
[ERROR]from the specified remote repositories:
[ERROR] central (http://repo1.maven.org/maven2),
[ERROR] clojars (http://clojars.org/repo/),
[ERROR] incanter (http://repo.incanter.org),
[ERROR] clojure-snapshots (http://build.clojure.org/snapshots),
[ERROR] clojure (http://build.clojure.org/releases),
[ERROR] clojure-releases (http://build.clojure.org/releases)
[ERROR]Group-Id: labrepl
[ERROR]Artifact-Id: labrepl
[ERROR]Version: 0.0.1
[ERROR]From file: C:\Users\chloey\Documents\NetBeansProjects\RelevanceLabRepl\pom.xml
------------------------------------------------------------------------
For more information, run with the -e flag
------------------------------------------------------------------------
BUILD FAILED
------------------------------------------------------------------------
Total time: 1 second
Finished at: Wed Jun 09 21:53:04 CDT 2010
Final Memory: 72M/172M
------------------------------------------------------------------------
Thanks all.

the missing artifact is the artifact itself. What command are you using to build it? Try mvn clean install on the command line if everything else fails.

I had the same problem so I did a clean install of Netbeans followed by and install of maven both to no avail.
When I went to download the missing artifact I noticed that clojure-contrib version 1.2.0 was not available for download. Changing the pom.xml to look for version 1.1.0 resulted in a successful build.
Open the pom.xml and change
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure-contrib</artifactId>
<version>1.2.0-master-SNAPSHOT</version>
</dependency>
to
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure-contrib</artifactId>
<version>1.1.0-master-SNAPSHOT</version>
</dependency>
By the looks of things some additional functionality within 1.2.0 is needed for labrepl not sure from where to download it.

Related

Building Eclipse plugin with Tycho from mirrored P2 Repository in Nexus

After endless reading and testing out different things, I now have to ask my specific question.
A few information about my project:
I would like to build a Eclipse plugin with Maven to integrate it in our CI/CD process.
We're using Eclipse-2019-06.
I'm in a separate developing network where I only have access to the internet via proxy.
A Nexus is running which is mirroring all the needed Maven repositories (Central and so).
Because of the proxy problem I installed the P2 Nexus plugin and bridge to add the Eclipse P2 repository https://download.eclipse.org/releases/2019-06/201906191000/ in our Nexus to mirror it locally. So the Nexus repository points now from the official P2 download site to the local http://nexus:8081/nexus/content/repositories/eclipse-repository address.
The first thing I tried then, was to add the update site http://nexus:8081/nexus/content/repositories/eclipse-repository to the running Eclipse installation to access all the plugins and so on. This works fine!
So now I'm trying to build the official Eclipse Plugin Tycho demo itp01 from https://github.com/eclipse/tycho-demo.
And here comes the problem: I changed the repositories section in the official pom.xml to
<repositories>
<repository>
<id>eclipse-repo</id>
<layout>p2</layout>
<url>http://nexus:8081/nexus/content/repositories/eclipse-repository</url>
</repository>
</repositories>here
When I now try to build the itp01 project I get the so often seen error:
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: tycho.demo.itp01 1.0.0.qualifier
[ERROR] Missing requirement: tycho.demo.itp01 1.0.0.qualifier requires 'osgi.bundle; org.eclipse.core.runtime 3.15.300' but it could not be found
[ERROR]
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: tycho.demo.itp01:tycho.demo.itp01:1.0.0-SNAPSHOT # /home/frto100/git/org.eclipse.tycho-demo/itp01/tycho.demo.itp01/pom.xml: See log for details -> [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/MavenExecutionException
It looks like it's not possible for Tycho to read the artifacts from the P2 repository in Nexus.
Secondhand I'm not sure if Tycho even evaluates the given repository URL. Is it possible to check if Tycho is really using the correct URL?
Can somebody maybe give me a hint where the problem could be? Or maybe somebody already solved this problem.
Thanks so much!
If you are using Maven 3.6.1 (which is embedded in Eclipse 2019-06 and 2019-09), you probably ran into the following issue:
Maven issue MNG-6642: Tycho-based modules do not build with 3.6.1 (works with 3.6.0)
Using a different Maven version than 3.6.1 should solve the issue.

Eclipse Tycho: Compile error when using the java.xml.bind module?

I think the problem is the same as described in this blog post but I get this for Java 10: I have an Eclipse RCP application that uses Java 10 features but also JAXB classes. In Eclipse, I have to add the java.xml.bind module to the build path configuration of my project (as described here) to let the compile errors go away.
However, when building the product with Tycho 1.2.0 I get the following error, exactly for the class that uses JAXB:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.2.0:compile (default-compile) on project epd-editor: Compilation failure: Compilation failure:
[ERROR] ...app\src\app\editors\XmlPage.java:
[ERROR] package app.editors;
[ERROR] ^
[ERROR] Internal compiler error: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.lookup.BinaryModuleBinding.create(BinaryModuleBinding.java:64)
[ERROR] java.lang.NullPointerException
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.BinaryModuleBinding.create(BinaryModuleBinding.java:64)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getModuleFromAnswer(LookupEnvironment.java:427)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForTypeFromModules(LookupEnvironment.java:367)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:228)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:105)
Is there a way to configure the Tycho compiler plugin so that it can see modules like java.xml.bind or is there another reason for this error?
Thanks.
Java EE modules are deprecated for removal and not resolved by default and will be removed in Java 11.
The best way to handle this is to use a third-party dependency, but as you observe JDT trips over its own feet when that is done. I opened an issue and it was fixed some time ago, but it's not easy to find an artifact that contains the change and works on Java 10. The first artifact I know of comes from Eclipse Photon I20180531-0700.
Execute the following in Eclipse's plugins folder (#people from the future: you may have to update the version):
mvn install:install-file \
-Dfile=org.eclipse.jdt.core_3.14.0.v20180528-0519.jar \
-DgroupId=org.eclipse.tycho \
-DartifactId=org.eclipse.jdt.core \
-Dversion=3.14.0.v20180528-0519 \
-Dpackaging=jar
You can then use it as follows as dependencies for Maven's compiler plugin:
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-jdt</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<!-- unreleased version that was pulled from Eclipse Photon I20180531-0700
contains the fix and compiles Java 10 -->
<version>3.14.0.v20180528-0519</version>
</dependency>
The problem is also described on java9.wtf with a demo project on GitHub. (I forgot to push, so it's only online for about five minutes now. 😒)
There are three ways you can include modules from the java.se.ee aggregator module, which is not included for compile or runtime in JDK 10. (As of JDK 11, these modules will be removed from the JDK).
The simplest is to use the command line option, --add-modules java.xml.bind. This will use the version that is still included in the JDK.
Find a JAXB implementation jar. Maven central is a good place to go for this, there is also a reference implementation for JSR 222 (JAXB), which is part of the Java Web Services Developer Pack (http://www.oracle.com/technetwork/java/webservicespack-jsp-140788.html) but this is waaaay old and may not be the best choice. You can add where you've downloaded the jar to the upgrade module path using --upgrade-module-path {path}
An alternative to 2 is to simply put the jar containing JAXB on the classpath.
I'm not familiar with Tycho but you would need to figure out how to use one of these methods with its configuration.

Building Apache Spark 2.1.0 from source fails

Am trying to build Apache Spark 2.1.0 source, but get these errors below that baffle me...
Hadoop 2.8.0 was installed and is working
Scala 2.12.1 was installed in advance of executing the Spark install (Which seems to auto install Scala 2.11.8 ?!?)
My build line is:
build/mvn -Pyarn -Phadoop-2.7 -Dhadoop.version=2.7.0 -DskipTests clean package
Does anybody know why I get:
user#server:/usr/local/share/spark/spark-2.1.0$ sudo /usr/local/share/spark/spark-2.1.0/build/mvn -Pyarn -Phadoop-2.7 -Dhadoop.version=2.7.0 -DskipTests clean package
[sudo] password for user:
exec: curl --progress-bar -L https://downloads.typesafe.com/zinc/0.3.9/zinc-0.3.9.tgz
######################################################################## 100.0%
exec: curl --progress-bar -L https://downloads.typesafe.com/scala/2.11.8/scala-2.11.8.tgz
######################################################################## 100.0%
exec: curl --progress-bar -L https://www.apache.org/dyn/closer.lua?action=download&filename=/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
######################################################################## 100.0%
Using `mvn` from path: /usr/local/share/spark/spark-2.1.0/build/apache-maven-3.3.9/bin/mvn
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
[INFO] Scanning for projects...
Downloading: https://repo1.maven.org/maven2/org/apache/apache/14/apache-14.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.apache.spark:spark-parent_2.11:2.1.0: Could not transfer artifact org.apache:apache:pom:14 from/to central (https://repo1.maven.org/maven2): repo1.maven.org: Name or service not known and 'parent.relativePath' points at wrong local POM # line 22, column 11
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.apache.spark:spark-parent_2.11:2.1.0 (/usr/local/share/spark/spark-2.1.0/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.apache.spark:spark-parent_2.11:2.1.0: Could not transfer artifact org.apache:apache:pom:14 from/to central (https://repo1.maven.org/maven2): repo1.maven.org: Name or service not known and 'parent.relativePath' points at wrong local POM # line 22, column 11: Unknown host repo1.maven.org: Name or service not known -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
I tested downloading manually (To see if that was causing the errors), which downloads without issues:
https://repo1.maven.org/maven2/org/apache/apache/14/apache-14.pom
I also tested accessing the URL below, which also shows content:
https://repo1.maven.org/maven2
Hope somebody smart knows how to solve this...
I found out what the issue was:
I had to configure our proxy settings in the SETTINGS.XML in the directory:
/usr/local/share/spark/spark-2.1.0/build/apache-maven-3.3.9/conf
After editing the file, the build went without any issues :)
Hope this helps someone else running into the same issue...
EDIT: Just to be extra clear, having a working proxy configuration in bash only is NOT SUFFICIENT for the Maven Build to succeed. I was able to download all files from bash manually, but Maven needed the proxy configuration in the SETTINGS.XML file present as well...

Linking JSF libraries from JBoss in Maven

I have a very simple web project in Eclipse that uses JSF and runs with a JBoss 4.2.3. I have 'Mavenized' the project and a pom.xml is generated. The pom.xml is empty with no dependencies, but I can install this maven project and I see my web page when I run the JBoss from eclipse. All fine till here.
Now I need to extend the logic of the java code and I need to add a new artifact generated from another project, and here is where my problem starts. When I add a dependency to this new artifact and I try the make a 'install' I am getting this error:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
(default-compile) on project MyTest: Compilation failure: Compilation
failure:
[ERROR]
/home/daniel/workspace/valais/voba-switch/src/ch/steria/scada/sw/web/controller/SwitchController.java:[7,24]
package javax.faces.model does not exist
[ERROR]
/home/daniel/workspace/valais/voba-switch/src/ch/steria/scada/sw/web/controller/SwitchController.java:[45,13]
cannot find symbol
[ERROR] symbol : class SelectItem
I see the libraries missing are in the jboss-web.deployer directory of the JBoss. How can I link this libraries in the pom.xml or how can I get the right ones from the jboss maven repository for my jboss vesion?
Thanks,
Dani.
I just had to set the artifacts from JBoss as 'provided'.

Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: UnresolvedAddressException

I have integrated Maven with Eclipse and trying to create a maven project. Every time i am trying to create project, its POM.xml shows error.
Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
(execution: default-compile, phase: compile)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile
(execution: default-testCompile, phase: test-compile)
- CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its
dependencies could not be resolved: Failed to read artifact
descriptor for
org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2:
ArtifactResolutionException: Failure to transfer
org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from
htt:///repo.maven.apache.org/maven2 was cached in the local
repository, resolution will not be reattempted until the update
interval of central has elapsed or updates are forced. Original error:
Could not transfer artifact
org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from/to
central (htt:///repo.maven.apache.org/maven2): null to htt://
repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom
If I try to run maven-install or any of the maven run option. i get this error
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J:
See htt://www.slf4j.org/codes.html#StaticLoggerBinder for further
details. [INFO] Scanning for projects... [INFO]
[INFO]
------------------------------------------------------------------------ [INFO] Building CQ5 MyApp UI 0.0.1-SNAPSHOT [INFO]
------------------------------------------------------------------------ Downloading:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
[INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 12.289s [INFO] Finished at: Thu Mar 14 14:39:09 IST
2013 [INFO] Final Memory: 1M/15M [INFO]
------------------------------------------------------------------------ [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or
one of its dependencies could not be resolved: Failed to read artifact
descriptor for
org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not
transfer artifact
org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to
central (htt://repo.maven.apache.org/maven2): null to
htt://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom:
UnresolvedAddressException -> [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/PluginResolutionException
What should I do?
If you are working on windows like me, just go to C:\Users\Owner.m2\repository and delete all the files in it. Make sure to keep your eclipse close.
Open eclipse and right click on your project, then click on Maven and then in Update Project. A dialog window appears, make sure to have selected ‘clean projects’ and ‘update project configuration from pom.xml’ options.
That should erase all the errors in the project. :)
You do not really have to delete everything from .m2\repository directory. Just the directories for 'problematic libraries', in your example YOUR_MAVEN_REPO.m2\repository\org\apache\maven\plugins\maven-compiler-plugin and delete 2.3.2 folder.
Then right click on the project in Eclipse and Maven->Update Project. You will probably get a different error and you have to repeat the procedure. Do it 3-4 times and it should be fine...
Thank you all for you help and guidance. I got the error myself. I am in a proxy network and was required to set user id and password in settings.xml file of apache maven.
Sounds like you may need to add the sl4j dependency in your pom file. See here: Failed to load class "org.slf4j.impl.StaticLoggerBinder"
Here is the depenedency from the dependency finder in CQ5.5:
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.log</artifactId>
<version>2.1.3-R1232904</version>
<scope>provided</scope>
</dependency>
Hope that helps and good luck.