I have just downloaded from spring.io a project with the only "web" dependency. Here's the 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>microservices.book</groupId>
<artifactId>social-multiplication</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>social-multiplication</name>
<description>Social Multiplication App</description>
<properties>
<java.version>18</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
When from the terminal I give:
mvn spring-boot:run
I get:
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< microservices.book:social-multiplication >--------------
[INFO] Building social-multiplication 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.7.3:run (default-cli) > test-compile # social-multiplication >>>
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # social-multiplication ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) # social-multiplication ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Users\Massimo\Desktop\Programming\social-multiplication\social-multiplication\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.084 s
[INFO] Finished at: 2022-09-11T23:25:39+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project social-multip
lication: Fatal error compiling: invalid target release: 18 -> [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
I've looked both at this and this SO question but that's not my case.
> echo %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_161
> echo %JAVA_jdk%
C:\Program Files\Java\jdk1.8.0_161
and I'm trying to build a java 18 application.
So what's the problem? Also I would like to know something about the maven specified in the pom. It's not the "standard" maven that I call from the terminal right?
What artifat is it downloading?
I'm on windows 10, Intellij Idea 2020.2, and my maven version is:
> mvn --version
Maven home: C:\Program Files\apache-maven-3.8.6-bin\apache-maven-3.8.6
Java version: 1.8.0_161, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_161\jre
Default locale: it_IT, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windws"
Related
I have a non-modular javafx project and want to run it with maven but i have no experience in it.
I'm using IntelliJ IDEA so I went to root directory, right click -> Add Framework Support, and choose maven. a pom.xml file was added.
After referring https://openjfx.io/openjfx-docs/#maven I modified The pom.xml file to look like this:
<?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.openjfx</groupId>
<artifactId>AccountZeyny</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>AccountZeyny</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
<javafx.version>15</javafx.version>
<javafx.maven.plugin.version>0.0.6</javafx.maven.plugin.version>
</properties>
<organization>
<!-- Used as the 'Vendor' for JNLP generation -->
<name>ORGZ</name>
</organization>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>15</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>15</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>${maven.compiler.release}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.6</version>
<configuration>
<release>${maven.compiler.release}</release>
<mainClass>org.openjfx.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
I went to Maven tab -> Plugins -> compiler -> compiler:compile. and then Plugins -> javafx -> javafx:run. and I got this in the run tab down below:
D:\openjdk-15.0.1_windows-x64_bin\jdk-15.0.1\bin\java.exe -Dmaven.multiModuleProjectDirectory=D:\Account-Zeyny "-Dmaven.home=D:\IntelliJ IDEA Community Edition 2021.1.3\plugins\maven\lib\maven3" "-Dclassworlds.conf=D:\IntelliJ IDEA Community Edition 2021.1.3\plugins\maven\lib\maven3\bin\m2.conf" "-Dmaven.ext.class.path=D:\IntelliJ IDEA Community Edition 2021.1.3\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\IntelliJ IDEA Community Edition 2021.1.3\lib\idea_rt.jar=64148:D:\IntelliJ IDEA Community Edition 2021.1.3\bin" -Dfile.encoding=UTF-8 -classpath "D:\IntelliJ IDEA Community Edition 2021.1.3\plugins\maven\lib\maven3\boot\plexus-classworlds-2.6.0.jar;D:\IntelliJ IDEA Community Edition 2021.1.3\plugins\maven\lib\maven3\boot\plexus-classworlds.license" org.codehaus.classworlds.Launcher -Didea.version=2021.1.3 org.openjfx:javafx-maven-plugin:0.0.6:run
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< org.openjfx:AccountZeyny >----------------------
[INFO] Building AccountZeyny 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> javafx-maven-plugin:0.0.6:run (default-cli) > process-classes # AccountZeyny >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # AccountZeyny ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Account-Zeyny\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # AccountZeyny ---
[INFO] No sources to compile
[INFO]
[INFO] <<< javafx-maven-plugin:0.0.6:run (default-cli) < process-classes # AccountZeyny <<<
[INFO]
[INFO]
[INFO] --- javafx-maven-plugin:0.0.6:run (default-cli) # AccountZeyny ---
[INFO] Toolchain in javafx-maven-plugin null
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.189 s
[INFO] Finished at: 2021-07-15T18:02:32+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.6:run (default-cli) on project AccountZeyny: Error: Error: Output directory is empty -> [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
Process finished with exit code 1
Did I make mistake in these steps?
EDIT: I'm using IntelliJ IDEA 2021.1.3 x64.
I would like to be able to run spring-boot:build-image and have it pull the paketobuildpack from our local Artifactory server instead of docker.io. I want the plugin to use the docker config file for my credentials and not hard code them in the pom file.
This works:
<docker>
<builderRegistry>
<username>username</username>
<password>password</password>
<url>https://artifactory.mycompany.com/v2/</url>
</builderRegistry>
</docker>
When I run mvn spring-boot:build-image, without the docker block above, I get the following error:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.2:build-image (default-cli) on project demo: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.4.2:build-image failed: Docker API call to 'localhost/v1.24/images/create?fromImage=artifactory.mycompany.com%2Fcommon-docker-virtual%2Fpaketobuildpacks%2Fbuilder%3Abase'
failed with status code 500 "Internal Server Error" and message "Head https://artifactory.mycompany.com/v2/common-docker-virtual/paketobuildpacks/builder/manifests/base:
unknown: Authentication is required" -> [Help 1]
My .docker/config.json has the following configuration:
{
"auths": {
"artifactory.mycompany.com": {
"auth": "**token**",
"email": "myemail#mycompany.com"
}
},
"credStore": "desktop",
"credsStore": "desktop"
}
I can successfully run docker build that uses our Artifactory successfully for other unrelated images.
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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.penske.architecture</groupId>
<artifactId>myapp</artifactId>
<version>1.0.0.RELEASE</version>
<name>myapp</name>
<properties>
<maven.compiler.target>14</maven.compiler.target>
<maven.compiler.source>14</maven.compiler.source>
<java.version>14</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-ldap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layers>
<enabled>true</enabled>
</layers>
<image>
<name>artifactory.mycompany.com/common-docker-virtual/library/${project.artifactId}</name>
<builder>artifactory.mycompany.com/common-docker-virtual/paketobuildpacks/builder:base</builder>
<env>
<BP_JVM_VERSION>14</BP_JVM_VERSION>
</env>
</image>
</configuration>
<executions>
<execution>
<goals>
<goal>build-image</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
The full maven output
[INFO] Scanning for projects...
[INFO]
[INFO] ----------< my.group:myapp >-----------
[INFO] Building myapp 1.0.0.RELEASE
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.4.2:build-image (default-cli) > package # myapp >>>
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # myapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 3 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # myapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # myapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory C:\myapp\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # myapp ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # myapp ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) # myapp ---
[INFO] Building jar: C:\myapp\target\ldap-changelog-exporter.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.2:repackage (repackage) # myapp ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] <<< spring-boot-maven-plugin:2.4.2:build-image (default-cli) < package # myapp <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.2:build-image (default-cli) # myapp ---
[INFO] Building image 'artifactory.mycompany.com/common-docker-virtual/library/myapp:latest'
[INFO]
[INFO] > Pulling builder image 'artifactory.mycompany.com/common-docker-virtual/paketobuildpacks/builder:base' 100%
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.024 s
[INFO] Finished at: 2021-02-11T16:48:27-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.2:build-image (default-cli) on project myapp: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.4.2:build-image failed: Docker API call to 'localhost/v1.24/images/create?fromImage=artifactory.mycompany.com%2Fcommon-docker-virtual%2Fpaketobuildpacks%2Fbuilder%3Abase' failed with status code 500 "Internal Server Error" and message "Head https://artifactory.mycompany.com/v2/common-docker-virtual/paketobuildpacks/builder/manifests/base: unknown: Authentication is required" -> [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/PluginExecutionException
Process finished with exit code 1
Put credentials into settings.xml (~/.m2/settings.xml or whatever you specify by -s in mvn command) inside properties section (https://maven.apache.org/settings.html#Profiles)
and then in your pom.xml replace hardcoded values with defined variable names.
If you use environment variables (${env.something}), you can even skip settings.xml and define them from cli.
I'm trying to figure out how to use Maven with antlr4, and haven't been able to find anything that quite works all the way through. I'm no Maven expert. I'm starting out with a scaled-down example from chapter 3 of "The Definitive ANTLR 4 Reference". I'm using the Command Prompt console window on Windows 10. I was originally trying to use Eclipse but wasn't having much luck, so I thought I'd go back to basics and try the Command Prompt.
My main java file called App.java is at my-app/src/main/java/com/mycompany/app/App.java
My antlr4 grammar file called ArrayInit.g4 is at my-app/src/main/antlr4/ArrayInit.g4
The java files generated from ArrayInit.g4 (ArrayInitListener.java, ArrayInitParser.java, etc.) after typing "mvn antrl4:antlr4" are at my-app/target/generated-sources/antlr4
My question for the moment is how can I set up my pom.xml file so that when I compile App.java, it compiles and includes the generated antlr4 java files. I've been trying to configure the pom with various source, output, destination directories, but with no luck.
This is my grammar file ArrayInit.g4 -
grammar ArrayInit;
init : '{' value (',' value)* '}' ;
value : init
| INT
;
INT : [0-9]+ ;
WS : [ \t\r\n]+ -> skip ;
This is my main java file App.java -
package com.mycompany.app;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.tree.*;
public class App
{
public static void main( String[] args ) throws Exception
{
ANTLRInputStream input = new ANTLRInputStream(System.in);
ArrayInitLexer lexer = new ArrayInitLexer(input);
}
}
This is my pom.xml file -
<?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>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>
<name>my-app</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
</properties>
<dependencies>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
<version>4.7.2</version>
<executions>
<execution>
<id>antlr</id>
<goals>
<goal>antlr4</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
This is my error message when I try to run mvn compile -
E:\mvnbael\my-app>mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.mycompany.app:my-app >----------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # my-app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\mvnbael\my-app\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # my-app ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to E:\mvnbael\my-app\target\classes
[INFO] /E:/mvnbael/my-app/src/main/java/com/mycompany/app/App.java: E:\mvnbael\my-app\src\main\java\com\mycompany\app\App.java uses or overrides a deprecated API.
[INFO] /E:/mvnbael/my-app/src/main/java/com/mycompany/app/App.java: Recompile with -Xlint:deprecation for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /E:/mvnbael/my-app/src/main/java/com/mycompany/app/App.java:[20,17] cannot find symbol
symbol: class ArrayInitLexer
location: class com.mycompany.app.App
[ERROR] /E:/mvnbael/my-app/src/main/java/com/mycompany/app/App.java:[20,44] cannot find symbol
symbol: class ArrayInitLexer
location: class com.mycompany.app.App
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.240 s
[INFO] Finished at: 2019-09-13T11:07:21-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project my-app: Compilation failure: Compilation failure:
[ERROR] /E:/mvnbael/my-app/src/main/java/com/mycompany/app/App.java:[20,17] cannot find symbol
[ERROR] symbol: class ArrayInitLexer
[ERROR] location: class com.mycompany.app.App
[ERROR] /E:/mvnbael/my-app/src/main/java/com/mycompany/app/App.java:[20,44] cannot find symbol
[ERROR] symbol: class ArrayInitLexer
[ERROR] location: class com.mycompany.app.App
As the comment says, I had to remove <pluginManagement> tags from the pom.xml in order to get Maven to automatically run ANTLR as part of generate-sources.
I am trying to write a maven pom file that only runs pub get. However when I run mvn clean package, I get errors saying there is no main.dart file. My dart project contains reusable dart classes that I just want packaged up to be imported elsewhere, so there is no main.dart file. When I run pub get from the command line in that directory the packages are created. Here is my pom.xml file.
<?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>com.abc.comp</groupId>
<artifactId>a_comp</artifactId>
<name>a_comp</name>
<build>
<plugins>
<plugin>
<groupId>com.github.dzwicker.dart</groupId>
<artifactId>dart-maven-plugin</artifactId>
<version>3.0.8</version>
<configuration>
<pubCommand>get</pubCommand>
</configuration>
<executions>
<execution>
<id>pub-get</id>
<phase>compile</phase>
<goals>
<goal>pub</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<packaging>pom</packaging>
<version>0.0.1-SNAPSHOT</version>
</project>
Is this trying to run something other than just "pub get"? Any suggestions would be appreciated!
Edit:
Here is the maven log when I run mvn clean package. I've also tried adding a src/main/dart
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building a_comp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # a_comp ---
[INFO]
[INFO] --- dart-maven-plugin:3.0.8:pub (pub-get) # a_comp ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.359 s
[INFO] Finished at: 2015-11-30T12:55:53-08:00
[INFO] Final Memory: 7M/234M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.dzwicker.dart:dart-maven-plugin:3.0.8:pub (pub-get) on project a_comp
: Compiler-source-root 'C:\Users\s\Git Projects\project\a_comp\src\main\dart' does not exist. -> [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
I am facing an issue when trying to build my project (from the Eclipse Openshift plugin).
1.) I have a custom dependency, which at first I followed instructions on Open Shift Knowledgebase Article "Using your own jar files..."
2.) On commit and publish with above, the error still persisted, thereby I changed the openshift pre_build action hook as noted in this post on the Openshift forums "Resolved custom jar dependency..."
However, I am still getting an error on commit and publish from eclipse. Here's a dump from the console
Repository ssh://53211e7...50000f0#testapp0...312-systix.rhcloud.com/~/git/testapp0...312.git/
Stopping RockMongo cartridge
[Sun Mar 16 12:20:37 2014] [warn] module php5_module is already loaded, skipping
httpd (no pid file) not running
MongoDB already stopped
Stopping jbossas cartridge
Repairing links for 1 deployments
Building git ref 'master', commit bb2def3
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) # standalone-pom ---
[INFO] Installing /var/lib/openshift/app-root/runtime/repo/shared-helper-data-skychart-0.0.1-SNAPSHOT.jar to /var/lib/openshift/53211e...0f0/.m2/repository/com/systix/shared-helper-data-skychart/0.0.1-SNAPSHOT/shared-helper-data-skychart-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.331s
[INFO] Finished at: Sun Mar 16 12:20:48 EDT 2014
[INFO] Final Memory: 4M/78M
[INFO] ------------------------------------------------------------------------
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) # standalone-pom ---
[INFO] Installing /var/lib/openshift/app-root/runtime/repo/shared-models-skychart-0.0.1-SNAPSHOT.jar to /var/lib/openshift/5321......00f0/.m2/repository/com/systix/shared-models-skychart/0.0.1-SNAPSHOT/shared-models-skychart-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.723s
[INFO] Finished at: Sun Mar 16 12:20:53 EDT 2014
[INFO] Final Memory: 4M/78M
[INFO] ------------------------------------------------------------------------
Found pom.xml... attempting to build with 'mvn -e clean package -Popenshift -DskipTests'
Apache Maven 3.0.3 (r1075437; 2011-06-20 13:22:37-0400)
Maven home: /etc/alternatives/maven-3.0
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "2.6.32-431.5.1.el6oso.bz844450.x86_64", arch: "i386", family: "unix"
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building testapp0...312 1.0
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.134s
[INFO] Finished at: Sun Mar 16 12:21:04 EDT 2014
[INFO] Final Memory: 5M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project testapp0...0312: Could not resolve dependencies for project testapp0...0312:testapp0...312:war:1.0: Could not find artifact com.systix:shared-helper-data-skychart:jar:0.0.1-SNAPSHOT -> [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/DependencyResolutionException
An error occurred executing 'gear postreceive' (exit code: 1)
Error message: CLIENT_ERROR: Failed to execute: 'control build' for /var/lib/openshift/5321...00f0/jbossas
For more details about the problem, try running the command again with the '--trace' option.
On reviewing the above it seems like maven is able to add the dependency jars succesfully to the local repo ,but the build for the project does not seem to.
UPDATE: Including the pom.xml from both the libraries that I have marked as to be installed in the pre_build file. Both the jars were built, included in the openshift git repo, and referenced in the pre_build script to be installed in openshift's maven repo (pre_build script included at end)
pom.xml from shared-helper-data-skychart:
<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>com.systix</groupId>
<artifactId>shared-helper-data-skychart</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.11.4</version>
</dependency>
<dependency>
<groupId>com.systix</groupId>
<artifactId>shared-models-skychart</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.mongodb.morphia</groupId>
<artifactId>morphia</artifactId>
<version>0.105</version>
</dependency>
</dependencies>
</project>
pom.xml from shared-models-skychart (shared-models-skychart is a dependency in the pom.xml for shared-helper-data-skychart)
<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>com.systix</groupId>
<artifactId>shared-models-skychart</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.mongodb.morphia</groupId>
<artifactId>morphia</artifactId>
<version>0.105</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.7.3</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.11.4</version>
</dependency>
</dependencies>
</project>
pre_build script used
mvn install:install-file -Dfile=../app-root/runtime/repo/shared-helper-data-skychart-0.0.1-SNAPSHOT.jar -DgroupId=com.systix -DartifactId=shared-helper-data-skychart -Dversion=0.0.1-SNAPSHOT -Dpackaging=jar
mvn install:install-file -Dfile=../app-root/runtime/repo/shared-models-skychart-0.0.1-SNAPSHOT.jar -DgroupId=com.systix -DartifactId=shared-models-skychart -Dversion=0.0.1-SNAPSHOT -Dpackaging=jar
UPDATE 2: Also, the above pom.xml is what I have in my project code files. However, when I ssh intoopenshift servers and review the local maven repos, the following is what I see as pom.xml
cat ./.m2/repository/com/systix/shared-helper-data-skychart/0.0.1-SNAPSHOT/shared-helper-data-skychart-0.0.1-SNAPSHOT.pom
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.systix</groupId>
<artifactId>shared-helper-data-skychart</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>POM was created from install:install-file</description>
</project>
This is what worked for me:
I connected via SSH to OpenShift like described here.
There I found out that in the OpenShift maven repo (under ~/.m2/repository/) the jar had not been installed correctly. In the dependency directory there were *.jar.lastUpdated files instead of the actual jars.
I deleted the whole directory of the problematic dependency from the maven repo (manually)
In my pre_build action hook I changed mvn install:install -Dfile path to an absolute path to the jar (e.g. /var/lib/openshift/___your__id__here____/app-root/runtime/repo/dependencyfile.jar
I pushed my local changes (pre_build action hook changed in point 4.) to the git repo. Now all worked fine :)