I trying to build and push the docker image to my docker hub.After building 90% I am getting error
D:\demo>gradlew jib
> Task :jib
Containerizing application to nithin4325/my-java-image...
Container entrypoint set to [java, -cp, /app/resources:/app/classes:/app/libs/*,
com.example.demo.DemoApplication]
Executing tasks:
[=========================== ] 90.0% complete
> building image to registry
> Task :jib FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jib'.
> com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: Build
image failed, perhaps you should make sure your credentials for 'nithin4325/my-j
ava-image' are set up correctly.
build.gradle:
plugins {
id 'org.springframework.boot' version '2.2.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'java'
id 'com.google.cloud.tools.jib' version '1.4.0'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
jib{
to
{
image = 'nithin4325/my-java-image'
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-parent', version: '2.2.2.RELEASE', ext: 'pom'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
I am using windows 7 professional having docker toolbox.I already logged in to dockerhub through command prompt using docker login.
Related
When I run gradle clean build I get the build error message:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\meno.varghese\git\imc-modulemanager-poc\imc-poc\build.gradle' line: 5
* What went wrong:
Plugin [id: 'org.flywaydb.enterprise.flyway', version: '6.5.0'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.flywaydb.enterprise.flyway:org.flywaydb.enterprise.flyway.gradle.plugin:6.5.0')
Searched in the following repositories:
MavenLocal(file:/C:/Users/meno.varghese/.m2/repository)
Gradle Central Plugin Repository
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
I don't understand why the flyway plugin cannot be found. How can I fix it?
Here's my build.gradle file:
plugins {
id 'org.springframework.boot' version '2.0.0.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
id "org.flywaydb.enterprise.flyway" version '6.5.0'
}
apply plugin: "eclipse"
group = 'com.imc.poc'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web-services'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation "jakarta.xml.bind:jakarta.xml.bind-api:2.3.2"
implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
implementation group: 'mysql', name: 'mysql-connector-java', version: '8.0.20'
compile group: 'org.javassist', name: 'javassist', version: '3.27.0-GA'
compile group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.11.808'
}
flyway {
//url = 'jdbc:mysql://localhost:3306/imc_poc?user=root&password=password'
// driver = 'org.postgresql.Driver'
url = 'jdbc:mysql://imc-modulemanager.cwouijqzv1sr.ap-south-1.rds.amazonaws.com:3306'
user = 'admin'
password = 'Indegene12345'
schemas=['moduledb']
}
With reference to the official Flyway Gradle Plugin documentation page
plugins {
id "org.flywaydb.flyway.enterprise" version "6.5.0"
}
Your plugin declaration in your gradle.build
id "org.flywaydb.enterprise.flyway" version '6.5.0'
is simply wrong, and thus cannot be found.
I want to create a jar file which I can upload on AWS, but every time I run the command 'gradle jar' from command prompt I get the following error.
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --
debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
I get 'Build Successful' whenever I run 'gradle clean' in command prompt. Here is the content of build.gradle:
buildscript {
ext {
springBootVersion = '2.0.4.RELEASE'
}
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath "net.ltgt.gradle:gradle-apt-plugin:0.18"
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'net.ltgt.apt'
group = 'com.myproject.api'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = JavaVersion.VERSION_1_8
ext {
lombokVersion = '1.16.20'
mapstructVersion = '1.2.0.Final'
}
repositories {
mavenCentral()
mavenLocal()
jcenter()
flatDir {
dirs 'libs'
}
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-mail')
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile('org.springframework.data:spring-data-jpa')
compile('io.springfox:springfox-swagger2:2.9.2')
compile('io.springfox:springfox-swagger-ui:2.9.2')
compile group: 'commons-io', name: 'commons-io', version: '2.6'
compile group: 'org.json', name: 'json', version: '20180813'
compile files('libs/checksum_2.0.0.jar')
compileOnly("org.projectlombok:lombok:${lombokVersion}")
compileOnly("org.mapstruct:mapstruct-jdk8:${mapstructVersion}")
compileOnly("org.mapstruct:mapstruct-processor:${mapstructVersion}")
runtime('org.springframework.boot:spring-boot-devtools')
runtime('mysql:mysql-connector-java')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
eclipse {
classpath {
file.whenMerged { cp ->
cp.entries.add( new org.gradle.plugins.ide.eclipse.model.SourceFolder('build/generated/source/apt/ma
in', null) )
}
}
}
Do I need to add any plugins? Thanks in advance. Please help
Open task manger and force stop Java(TM) Platform SE binary and delete
C:\Users\{current user}\.gradle\caches\jars-9\jars-9.lock file
I was using 'gradle clean' and 'gradle build' instead of 'gradlew clean' and 'gradlew build'. gradlew commands worked for me.
root#ubuntu:/usr/local/hipi# gradle
FAILURE: Build failed with an exception.
Where:
Build file '/usr/local/hipi/core/build.gradle' line: 8
What went wrong:
A problem occurred evaluating project ':core'.
Could not find method distributions() for arguments [build_7msgs7jcv6q1ci90h6pi2434k3$_run_closure2#39d1aa64] on project ':core'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 7.635 secs
Build.gradle code :
defaultTasks 'install'
allprojects {
apply plugin: 'eclipse'
}
subprojects {
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
compile 'org.apache.hadoop:hadoop-common:2.7.1'
compile 'org.apache.hadoop:hadoop-mapreduce-client-core:2.7.1'
compile 'com.googlecode.json-simple:json-simple:1.1.1'
compile 'com.drewnoakes:metadata-extractor:2.8.1'
compile 'com.twelvemonkeys.imageio:imageio-jpeg:3.1.1'
compile 'com.twelvemonkeys.imageio:imageio-pnm:3.1.1'
compile 'com.twelvemonkeys.imageio:imageio-tiff:3.1.1'
compile group: 'org.bytedeco', name: 'javacpp', version: '1.0'
compile group: 'org.bytedeco', name: 'javacv', version: '1.0'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.0'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.0', classifier: 'macosx-x86_64'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.0', classifier: 'linux-x86_64'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.0', classifier: 'windows-x86_64'
testCompile "junit:junit:4+"
}
}
task install {
dependsOn(':tools:hibImport:jar')
dependsOn(':tools:hibDownload:jar')
dependsOn(':tools:hibInfo:jar')
dependsOn(':tools:hibToJpeg:jar')
dependsOn(':tools:hibDump:jar')
dependsOn(':tools:covar:jar')
doLast {
println '\nFinished building the HIPI library along with all tools and examples.'
}
}
The problem is in core folder's gradle file. Can you show me that file?
The content of core's directory gradle file should be :
apply plugin: 'java-library-distribution'
jar {
baseName = 'hipi'
version = '2.1.0'
}
distributions {
main{
baseName = 'hipi'
version = '2.1.0'
}
}
javadoc {
title = "HIPI - Hadoop Image Processing Interface"
options.links("http://docs.oracle.com/javase/8/docs/api/",
"http://hadoop.apache.org/docs/stable/api/",
"http://javadoc.metadata-extractor.googlecode.com/git/2.7.0/",
"http://bytedeco.org/javacpp-presets/opencv/apidocs/")
}
test {
testLogging.showStandardStreams = true
}
Below build.gradle file for java project is failing
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = 1.5
version = '1.0'
repositories {
mavenCentral()
}
dependencies {
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '2.+'
testCompile "log4j:log4j:1.2.9"
testCompile 'org.testng:testng:6.8'
}
test {
// enable TestNG support
task testNGTests(type: Test) {
useTestNG() {
suites 'src/test/resources/testng.xml'
useDefaultListeners = true
}
}
}
Error:
Couldnot find property 'projectDir' on org.gradle.api.tasks.testing.testng.TestNGOptions_Decorated#1595f1bb.
Then I tried in using setting.gradle file with below code:
rootProject.name = 'AutoTest_Gradle'
project(':AutoTest_Gradle').projectDir = 'C:/workspace/AutoTest_Gradle'
Here AutoTest_Gradle is the project name.Then it is failed with below error:
Where:
Settings file 'C:\workspace\AutoTest_Gradle\settings.gradle
What went wrong:`enter code here
A problem occurred evaluating settings 'AutoTest_Gradle'.
Project with path ':AutoTest_Gradle' could not be found.
Can anyone help on this?
I am trying follow this tutorial to set up Grails/ Cargo: https://github.com/bmuschko/gradle-cargo-plugin I wish to use this plugin to deploy wars to local tomcat instances and to start and stop them.
Here is my build.gradle
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'cargo'
sourceCompatibility = 1.5
version = '1.0'
jar {
manifest {
attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': version
}
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
testCompile group: 'junit', name: 'junit', version: '4.+'
classpath 'org.gradle.api.plugins:gradle-cargo-plugin:0.6.1'
def cargoVersion = '1.3.3'
cargo "org.codehaus.cargo:cargo-core-uberjar:$cargoVersion",
"org.codehaus.cargo:cargo-ant:$cargoVersion"
}
cargo {
containerId = 'tomcat6x'
port = 9090
deployable {
file = file('/Users/me/Documents/gradlemucks/grails_2/hello-world/target/hello-world-0.1.war')
context = 'helloworld'
}
local {
homeDir = file('/Users/me/developer/servers/apache-tomcat-6.0.37')
output = file('build/output.log')
tomcat {
ajpPort = 9091
}
}
}
test {
systemProperties 'property': 'value'
}
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}
When I do gradle tasks in the terminal I get:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/me/Documents/workspaces/regress_test/httptests/build.gradle' line: 3
* What went wrong:
A problem occurred evaluating root project 'httptests'.
> Plugin with id 'cargo' not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
What are my doing wrong?
The buildscript itself need the cargo dependency so adding:
buildscript {
repositories {
mavenCentral()
}
dependencies { classpath "org.gradle.api.plugins:gradle-cargo-plugin:0.6" }
}
should make it able to find the cargo plugin.