我开始玩弹簧靴,我有新的安装问题.
我使用http://start.spring.io创建了初始项目..这是我的build.gradle:
buildscript {
ext {
springBootVersion = '1.2.5.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'io.spring.dependency-management'
jar {
baseName = 'springboot-demo1'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-jdbc")
runtime("mysql:mysql-connector-java")
testCompile("org.springframework.boot:spring-boot-starter-test")
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
Run Code Online (Sandbox Code Playgroud)
当我在命令行中执行时: …
我试图在一些PHPUnit测试用例中的每次测试之前重新创建数据库.我正在使用Laravel 5.3.这是TestCase:
class CourseTypesTest extends TestCase
{
public function setUp()
{
parent::setUp();
Artisan::call('migrate');
Artisan::call('db:seed', ['--class' => 'TestDatabaseSeeder ', '--database' => 'testing']);
}
/**
* A basic functional test example.
*
* @return void
*/
public function test_list_course_types()
{
$httpRequest = $this->json('GET', '/api/course-types');
$httpRequest->assertResponseOk();
$httpRequest->seeJson();
}
public function tearDown()
{
Artisan::call('migrate:reset');
parent::tearDown();
}
}
Run Code Online (Sandbox Code Playgroud)
运行phpunit失败并显示错误:
由Sebastian Bergmann和贡献者提供的$ phpunit PHPUnit 5.7.5.
E 1/1(100%)
时间:2.19秒,内存:12.00MB
有1个错误:
1)CourseTypesTest :: test_list_course_types ReflectionException:类TestDatabaseSeeder不存在
D:\ www\learn-laravel\my-folder-api\vendor\laravel\framework\src\Illuminate\Container\Container.php:749 D:\ www\learn-laravel\my-folder-api\vendor\laravel\framework\src\Illuminate\Container\Container.php:644 D:\ www\learn-laravel\my-folder-api\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:709 D:\ www\learn-laravel\my-folder-api\vendor\laravel\framework\src\Illuminate\Database\Console\Seeds\SeedCommand.php:74 D:\ www\learn-laravel\my-folder-api\vendor\laravel\framework\src\Illuminate\Database\Console\Seeds\SeedCommand.php:63 D:\ …
您好我有一个问题,使用迁移架构生成器创建一个表.使用自引用外键的表发生此问题.这是产生错误的代码:
Schema::create('cb_category', function($table)
{
$table->integer('id')->primary()->unique()->unsigned();
$table->integer('domain_id')->unsigned();
$table->foreign('domain_id')->references('id')->on('cb_domain');
$table->integer('parent_id')->nullable();
$table->foreign('parent_id')->references('id')->on('cb_category')->onUpdate('cascade')->onDelete('cascade');
$table->string('name');
$table->integer('level');
});
Run Code Online (Sandbox Code Playgroud)
这是错误:
SQLSTATE[HY000]: General error: 1005 Can't create table 'eklik2.#sql-7d4_e' (errno: 150) (SQL: alter table `cb_cate
Run Code Online (Sandbox Code Playgroud)
血污add constraint cb_category_parent_id_foreign foreign key (PARENT_ID ) referencescb_category (上更新级联id`)上德尔ETE级联)(绑定:阵列())
[PDOException] SQLSTATE [HY000]:常规错误:1005无法创建表'eklik2.#sql-7d4_e'(错误号:150)
任何的想法?
我刚刚用命令安装了vagrant box:
vagrant init ubuntu/xenial64
Run Code Online (Sandbox Code Playgroud)
并启动它:
vagrant up --provider virtualbox
Run Code Online (Sandbox Code Playgroud)
在ssh-ing之后我找不到文件夹/ vagrant
我做错了什么?
根据文档应该有/vagrant文件夹:
默认情况下,Vagrant会将您的项目目录(包含Vagrantfile的目录)共享给/ vagrant.
这是一个很明显没有/ vagrant文件夹的截图
我的主机环境是:
这是我的Vagrant文件:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.provision "shell", path: "provision.sh"
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
# Customize the amount of memory on the VM:
vb.memory = "4096"
vb.cpus = "2" …Run Code Online (Sandbox Code Playgroud) 我正在使用git作为VCS进行项目.开发环境是关于winddows,项目包含一些很长的路径所以我被迫使用cygwingit.
我已经使用git安装了cygwin,创建了ssh密钥,上传了密钥到服务器,并且所有这些都可以从控制台运行.
但当我尝试提取,推送,拉从IntelliJ我收到以下错误:
D:/cygwin/usr/libexec/git-core/git.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
fatal: unpack-objects failed
Run Code Online (Sandbox Code Playgroud)
我已经安装gettext和Devel\gettext,libsasl2并ca-certificates根据一些recomendation我发现Cygwin的软件包但这并没有解决问题.
这是我的IntelliJ git配置
我需要做些什么才能在IntelliJ中使用来自cygwin的git?
我有一个使用硒的项目,用于前端应用程序和后端testng的集成测试。因此,为了运行测试,我首先需要启动所有依赖项目:vuejsspringboot
每个项目都在自己的存储库中。所以我创建了 springboot 和前端应用程序的 docker 映像,并将其放在gitlab container registry. 然后在testeng项目中计划使用docker-compose中的.gitlab-ci.yml. 这是docker-compose.ymltestng 项目:
version: '3.7'
services:
frontendapp:
image: demo.app-frontend-selenium
container_name: frontend-app-selenium
depends_on:
- demoapi
ports:
- 8080:80
demoapi:
image: demo.app-backend-selenium
container_name: demo-api-selenium
depends_on:
- mongodb
environment:
- SPRING_PROFILES_ACTIVE=prod
- SCOUNT_API_ENDPOINTS_WEB_CORS_OPTIONS_ALLOWEDORIGINS=*
- SPRING_DATA_MONGODB_HOST=mongodb
- SPRING_DATA_MONGODB_DATABASE=demo-api-selenium
- KEYCLOAK_AUTH-SERVER-URL=https://my-keycloak-url/auth
ports:
- 8082:80
mongodb:
image: mongo:4-bionic
container_name: mongodb-selenium
environment:
MONGO_INITDB_DATABASE: demo-api-selenium
ports:
- 27017:27017
volumes:
- ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
Run Code Online (Sandbox Code Playgroud)
在 gitlab-ci.yml 中运行 docker-compose …
我正在处理2个项目,这些项目存储在2 git repos Project1和Project2中
Project1是一个javascript项目.它有自己的回购协议(例如https://github.com/gandra/project1.git)
Project2的是一个Java Maven项目.它有自己的回购(例如 https://github.com/gandra/project2.git)
这是我想要改进的当前工作流程:
我想以某种方式避免第3步(将Project1/build内容手动复制到Project2/libs/project1-lib目录中)我想将Project1作为子树集成到Project2中但是这种方法的问题是因为它获取了所有Project1目录结构到Project2/libs/project1-lib,我只想获取Project1的子目录(Project1/build/*)
一些重要的注意事项:Project1更改仅在其自己的存储库中发生(https://github.com/gandra/project1.git),此更改应传播到Project2.所以没有从Project2/libs/project1-lib更新Project1换句话说:
- Project1中的提交影响Project2
- Project2中的提交不影响Project1
我正在使用dotnetcore 1.1并尝试连接到SQL Server版本8.00.2055.
我在项目中有2个连接:一个连接到SqlServer 2016,另一个连接到Sql Server 8.00.2055(Sql Server 2000?)
无法建立第二个连接.这是我得到的错误:
2017-07-31T11:34:24.8747442 + 02:00 0HL6NUT8S82KF [错误]用户: - 在登录协商期间,SQL Server实例返回了无效或不支持的协议版本.(637b11d7)
我正在使用的连接字符串是 Server=MyServerHost; Initial Catalog=MyDatabaseName; User id=sa; Password=********;
知道如何修复此错误吗?
我正在使用无业游民开发angular4应用程序。我已经安装了vagrant-fsnotify插件,以便通知文件系统更改以触发热构建。我的问题是vagrant fsnotify流浪汉启动后如何自动运行?
刚刚开始使用jest进行测试的某些节点应用程序上。express-generator用于脚手架。
在第一次测试中,我得到以下错误:
Jest已检测到以下3个打开的句柄,有可能阻止Jest退出
重现步骤:
git clone git@github.com:gandra/node-jest-err-demo.git
cd node-jest-err-demo
npm install
cp .env.example .env
npm run test
Run Code Online (Sandbox Code Playgroud)
npx envinfo --preset jest 输出:
npx: installed 1 in 1.896s
System:
OS: macOS High Sierra 10.13.4
CPU: x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz Binaries:
Node: 9.3.0 - /usr/local/bin/node
Yarn: 1.5.1 - /usr/local/bin/yarn
npm: 5.7.1 - /usr/local/bin/npm npmPackages:
jest: ^23.1.0 => 23.1.0
Run Code Online (Sandbox Code Playgroud)
知道如何解决吗?
这是github上的相关问题:https : //github.com/facebook/jest/issues/6446