GithubHelp home page GithubHelp logo

exist-db / exist-apps-archetype Goto Github PK

View Code? Open in Web Editor NEW
8.0 12.0 5.0 207 KB

Maven Archetype for generating an eXist-db App skeleton

License: GNU Lesser General Public License v2.1

Java 72.42% XQuery 25.89% HTML 1.69%
exist-db apps maven maven-archetype

exist-apps-archetype's Introduction

Maven Archetype for eXist Apps

CI

This repository contains the code for a Maven Archetype for eXist Apps.

This archetype can be used to generate a skeleton project for building an eXist-db App (EXPath Package) using Maven.

Usage

  • Requirements: Java 8, Apache Maven 3.3+, Git.

Switch to a directory on your computer where you keep the projects, and then run Maven for this archetype to create a new project directory. e.g.:

$ cd my-projects
$ mvn archetype:generate \
    -DarchetypeGroupId=org.exist-db \
    -DarchetypeArtifactId=exist-apps-archetype \
    -DarchetypeVersion=3.0.1

NOTE: the above will generate a project for eXist-db 6.x.x, if you want a project for eXist-db 5.x.x, then use archetypeVersion=2.1.0, or if you want a project for eXist-db 4.7.1, then use archetypeVersion=1.10.1 instead.

Maven will then prompt you for a groupId, artifactId, version, and package for your project. You need only specify the groupId and artifactId, for the others you may accept the defaults.

  • groupId is similar to a Java package name. If you are going to publish your XAR publicly it should be some sub-coordinate of a domain name that you have responsibility for supplied in reverse order notation. For example, if your company is "My Organisation Ltd" you might own the domain name myorganisation.com, you might decide that a suitable sub-domain for your eXist-db Apps might be app.existdb.myorganisation.com. Note: this sub-domain does not have to be able to be de-referenced.

  • artifactId is just a simple name without spaces for the App itself. Together the groupId:appId must be unique.

  • version almost speaks for itself. In Maven -SNAPSHOT are development versions. Your first version should always be 1.0.0-SNAPSHOT, with the first release subsequently being 1.0.0.

e.g.:

Define value for property 'groupId': : com.myorganisation.existdb.app
Define value for property 'artifactId': : my-app1
Define value for property 'version':  1.0.0-SNAPSHOT: : 
Define value for property 'package':  com.myorganisation.existdb.app: : 
Confirm properties configuration:
groupId: com.myorganisation.existdb.app
artifactId: my-app1
version: 1.0-SNAPSHOT
package: com.myorganisation.existdb.app
 Y: : y

You will then have a new directory named after the artifactId of your project, e.g.: my-app1.

NOTE: The project is setup to expect to be under Git version control. If you are not already in a Git repository, you should create one:

$ cd my-app1
$ git init
$ git add pom.xml src/ xar-assembly.xml xquery-license-style.xml LICENSE README.md
$ git commit -m "Start of my eXist-db App"

You should now consult the README.md of your my-app1 for further instructions and documentation.

exist-apps-archetype's People

Contributors

adamretter avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar dizzzz avatar duncdrum avatar reinhapa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

exist-apps-archetype's Issues

Generated project does not build

as shown below: (v1.10.0)

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running PackageId.ExampleModuleTest
ERROR StatusLogger No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2
Using temporary storage location: /var/folders/sv/f7jcvp391bj_2c0tr0bg_rww0000gn/T/org.exist.test.ExistEmbeddedServer562033662467720568
Jun 19, 2019 10:18:30 PM org.expath.pkg.repo.tools.Logger info
INFO: Create a new repository with storage: File system storage in /var/folders/sv/f7jcvp391bj_2c0tr0bg_rww0000gn/T/org.exist.test.ExistEmbeddedServer562033662467720568/expathrepo
22:18:30.478 [main] ERROR org.exist.plugin.PluginsManagerImpl - java.lang.ClassNotFoundException: org.exist.scheduler.SchedulerManager
22:18:30.482 [main] ERROR org.exist.plugin.PluginsManagerImpl - java.lang.ClassNotFoundException: org.exist.storage.md.MDStorageManager
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 1.947 sec <<< FAILURE!
sayHello(PackageId.ExampleModuleTest)  Time elapsed: 0.112 sec  <<< ERROR!
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: org/exist/http/servlets/RequestWrapper
	at org.exist.xquery.XQueryContext.getUserFromHttpSession(XQueryContext.java:1831)
	at org.exist.xquery.XQueryContext.prepareForExecution(XQueryContext.java:599)
	at org.exist.xquery.XQuery.execute(XQuery.java:220)
	at org.exist.xquery.XQuery.execute(XQuery.java:185)
	at org.exist.xquery.XQuery.execute(XQuery.java:180)
	at org.exist.xquery.XQuery.execute(XQuery.java:292)
	at PackageId.ExampleModuleTest.executeQuery(ExampleModuleTest.java:110)
	at PackageId.ExampleModuleTest.sayHello(ExampleModuleTest.java:57)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.NoClassDefFoundError: org/exist/http/servlets/RequestWrapper
	... 39 more
Caused by: java.lang.ClassNotFoundException: org.exist.http.servlets.RequestWrapper
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 39 more

sayHello_noName(PackageId.ExampleModuleTest)  Time elapsed: 0.002 sec  <<< ERROR!
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: 
	at org.exist.xquery.XQueryContext.getUserFromHttpSession(XQueryContext.java:1831)
	at org.exist.xquery.XQueryContext.prepareForExecution(XQueryContext.java:599)
	at org.exist.xquery.XQuery.execute(XQuery.java:220)
	at org.exist.xquery.XQuery.execute(XQuery.java:185)
	at org.exist.xquery.XQuery.execute(XQuery.java:180)
	at org.exist.xquery.XQuery.execute(XQuery.java:292)
	at PackageId.ExampleModuleTest.executeQuery(ExampleModuleTest.java:110)
	at PackageId.ExampleModuleTest.sayHello_noName(ExampleModuleTest.java:77)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.NoClassDefFoundError: 
	... 39 more

helloWorld(PackageId.ExampleModuleTest)  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: 
	at org.exist.xquery.XQueryContext.getUserFromHttpSession(XQueryContext.java:1831)
	at org.exist.xquery.XQueryContext.prepareForExecution(XQueryContext.java:599)
	at org.exist.xquery.XQuery.execute(XQuery.java:220)
	at org.exist.xquery.XQuery.execute(XQuery.java:185)
	at org.exist.xquery.XQuery.execute(XQuery.java:180)
	at org.exist.xquery.XQuery.execute(XQuery.java:292)
	at PackageId.ExampleModuleTest.executeQuery(ExampleModuleTest.java:110)
	at PackageId.ExampleModuleTest.helloWorld(ExampleModuleTest.java:37)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.NoClassDefFoundError: 
	... 39 more

add(PackageId.ExampleModuleTest)  Time elapsed: 0.003 sec  <<< ERROR!
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: 
	at org.exist.xquery.XQueryContext.getUserFromHttpSession(XQueryContext.java:1831)
	at org.exist.xquery.XQueryContext.prepareForExecution(XQueryContext.java:599)
	at org.exist.xquery.XQuery.execute(XQuery.java:220)
	at org.exist.xquery.XQuery.execute(XQuery.java:185)
	at org.exist.xquery.XQuery.execute(XQuery.java:180)
	at org.exist.xquery.XQuery.execute(XQuery.java:292)
	at PackageId.ExampleModuleTest.executeQuery(ExampleModuleTest.java:110)
	at PackageId.ExampleModuleTest.add(ExampleModuleTest.java:97)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.NoClassDefFoundError: 
	... 39 more


Results :

Tests in error: 
  sayHello(PackageId.ExampleModuleTest): java.lang.NoClassDefFoundError: org/exist/http/servlets/RequestWrapper
  sayHello_noName(PackageId.ExampleModuleTest): java.lang.NoClassDefFoundError: 
  helloWorld(PackageId.ExampleModuleTest): java.lang.NoClassDefFoundError: 
  add(PackageId.ExampleModuleTest): java.lang.NoClassDefFoundError: 

Tests run: 4, Failures: 0, Errors: 4, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  11.495 s
[INFO] Finished at: 2019-06-19T22:18:31+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project artifaceId: There are test failures.
[ERROR] 
[ERROR] Please refer to /Users/wessels/Development/github/tmp/artifaceId/target/surefire-reports for the individual test results.
[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

First impressions

  • the four prompt values groupId, artifactId, version, package are somewhat at odds with the naming conventions of eXist's repo.xml, expath-pkg.xml values. Make it easier for folks to understand what is what in the new maven hotness by adding some prose to readme.md or by changing the name of the prompts:
archetype groupId artifactId version package
repo website (description) version website
expath-pkg package@name package@abbrev package@version package@name
  • once installed the index.html of the example app isn't reachable from either the package-manager or dashboard. This is at odds with apps generated by eXide, or tei-publisher. Something isn't quite right with the generated controller.xql (actually i think this is because of the differences between repo and expath-pkg with respect to the app title, s.a.)
  • the app uses the default documentation icon.png instead of the default app icon, let's use either the default of give it its own?
  • change collection name from content to modules as the conventional place to store xquery modules
  • explain: cxan.xml,
  • explain: exist.xml, components.xml since they are specific to archetype generated apps and not part of the standard apps template
  • let's generate a preconfigured .gitignore that excludes /target since the archetype needs git anyways
  • eXide apps only know alpha, beta, stable as status let's either add SNAPSHOT to eXide, or switch the name in the archetype?
  • the apps are missing an author (which should also appear in the LICENSE file)

OOTB compilation error

Follow readme.md instructions to create a .xar file results in following compilation error.

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/halalpha/Desktop/mvn-test/mvn-test/src/main/java/duncdrum/eu/mvn-test/ExampleModule.java:[1,24] ';'
 expected
[ERROR] /Users/halalpha/Desktop/mvn-test/mvn-test/src/main/java/duncdrum/eu/mvn-test/ExampleFunctions.java:[1,24]
';' expected
[ERROR] /Users/halalpha/Desktop/mvn-test/mvn-test/src/main/java/duncdrum/eu/mvn-test/ExampleFunctions.java:[18,30]
 ';' expected
[INFO] 3 errors
[INFO] -------------------------------------------------------------

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.233 s
[INFO] Finished at: 2018-01-03T11:36:56+01:00
[INFO] Final Memory: 19M/330M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on p
roject mvn-test: Compilation failure: Compilation failure:
[ERROR] /Users/halalpha/Desktop/mvn-test/mvn-test/src/main/java/duncdrum/eu/mvn-test/ExampleModule.java:[1,24] ';'
 expected
[ERROR] /Users/halalpha/Desktop/mvn-test/mvn-test/src/main/java/duncdrum/eu/mvn-test/ExampleFunctions.java:[1,24]
';' expected
[ERROR] /Users/halalpha/Desktop/mvn-test/mvn-test/src/main/java/duncdrum/eu/mvn-test/ExampleFunctions.java:[18,30]
 ';' expected
[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

Question: Multiple java modules in exist.xml

In one of my extension modules I have two Java modules defined in one XAR file

(link)

<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://exist-db.org/ns/expath-pkg">
    <jar>exist-mongrel-@[email protected]</jar>
    <jar>mongodb-driver-3.4.2.jar</jar>
    <jar>mongodb-driver-core-3.4.2.jar</jar>
    <jar>bson-3.4.2.jar</jar>
    <java>
        <namespace>http://expath.org/ns/mongo</namespace>
        <class>org.exist.mongodb.xquery.MongodbModule</class>
    </java>
    <java>
        <namespace>http://expath.org/ns/mongo/gridfs</namespace>
        <class>org.exist.mongodb.xquery.GridfsModule</class>
    </java>
</package>

how can I do the same with this archetype?

Question: additional entries repo.xml

In my XARs I set a few additional elements:

  • <note> to set some remarks during install of XAR file
  • <changelog> .... te state about the most recent changes
  • <permission> ... to create a user/group for the extension

how can these be added in the archetype?

Allow run XQSuite tests

We should be able to code and test XQSuite tests in custom apps developed from the archetype

how to use my own archetype

I m looking into adding some frontend related features to the archetype, and i m stuck on something really silly. How do I generate an app with my development fork of the archetype instead of the official client?

I think this info would make a good addition to the readme.

Fix archetype for use in Eclipse / m2e

Is your feature request related to a problem? Please describe.
When using the eXist apps archetype in Eclipse (2021-12) with M2E, the project gives an error: "Plugin execution not covered by lifecycle configuration: com.code54.mojo:buildversion-plugin:1.0.3:set-properties (execution: default, phase: validate)."
This is a known problem in Eclipse with M2E, and it will not be fixed.

Describe the solution you'd like
The problem in Eclipse / M2E can be circumvented by including the following fragment, just before </build>.

        <pluginManagement>
          <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
            <!-- https://stackoverflow.com/a/14809920/1021892 -->
            <plugin>
              <groupId>org.eclipse.m2e</groupId>
              <artifactId>lifecycle-mapping</artifactId>
              <version>1.0.0</version>
              <configuration>
                <lifecycleMappingMetadata>
                  <pluginExecutions>
                    <pluginExecution>
                      <pluginExecutionFilter>
                        <groupId>com.code54.mojo</groupId>
                        <artifactId>buildversion-plugin</artifactId>
                        <versionRange>[1.0.3,)</versionRange>
                        <goals>
                          <goal>set-properties</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>
                        <execute>
                         <runOnIncremental>false</runOnIncremental>
                       </execute >
                      </action>
                    </pluginExecution>
                  </pluginExecutions>
                </lifecycleMappingMetadata>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>

Describe alternatives you've considered
It is possible to specify that the set-properties goal is ignored, but I thought that might cause other problems.
I know I should consider using a better IDE, but I am used to Eclipse...

kuberam-expath-plugin requires different approach support multiple Java modules

Recently the kuberam-expath-plugin has changed to support multiple Java modules in one XAR file. The current archetype code does not support it (yet).

see claudius108/kuberam-expath-plugin#7 (comment)

The xar-assembly.xml looks as following to support the multi-java-module :

    <components>
        <resource>
            <public-uri>https://my-organisation.com/exist-db/ns/app/my-java-module</public-uri>
            <file>com.my.ExampleModule</file>
        </resource>
<resource>
            <public-uri>https://my-organisation.com/exist-db/ns/app/my-java-module-2</public-uri>
            <file>com.my.ExampleModuleToo</file>
        </resource>
    </components>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.