Maven有能力执行并行构建:https: //cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3
mvn -T 4 clean install # Builds with 4 threads
mvn -T 1C clean install # 1 thread per cpu core
mvn -T 1.5C clean install # 1.5 thread per cpu core
Run Code Online (Sandbox Code Playgroud)
是否可以在pom.xml或settings.xml中指定此参数?重复这个选项可能很烦人.
我正在尝试在Eclipse(Indigo)中创建简单的EJB + JPA项目.我创建了新的EJB项目,其中:
我在尝试定义实体时遇到问题:表"Employee"无法解析.我添加了带有指定名称参数的@Table注释,但这不起作用.我的persistence.xml文件:
<persistence-unit name="pu_name">
<jta-data-source>jdbc/baza1Postgres</jta-data-source>
</persistence-unit>
Run Code Online (Sandbox Code Playgroud)
在glassfish中,我定义了名为JDBC资源的JDBC资源:"jdbc/baza1Postgres
"如果我的表存在,"eclipse如何知道"?还有什么我应该配置?
我正在使用Postgres SQL 9.2,Spring JDBC版本4.0.5和Java 8.
Java 8引入了新的日期/时间API,我想使用它,但是我遇到了一些困难.我创建了表TABLE_A:
CREATE TABLE "TABLE_A"
(
new_date date,
old_date date
)
Run Code Online (Sandbox Code Playgroud)
我正在使用Spring JDBC与数据库进行通信.我创建了Java类,它对应于这个表:
public class TableA
{
private LocalDate newDate;
private Date oldDate;
//getters and setters
}
Run Code Online (Sandbox Code Playgroud)
这是我的代码,它可以插入新行:
public void create(TableA tableA)
{
BeanPropertySqlParameterSource parameterSource = new BeanPropertySqlParameterSource(tableA);
final String sql = "INSERT INTO public.TABLE_A (new_date,old_date) values(:newDate,:oldDate)";
namedJdbcTemplate.update(sql,parameterSource);
}
Run Code Online (Sandbox Code Playgroud)
当我执行这个方法时,我得到了异常:
org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of java.time.LocalDate. Use setObject() with an explicit Types value to specify the type to …
Run Code Online (Sandbox Code Playgroud) 我已定义界面
public interface MyInterface {
default void setOrder(int a){ }
default int getOrder(){return 123;}
}
Run Code Online (Sandbox Code Playgroud)
和实施
public class MyInterfaceImpl implements MyInterface {}
Run Code Online (Sandbox Code Playgroud)
在我的spring配置文件中,我定义了以下bean:
<bean id="a" class="my.package.MyInterfaceImpl">
<property name="order" value="999"/>
</bean>
Run Code Online (Sandbox Code Playgroud)
当我创建spring上下文时,我遇到以下错误:
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'order' of bean class [my.package.MyInterfaceImpl]: Bean property 'order' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Run Code Online (Sandbox Code Playgroud)
我在版本4.1.6.RELEASE中使用spring.所以我的问题是为什么不可能从接口MyInterface执行默认方法setOrder?看来春天完全忽略了这样的方法.
我正在使用 Gcloud 运行 Prow(持续集成服务器)。我的工作之一是创建一个虚拟机,执行一些测试,然后删除该实例。我使用服务帐户来创建虚拟机,运行测试。
#!/bin/bash
set -o errexit
cleanup() {
gcloud compute instances delete kyma-integration-test-${RANDOM_ID}
}
gcloud config set project ...
gcloud auth activate-service-account --key-file ...
gcloud compute instances create <vm_name> \
--metadata enable-oslogin=TRUE \
--image debian-9-stretch-v20181009 \
--image-project debian-cloud --machine-type n1-standard-4 --boot-disk-size 20 \
trap cleanup exit
gcloud compute scp --strict-host-key-checking=no --quiet <script.sh> <vm_name>:~/<script.sh>
gcloud compute ssh --quiet <vm_name> -- ./<script.sh>
Run Code Online (Sandbox Code Playgroud)
一段时间后,我收到以下错误:
ERROR: (gcloud.compute.scp) INVALID_ARGUMENT: Login profile size exceeds 32 KiB. Delete profile values to make additional space.
Run Code Online (Sandbox Code Playgroud)
事实上,对于该服务帐户, …
java ×2
java-8 ×2
postgresql ×2
spring ×2
cloud ×1
eclipse ×1
ejb ×1
gcloud ×1
glassfish ×1
google-iam ×1
jpa ×1
maven ×1
spring-4 ×1
spring-jdbc ×1