I'm trying to deploy my Discord bot using Heroku but everytime I deploy it, it gives me an error. The code works on local using IntelliJ Idea. Can anyone help me correct this error please?
Build log:
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 21 source files to /tmp/build_8fdb6208/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.237 s
[INFO] Finished at: 2021-03-21T23:52:06Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project CalciteDiscordBot: Fatal error compiling: invalid target release: 15 -> [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/MojoExecutionException
! ERROR: Failed to build app with Maven
We're sorry this build is failing! If you can't find the issue in application code,
please submit a ticket so we can help: https://help.heroku.com/
! Push rejected, failed to compile Java app.
! Push failed
Here's my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>CalciteDiscordBot</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.target>15</maven.compiler.target>
<maven.compiler.source>15</maven.compiler.source>
</properties>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>4.2.0_168</version>
</dependency>
<repository>
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>https://jcenter.bintray.com</url>
</repository>
</project>
Someone just helped me with this issue yesterday your Maven POM specifies that you want Java 15, but the Java version installed cannot handle compilation for 15. So, add a system.properties file to your application root with the following contents and build again:
java.runtime.version=15
You application requires Java 15 (<maven.compiler.source>15</maven.compiler.source>) so you need tell Heroku you want that specific Java version (instead of the default one)
In the root folder place a file system.properties:
java.runtime.version=15
Related
I want to make a release with the maven release plugin in two steps:
1. mvn clean release:prepare
2. mvn release:perform
It worked fine the last two releases, but after changing my IDE from intellij to eclipse I am not able to perform a release this way with apache-maven 3.5.3 and eGit 4.9.2.
The general structure of my project is:
parent-dir
-> pom.xml
-> child1-dir
-> pom.xml
-> child2-dir
-> pom.xml
child1 and child2 contain code and packaging to jar, the parent has packaging goal pom.
Configuration of maven-release-plugin in parent pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-invoker</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
</plugin>
The plugin updates all poms with correct version #, committs changes and pushes to the remote repository for both child modules. But for the parent module I get the following error at the end of the log:
[INFO] Reactor Summary:
[INFO]
[INFO] test Parent 0.12-SNAPSHOT ........................ FAILURE [02:46 min]
[INFO] test Child1 ...................................... SUCCESS [ 0.011 s]
[INFO] test Child2 0.12-SNAPSHOT ........................ SUCCESS [ 0.205 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:48 min
[INFO] Finished at: 2018-09-08T12:56:06+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.1:prepare (default-cli) on project test-parent: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] git#github.com: Permission denied (publickey).
[ERROR] fatal: Could not read from remote repository.
[ERROR]
[ERROR] Please make sure you have the correct access rights
[ERROR] and the repository exists.
[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 do not understand why I get this error message after succesfull commiting and pushing the children modules?
You need to add your public key in Github.
For help please refer https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
i have a x-module with those properties:
module-name: x-datamodel
this is a part of the pom.xml
<groupId>com.x.datamodel</groupId>
<artifactId>x</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
i have install the project in a local repository with this command line:
mvn install:install-file -Dfile=/Users/me/Documents/Projects/x-datamodel/target/classes/x-datamodel.jar -DgroupId=com.x.datamodel -DgeneratePom=true -DlocalRepositoryPath=/Users/me/Documents/Projects/me-repository -DcreateChecksum=true -DartifactId=x -Dversion={1.0} -Dpackaging=jar
and added the project in bitbucket.
I try to integrate the module x in another project y.
here a part of the y's pom.xml
<dependency>
<groupId>com.x.datamodel</groupId>
<artifactId>x</artifactId>
<version>${x.version}</version>
</dependency>
<repositories>
<repository>
<id>me-repository</id>
<url>https://bitbucket.org/me/me-repository/src/master</url>
</repository>
</repositories>
i can import some classes of the module x in the project y, but when i build the y project i get this error:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error reading /Users/me/.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar; error in opening zip file
[ERROR] error reading /Users/me/.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar; error in opening zip file
[ERROR] /Users/me/Documents/Projects/y/src/main/java/com/y/server/serviceImpl/UserServiceImpl.java:[3,32] package com.x.datamodel.model does not exist
[ERROR] /Users/me/Documents/Projects/y/src/main/java/com/y/server/serviceImpl/UserServiceImpl.java:[18,12] cannot find symbol
symbol: class User
location: class com.y.server.serviceImpl.UserServiceImpl
[ERROR] /Users/me/Documents/Projects/y/src/main/java/com/y/server/security/CustomUserDetailsService.java:[3,32] package com.x.datamodel.model does not exist
[INFO] 16 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:56 min
[INFO] Finished at: 2016-12-28T15:51:05+01:00
[INFO] Final Memory: 29M/209M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project y: Compilation failure: Compilation failure:
[ERROR] error reading /Users/me/.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar; error in opening zip file
[ERROR] error reading /Users/me/.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar; error in opening zip file
[ERROR] /Users/me/Documents/Projects/y/src/main/java/com/y/server/serviceImpl/UserServiceImpl.java:[3,32] package com.x.datamodel.model does not exist
[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
after installing the repository i have the library into this path:
.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar
why not:
.m2/repository/com/x-datamodel/x/1.0/x-1.0.jar
I tend to think the file is corrupted. Try deleting it and downloading it again.
Try removing the below lines
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
With :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
I've been receiving an error while trying to release a new version of software to Sonatype. I've successfully completed mvn release:prepare but when I do mvn release:perform I get the following error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:52.660s
[INFO] Finished at: Fri Feb 14 22:32:52 EST 2014
[INFO] Final Memory: 28M/263M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project flexjson: Failed to deploy artifacts: Could not transfer artifact net.sf.flexjson:flexjson:jar:3.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/net/sf/flexjson/flexjson/3.2/flexjson-3.2.jar. Return code is: 401, ReasonPhrase: Unauthorized. -> [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/MojoExecutionException
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:00.122s
[INFO] Finished at: Fri Feb 14 22:32:52 EST 2014
[INFO] Final Memory: 14M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:perform (default-cli) on project flexjson: Maven execution failed, exit code: '1' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:perform (default-cli) on project flexjson: Maven execution failed, exit code: '1'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
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.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Maven execution failed, exit code: '1'
at org.apache.maven.plugins.release.PerformReleaseMojo.execute(PerformReleaseMojo.java:135)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.apache.maven.shared.release.ReleaseExecutionException: Maven execution failed, exit code: '1'
at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:90)
at org.apache.maven.shared.release.phase.RunPerformGoalsPhase.execute(RunPerformGoalsPhase.java:67)
at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:343)
at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:289)
at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:269)
at org.apache.maven.plugins.release.PerformReleaseMojo.execute(PerformReleaseMojo.java:131)
... 21 more
Caused by: org.apache.maven.shared.release.exec.MavenExecutorException: Maven execution failed, exit code: '1'
at org.apache.maven.shared.release.exec.ForkedMavenExecutor.executeGoals(ForkedMavenExecutor.java:122)
at org.apache.maven.shared.release.exec.AbstractMavenExecutor.executeGoals(AbstractMavenExecutor.java:47)
at org.apache.maven.shared.release.exec.ForkedMavenExecutor.executeGoals(ForkedMavenExecutor.java:144)
at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:82)
... 26 more
I found blog post about the error, but I don't see anything that matches my setup.
http://blog.sonatype.com/2010/11/what-to-do-when-nexus-returns-401/#.Uv7EYEKwJUI
The post refers to the settings file not matching what's configured in the pom. But I don't have anything in the pom about deployment. I don't have a plugin configured so it must've been using the default plugin configuration for doing releases. As I understand it that's the maven release plugin.
This setup has worked in the past, but I'm doing this from another machine. I had to generate a new gpg private key following this post:
http://blog.sonatype.com/2010/01/how-to-generate-pgp-signatures-with-maven/#.Uv2JUkKwJUI
This setup has worked before, but I've moved to the new machine. I made sure to copy the .m2/settings.xml file to my ~/.m2/settings.xml. Of course that private key is different than the one I had on my old machine. But I can't figure out why that matters or if that matters. From what I've read it's just for code signing. Not sure how that authorizes code signings.
So what am I missing? Why does this 401 error keep happening?
Follow the advice in the first link. 401 means a failure to authenticate against the server. You state that you have nothing configured in your POM to support deployment. If this has previously worked, that cannot be correct. Is there a distribution management section in your POM?
<distributionManagement>
<repository>
<id>nexus-release</id>
<name>My Nexus release area</name>
<url>https://????????</url>
</repository>
</distributionManagement>
The id section must match the id of the "servers" section in your Maven settings file.
<server>
<id>nexus-release</id>
<username>mark</username>
<password>mycleartextpasswordconsiderusingmavenbuiltinencryption</password>
</server>
This is the "gotcha" and illustrates how Maven links the target repo with the user authentication credentials.
Finally to make your my build uses the correct settings file I always pass it as a parameter to by build:
mvn -s ~/.m2/settings.xml ....
This approach also enables different settings files for different projects.
Note
The second link is unrelated. It deals with signing the artifact you
are publishing (so that others will trust it came from you).
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project flexjson: Failed to deploy artifacts: Could not transfer artifact net.sf.flexjson:flexjson:jar:3.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/net/sf/flexjson/flexjson/3.2/flexjson-3.2.jar. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
regenerate your maven master password and encrypt your password for your nexus repository and configure it in your ~/.m2 settings.xml
Similar to OP, I do not have a distributionManagement section in my pom.xml so I got this error without knowing what to put in the Maven settings file.
The error message above shows the default repository name sonatype-nexus-staging used in the maven release plugin. This is what needs to match the login/password (encrypted or not) in settings.xml.
Keep all your settings file in both %M2_HOME/conf as well as in ~/.m2/ folder.
Then you will not get this error message.
Because I want to use ActiveAndroid and ActiveAndroid-Validation I need to use Maven (which I never heard of until yesterday). So I installed maven and then tried to install ActiveAndroid.
I wrote a custom serializer in ActiveAndroid using JodaTime and included a JodaTime jar in the ActiveAndroid libs folder. When I build the project using ant it works perfectly well. Using Maven I first downloaded and installed JodaTime in Maven using mvn clean install from within the JodaTime source folder. Seeing the following lines this was successful:
[INFO] --- maven-install-plugin:2.4:install (default-install) # joda-time ---
[INFO] Installing /Users/kramer65/Downloads/joda-time-2.3/target/joda-time-2.3.jar to /Users/kramer65/.m2/repository/joda-time/joda-time/2.3/joda-time-2.3.jar
[INFO] Installing /Users/kramer65/Downloads/joda-time-2.3/pom.xml to /Users/kramer65/.m2/repository/joda-time/joda-time/2.3/joda-time-2.3.pom
[INFO] Installing /Users/kramer65/Downloads/joda-time-2.3/target/joda-time-2.3-javadoc.jar to /Users/kramer65/.m2/repository/joda-time/joda-time/2.3/joda-time-2.3-javadoc.jar
[INFO] Installing /Users/kramer65/Downloads/joda-time-2.3/target/joda-time-2.3-sources.jar to /Users/kramer65/.m2/repository/joda-time/joda-time/2.3/joda-time-2.3-sources.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 47.603s
[INFO] Finished at: Thu Sep 26 13:00:54 CEST 2013
[INFO] Final Memory: 12M/81M
[INFO] ------------------------------------------------------------------------
I then tried to install ActiveAndroid using the same mvn clean install from within the ActiveAndroid source folder. This however, resulted in the following errors:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.095s
[INFO] Finished at: Thu Sep 26 13:01:08 CEST 2013
[INFO] Final Memory: 13M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project activeandroid: Compilation failure: Compilation failure:
[ERROR] /Users/kramer65/dev/repos/ActiveAndroid/src/com/activeandroid/serializer/JodaDateTimeSerializer.java:[3,21] package org.joda.time does not exist
[ERROR] /Users/kramer65/dev/repos/ActiveAndroid/src/com/activeandroid/serializer/JodaDateTimeSerializer.java:[22,16] cannot find symbol
[ERROR] symbol : class DateTime
[ERROR] location: class com.activeandroid.serializer.JodaDateTimeSerializer
[ERROR] /Users/kramer65/dev/repos/ActiveAndroid/src/com/activeandroid/serializer/JodaDateTimeSerializer.java:[7,24] cannot find symbol
[ERROR] symbol : class DateTime
[ERROR] location: class com.activeandroid.serializer.JodaDateTimeSerializer
[ERROR] /Users/kramer65/dev/repos/ActiveAndroid/src/com/activeandroid/serializer/JodaDateTimeSerializer.java:[19,26] cannot find symbol
[ERROR] symbol : class DateTime
[ERROR] location: class com.activeandroid.serializer.JodaDateTimeSerializer
[ERROR] /Users/kramer65/dev/repos/ActiveAndroid/src/com/activeandroid/serializer/JodaDateTimeSerializer.java:[27,28] cannot find symbol
[ERROR] symbol : class DateTime
[ERROR] location: class com.activeandroid.serializer.JodaDateTimeSerializer
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :activeandroid
Does anybody know how I can solve this? All tips are welcome!
==EDIT==
The pom.xml of ActiveAndroid can be found here. I did not change anything in it.
If your IDE does not complain, it means your IDE could build the project.
Then I assume your IDE does not rely on maven to build. I would recommand a stronger integration between maven and your IE.
You are not supposed to manually add the libs to your classpath (in IDE)
Your POM miss the dependency
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.3</version>
</dependency>
As you have the android-maven-plugin in your build, you need to supply path to the SDK. For this maven plugin, this is done by adding it as property (android.sdk.path) in the properties section of the POM.
So you'll have something like this:
<properties>
<android.sdk.path>your/path/here</android.sdk.path>
</properties>
For quick solution, you can just add this to the POM's properties section. However, local settings like this usually go to settings.xml file in the conf dir inside your maven installation. This will make this property always present no matter what pom you use. Or, if you skip the activeProfiles part, you'll have to invoke maven with that profile enabled - "mvn -pandroidProfile clean install".
<profiles>
<profile>
<id>androidProfile</id>
<properties>
<android.sdk.path>your/path/here</android.sdk.path>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>androidProfile</activeProfile>
</activeProfiles>
I am trying to develop a template-set module for a Jahia site.
I used the step-by-step procedure described in the official documentation available here : http://www.jahia.com/cms/home/download/jahia-academy/documentation.default.html?displayTab=technical-documentation "Templating and Integration Guide".
Basically, it implies to use an maven archetype to initialize, build and deploy your project on the server. The two first steps are correctly done. It generates the module's skeleton and mandatory files. Then, I can build it to create a .war file.
mvn archetype:generate -DarchetypeCatalog=http://maven.jahia.org/maven2
>> [INFO] PROJECT GENERATED
mvn clean install
>> [INFO] BUILD SUCCESS
But an error occurs during the deployment.
mvn jahia:deploy
>> [INFO] BUILD FAILURE
>> [ERROR] Failed to execute goal org.jahia.server:maven-jahia-plugin:2.81:deploy (default-cli) on project test-template-set:
>> Error while validating deployers:Factory not initialized properly,
>> you must set the targetServerDirectory variable before calling getInstance ! -> [Help 1]
>> [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The provided link gives me a self explanatory conclusion :
Unlike many other errors, this exception is not generated by the Maven
core itself but by a plugin. The concrete meaning of the exception
depends on the plugin so please have a look at its documentation.
So after using a standard procedure described in the Jahia Documentation, the only piece of advice I could find is to have a closer look at it. Welcome to the catch-22 side of life.
I am using Jahia6.6.1.0 community distribution. I found no further clues in the Jahia fora.
I would like to know which step did I miss. Is this a common maven error ? Or is it just a Jahia mandatory file missing ?
A clue to find a "helloworld working module" would be great as well.
Here is the complete trace of the error :
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Test Cooptation template set 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-jahia-plugin:2.81:deploy (default-cli) # test-template-set ---
[INFO] Jahia project structure version is 2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.456s
[INFO] Finished at: Thu Apr 25 14:39:19 CEST 2013
[INFO] Final Memory: 12M/220M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jahia.server:maven-jahia-plugin:2.81:deploy (default-cli) on project test-template-set: Error while validating deployers:
Factory not initialized properly, you must set the targetServerDirectory variabl
e before calling getInstance ! -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jahia.server:maven-jahia-plugin:2.81:deploy (default-cli) on project test-template-set: Error while validating deployers
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
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.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error while validating deployers
at org.jahia.utils.maven.plugin.DeployMojo.doValidate(DeployMojo.java:129)
at org.jahia.utils.maven.plugin.AbstractManagementMojo.execute(AbstractManagementMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.RuntimeException: Factory not initialized properly, you must set the targetServerDirectory variable before calling getInstance !
at org.jahia.configuration.deployers.ServerDeploymentFactory.getInstance(ServerDeploymentFactory.java:74)
at org.jahia.utils.maven.plugin.DeployMojo.doValidate(DeployMojo.java:127)
... 22 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/MojoExecutionException
The Prerequisites - by Jahia mentions that we should at least adjust the target path to our Apache Tomcat application server and, in case you will build Jahia from sources code and deploy it, the DB connection settings.
The minimal settings.xml file for deploying Jahia on a Tomcat and using MySQL DBMS is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>C:/development/m2repository</localRepository>
<servers>
<server>
<id>jahiaRepository</id>
<username>maven</username>
<privateKey>C:/putty/maven.jahia.org.private</privateKey>
</server>
</servers>
<profiles>
<profile>
<id>jahia-mysql</id>
<properties>
<jahia.configure.databaseType>mysql</jahia.configure.databaseType>
<jahia.configure.databaseUrl>jdbc:mysql://localhost/jahia?useUnicode=true&characterEncoding=UTF-8&useServerPrepStmts=false</jahia.configure.databaseUrl>
<jahia.configure.databaseUsername>root</jahia.configure.databaseUsername>
<jahia.configure.databasePassword>password</jahia.configure.databasePassword>
</properties>
</profile>
<profile>
<id>jahia-tomcat</id>
<properties>
<jahia.deploy.targetServerType>tomcat</jahia.deploy.targetServerType>
<jahia.deploy.targetServerDirectory>C:/development/apache-tomcat-6.0.32</jahia.deploy.targetServerDirectory>
<jahia.deploy.targetServerVersion>6</jahia.deploy.targetServerVersion>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>jahia-mysql</activeProfile>
<activeProfile>jahia-tomcat</activeProfile>
</activeProfiles>
<pluginGroups>
<pluginGroup>org.jahia.server</pluginGroup>
</pluginGroups>
</settings>
I hope this may help.