I am trying to setup sakai on my local machine, these steps when I reached the steps on Compile Sakai Source Code I was able to run mvn clean install with 'BUILD SUCCESS' output, but when I ran
mvn clean install sakai:deploy -Dmaven.tomcat.home=$CATALINA_HOME -Djava.net.preferIPv4Stack=true -Dmaven.test.skip=true
I got the error:
but when I ran the same command above with flag -X then
I got the error:
I have tried what may be the course of the error by going to https://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException and also tried with the most of the fix suggested there (such as mvn install and mvn org.apache.maven.plugins:maven-compiler-plugin:compile. Sincerely speaking I don't know much about maven I just want sakai to work)
I have also searched youtube to see anything different from the installation guide that I followed, there seem to be only 2 videos for sakai and they followed guide closed to what I followed.
Try
mvn clean install -Dmaven.test.skip=true sakai:deploy -Dmaven.tomcat.home=/path/to/tomcat;
Replace /path/to/tomcat/ with the actual path to tomcat.
This works for me.
Related
I've got no previous experience with java. Trying to run project from github - https://github.com/ESPD/ESPD-Service. The Service uses Maven for building multi-module Maven project. I'm using mvn clean package in order to generate the project.war file. Then type java -Dspring.profiles.active=prod -Xms768m -Xmx768m -jar project.war and the app is running in a Tomcat container with port 8080 and it shows on the cmd console that the app is running perfectly but the problem comes when i try to access the localhost:8080. It says Not Found and I've been looking all over the internet to find a solution but without success. Will appreciate a lot if someone gives me a hand on that one.
Java version should be JDK 1.8,
Maven version must be no greater than 3.5.0
Then add 2 libraries to ESPD-Service\espd-web\target\espd-web\WEB-INF\lib folder: mail-1.4.7.jar and activation-1.1.1.jar cuz they are currently missing.
After that run mvn install in order to install all the jars files and then run the java -Dspring.profiles.active=prod -Xms768m -Xmx768m -jar espd-web.war as it's written on the docs. And also when the app is running on localhost:8080 make sure you add localhost:8080/espd
I have a java program that I wrote. The main things include OpenJDK8, Maven, and JavaFX. The program builds and runs on its own. I want to put it in a Docker container, but I'm having trouble getting it to build.
Here is my Dockerfile:
FROM openjdk:8-jdk
FROM maven:3.3-jdk-8-onbuild
RUN apt-get update && apt-get install -y --no-install-recommends openjfx && rm -rf /var/lib/apt/lists/*
CMD ["java","-jar","target/"CodeDemo-1.0-SNAPSHOT.jar"]
Here is what I ran to build the container:
sudo docker build -t java-maven-code-demo .
Here is the error I keep getting complaining about no javafxpackager:
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
(unpack-dependencies) on project CodeDemo: Command execution failed.
Cannot run program
"/usr/lib/jvm/java-8-openjdk-amd64/jre/../bin/javafxpackager" (in
directory "/usr/src/app"): error=2, No such file or directory -> [Help
1]
I have all the files in a CodeDemo directory. At the top level, I have src, target, Dockerfile, pom.xml. In target, I have the compiled jar.
I'm confused by the error because I thought Java 8 OpenJDK came with JavaFX. So, if I'm pulling OpenJDK, I should be gettng the things I need for JavaFX (similar question on GitHub - solution still gave the error though).
Can anyone point me in the direction of what I could be doing wrong? Is there something else I should be doing to get the proper libraries?
You have multiple FROM lines. Based from your Dockerfile, only the maven base image will be used. Maybe try installing openjdk through another RUN statement before installing openjfx?
I also don't see any COPY statement in your Dockerfile. I initially assumed CodeDemo-1.0-SNAPSHOT.jar exists by default on the maven image but I just tried building the image and it doesn't exist. If that's the jar file from your Java program, don't forget to add it through a COPY statement in your Dockerfile.
I inherited Android Java-code in my company, without Gradle-files etc, and I want to be able to compile this on my dev-server (I program from a ChromeOS machine, hence a CLI SSH connection to a server where I do dev stuff). Now I found some Docker images like this one (which doesn't even have a working command line example) but I haven't managed to create an APK yet. What am I missing and how would you do this?
You have three steps to do:
Migrate your project to gradle.
It isn't too difficult since there are plenty of gradle project out there and you can try to follow them or just read "Migrating to Gradle" article.
Build project with gradle on local machine.
If you migrated properly you can build your project in terminal like:
./gradlew assembleDebug
but it might be also assembleDevDebug or assembleProdRelease which depends on your buildType and flavor in gradle. Check which assembles are available by running:
./gradlew tasks
Build project using Docker.
Based on image you linked:
docker run -t -i ksoichiro/android -v /path/to/project:/workspace -w workspace /bin/sh -c "./gradlew assembleDebug"
I'm configuring a Maven project and want to be able to alias, like
mvn server - to execute mvn clean package tomcat:run
The Grunt task runner does it very well, but I haven't found a way to do the same in Maven. Is it possible?
You can define a <defaultGoal>...</defaultGoal> in your pom if you like. So you can define something like this:
<project>
<build>
<defaultGoal>clean package tomcat:run</defaultGoal>
.
</build>
</project>
will be activated if you simply call mvn...not really an alias, cause usually you don't need one...
Out of the box I don't know of any solution that doesn't imply using a plugin. A simple solution may be adding aliases to your .bashrc file in your home directory (for Linux) or .bash_profile (on OS X) for your desired instructions.
E.g: Adding a line alias my-alias="mvn clean install" will allow you to execute the command my-aliasin the terminal, obtaining the same result as running the mvn clean install instruction itself. Add another line alias my-alias-port="mvn clean install -Dcrx.port=9200"for a second instruction, and so on.
Optionally, you can execute alias to see a list of all your aliases and their respective instructions.
The best solution I have found to this is to use a combination of:
New Maven 3.3 command line config support: project/.mvn/maven.config
GNU Make (which then calls maven)
Bash scripts
Blaze
Roughly in that order of preference.
GNU Make is especially nice because it offers bash completion.
An example Makefile for your specific example would be:
.PHONEY: server
server:
[tab]mvn clean package tomcat:run
Replace [tab] with a real tab! See make documentation.
Then you can run:
make server
For windows environments you will need to install cygwin or something equivalent. For Mac you don't have to but you should probably install homebrew.
Finally the Maven Bash completion albeit doesn't do aliases but will greatly facilitate typing maven commands (press tab). Many package managers have this as a package (ie homebrew has it as maven-completion).
You can also add the following function to your .bashrc file:
function mvn() {
if [ "$1" = "i" ]; then
command mvn install
else
command mvn $#
fi
}
And so you can invoke the mvn install with the mvn i alias.
Everything else that is not mvn i will call the original mvn command instead.
Alias-maven-plugin is what you are looking for.
Following the site:
Whenever you type a command in a shell, for instance
mvn clean install
you could spare time in simply using an alias like this
i
It has also more advantages - you could configure plugin by XML file.
I tried to install jdk-6u23-linux-i586-rpm.binon Linux. I used sh jdk-6u23-linux-i586-rpm.binto run.
But I got following errors.
Is there issue with installer? or is there something I missed?
Run the rpm using -x option to get debug information. That shall help identifying the root cause.
Use sh -x jdk-6u23-linux-i586-rpm.bin to install the rpm and see what all operations does the shell performs.
Finally I figured it out. There was an issue in installation package, I downloaded jdk-6u23-linux-i586-rpm.bin and it works fine.