Could not find metadata maven-metadata.xml in remote(nexus) - maven-plugin

I use spring-contract as contract test in my project with gradle. I want to publish the contract stubs to nexus server. But when I execute the publishing command. The error occur.
build.gradle file
buildscript {
project.ext {
bootVersion = '2.0.4.RELEASE'
nexusUsername = project.hasProperty('nexusUsername') ? project.getProperty('nexusUsername') : ''
nexusPassword = project.hasProperty('nexusPassword') ? project.getProperty('nexusPassword') : ''
nexusUrl = project.hasProperty('nexusUrl') ? project.getProperty('nexusUrl') : ''
}
}
apply plugin: 'maven-publish'
publishing {
repositories {
maven {
url nexusUrl
credentials {
username = nexusUsername
password = nexusPassword
}
}
}
}
......
when I execute the publish command below
./gradlew publish -P nexusUsername=xxx -P nexusPassword=xxx -P nexusUrl=nexus-domain:8081/repository/maven-snapshots/
then occur the error
Could not find metadata xxx:backend:0.0.1-SNAPSHOT/maven-metadata.xml in remote (xxx:8081/repository/maven-snapshots/)
Upload xxx:8081/repository/maven-snapshots/xxx/backend/0.0.1-SNAPSHOT/backend-0.0.1-20200409.083111-1.pom
But there has a xx:backend:0.0.1-SNAPSHOT/maven-metadata.xml in remote xxx:8081/repository/maven-snapshots/ in the nexus server.(it was working before, but it's not working now.)
So I am confused now... Do yo have some suggestion? Please.

Related

How to use better-sqlite3 with electron-react-boilerplate

Consider this example created by using the following steps:
git clone --depth=1 https://github.com/electron-react-boilerplate/electron-react-boilerplate.git better-sqlite3-test
cd better-sqlite3-test
yarn
cd ./release/app
yarn add better-sqlite3
cd ../..
yarn add -D #types/better-sqlite3
Now, as soon as I start using the database.js like this:
class B3SqliteDB {
constructor() {
let db = null;
}
startDB = () => {
const Database = require('better-sqlite3');
this.db = new Database('upStore.db', { verbose: console.log });
const createTable =
"CREATE TABLE IF NOT EXISTS newTable ('id' VARCHAR(10) NOT NULL, 'name' VARCHAR(50) NOT NULL);";
this.db.exec(createTable);
};
}
export default new B3SqliteDB;
I am getting the error:
Uncaught TypeError: Database is not a constructor
at B3SqliteDB.startDB (renderer.dev.js:65346)
at renderer.dev.js:65285
Can someone please help to figure this out! TYA
This worked for me
Downgrade electron to 13.6
Install better-sqlite3 in root
Rebuild the package
Test
yarn remove electron
yarn add electron#13.6.1
yarn add better-sqlite3;
cd node_modules/better-sqlite3;
../.bin/electron-rebuild
cd ../..
npm run start
enter image description here
Note
You can try other desktop options (Electron Alternatives) that support integration ReactJS | VueJS just fine
Wails (Golang)
https://github.com/wailsapp/wails
Lorka (Golang)
https://github.com/zserge/lorca
Tauri (Rust)
https://github.com/tauri-apps/tauri
Flutter Desktop (Dart)
https://flutter.dev/desktop
What I love is that the app size is just 10 - 20 times smaller than a sample Hello World Electron App.

Use a config file in jenkins pipeline

I have a Jenkins pipeline job, which is parametrized. It will take a string input and pass that to a bat script.
Input : https://jazz-test3.com/web/projects/ABC
I wanted to include a config file, it should be placed in a location (may be in the Jenkins machine locally or what can be the best option?).
Sample config file: server_config.txt
test1 : https://jazz-test1.com
test2 : https://jazz-test2.com
test3 : https://jazz-test3.com
Once the user input is received , the job should access this file and check whether the server in the input link is present in the config file.
If present call the bat script if not present throw an error , the server is not supported.
Expected result:
Input 1 : https://jazz-test3.com/web/projects/ABC
Job should run
Input 2 : https://jazz-test4.com/web/projects/ABC
Job should fail with error message
What is the best way of achieving this ?
Can we do it directly from the pipeline or a separate script will be required to perform this ?
Thank you for the help!!
Jenkins supports configuration files stored on the controller via the config-file-provider plugin. See Manage Jenkins | Managed Files for the collection of managed configuration files.
You can add a JSON config file with id "test-servers" that stores your test server configuration:
{
"test1":"https://jazz-test-1.com",
"test2":"https://jazz-test-1.com"
}
Then the job pipeline would do something like:
servers = [:]
stage("Setup") {
steps {
configFileProvider([fileId:'test-servers', variable:'test_servers_json']) {
script {
// Read the json data from the file.
echo "Loading configured servers from file '${test_servers_json}' ..."
servers = readJSON(file:test_servers_json)
}
}
}
}
stage('Test') {
steps {
script {
// Check if 'server' is supported.
if (!servers.containsKey(params.server)) {
error "Unsupported server"
}
build job:'...', parameters:[...]
}
}
}

How to deploy Ktor app on Google App Engine?

The official tutorial from Ktor.io doesn't work, I tried it.
It's my first deploy. Thanks for help.
My gradle file (kts):
import com.google.cloud.tools.gradle.appengine.appyaml.AppEngineAppYamlExtension
buildscript {
dependencies {
classpath("com.google.cloud.tools:appengine-gradle-plugin:2.2.0")
}
}
apply {
plugin("com.google.cloud.tools.appengine")
}
plugins {
// Support for Kotlin
id("org.jetbrains.kotlin.jvm") version "1.3.61"
// Support for building a CLI application
application
// Documentation
id("org.jetbrains.dokka") version "0.10.1"
war
// id("com.improve_future.harmonica") version "1.1.24"
}
application {
mainClassName = "com.easythings.parkkometr.AppKt"
group = "com.easythings"
version = "0.0.1"
}
sourceSets {
main {
java.srcDir("app/main/src")
resources.srcDir("app/main/resources")
}
test {
java.srcDir("app/test/src/")
resources.srcDir("app/test/resources/")
}
}
repositories {
jcenter()
maven { setUrl("https://kotlin.bintray.com/ktor") }
}
dependencies {
val ktorVersion: String by project
val logbackVersion: String by project
val exposedVersion: String by project
val pgVersion: String by project
val spekVersion: String by project
val sendGridVersion: String by project
val assertJVersion: String by project
// Kotlin ============================================================================
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// Libs ============================================================================
// Ktor - framework
implementation("io.ktor", "ktor-server-jetty", ktorVersion)
implementation("io.ktor", "ktor-server-core", ktorVersion)
implementation("io.ktor", "ktor-server-host-common", ktorVersion)
implementation("io.ktor", "ktor-auth", ktorVersion)
implementation("io.ktor", "ktor-auth-jwt", ktorVersion)
implementation("io.ktor", "ktor-gson", ktorVersion)
implementation("io.ktor", "ktor-network-tls-certificates", ktorVersion)
// Logback - application logger
implementation("ch.qos.logback", "logback-classic", logbackVersion)
// Exposed - orm
implementation("org.jetbrains.exposed", "exposed-core", exposedVersion)
implementation("org.jetbrains.exposed", "exposed-dao", exposedVersion)
implementation("org.jetbrains.exposed", "exposed-jdbc", exposedVersion)
implementation("org.jetbrains.exposed", "exposed-jodatime", exposedVersion)
// Postgresql - database driver
implementation("org.postgresql", "postgresql", pgVersion)
// SendGrid - mailer
implementation("com.sendgrid", "sendgrid-java", sendGridVersion)
// Deploy ============================================================================
providedCompile("com.google.appengine", "appengine", "1.9.60")
// Tests ============================================================================
}
tasks {
dokka {
outputDirectory = "$buildDir/docs/dokka"
outputFormat = "html"
}
test {
useJUnitPlatform {
includeEngines("spek2")
}
}
}
configure<AppEngineAppYamlExtension> {
deploy {
setAppEngineDirectory(".")
version = "1"
projectId = "XYZ-placeholder"
stopPreviousVersion = true // default - stop the current version
promote = true // default - & make this the current version
}
stage {
setAppEngineDirectory(".")
}
}
My app.yaml file:
runtime: java
env: flex
handlers:
- url: /.*
script: this field is required, but ignored
I get information that the deploy has finished successfully, but I get a 403 error when I call gcloud app browse.
HTTP ERROR 403 Problem accessing /. Reason:
Forbidden
I think that my app doesn't start and it's the error from Jetty, but I don't know how to check/confirm and fix it.
The task appengineRun doesn't exist in this version GAE.
First of all, the provided Ktor tutorial for App Engine Standard environment, but you have "flex" env in the app.yaml file.
Also I would like to recommend you follow the official more informative Google Cloud documentation for Ktor.

Cannot connect to MS-SQL with react-native

I have used the following package
import MSSQL from 'react-native-mssql';
near the above package on hover, it shows
Could not find a declaration file for module 'react-native-mssql'. 'd:/React Native Apps/Login/node_modules/react-native-mssql/index.android.js' implicitly has an 'any' type.
Try npm install #types/react-native-mssql if it exists or add a new declaration (.d.ts) file containing declare module 'react-native-mssql';
module "d:/React Native Apps/Login/node_modules/react-native-mssql/index.android
I have tried installing as mentioned above but nothing works.
And in code, I am getting an error at below line.
MSSQL.connect(config);
error is following
undeined is not an object (evaluating '_reactNativeMssql2.default.connect')
Please tell me how do I connect to MSSQL with react-native.
react-native-mssql can be installed with npm install --save react-native-mssql
then edit file android/settings.gradle and add:
include ':react-native-mssql'
project(':react-native-mssql').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mssql/android')
as well as file android/app/build.gradle:
dependencies {
...
implementation project(':react-native-mssql')
}
then it can be added to the packages list:
...
import com.stonem.mssql.MSSQLPackage;
...
#Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
...
.addPackage(new MSSQLPackage())
...
);
}
and then connected:
import MSSQL from 'react-native-mssql';
...
let config = {
server: '192.168.1.1', // ip address of the mssql database
username: 'sa', // username to login to the database
password: 'password', // password to login to the database
database: 'admin', // the name of the database to connect to
port: 1234 // OPTIONAL, port of the database on the server
}
MSSQL.connect(config);
an example for a SELECT query:
let query = 'SELECT TOP * FROM USERS'
MSSQL.executeQuery(query);
and one for an UPDATE query:
let query = 'UPDATE USERS SET Active=0'
MSSQL.executeUpdate(query);
make sure to call MSSQL.close(); once the connection isn't required anymore.
You could use "react-native link react-native-mssql" in the command prompt after using "cd Project_Name" to fix the issue, if 'Could not find a declaration file for module 'react-native-mssql' was your issue all along.

grails javax.servlet.ServletException: Could not resolve view with name '/index' in servlet with name 'grailsDispatcherServlet'

i'm trying to run my app using this tutorial :
http://guides.grails.org/building-a-react-app/guide/index.html
there is the the git repository
https://github.com/tetar998/building-a-react-app/tree/master/complete
but i m stuck with this error
Could not resolve view with name '/index' in servlet with name 'grailsDispatcherServlet'
i am currently working with
- groovy 2.4.11
- java 8u152
- grails 3.3.0
and in there is my controller/demo/urlmappings
package demo
class UrlMappings {
static mappings = {
"/$controller/$action?/$id?(.$format)?"{
constraints {
// apply constraints here
}
}
"/"(view: '/index')
"500"(view: '/error')
"404"(view: '/notFound')
}
}
Any suggestion?

Resources