小编Nas*_*mad的帖子

无法传输工件org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from/to central(http://repo1.maven.org/maven2)

我在SpringSource Tool Suite中创建了一个新的maven项目.我在新的maven项目中遇到此错误.

无法转移org.apache.maven.plugins:来自http://repo1.maven.org/maven2的 maven-surefire-plugin:pom:2.7.1 被缓存在本地存储库中,在更新间隔之前不会重新尝试解析中心已经过去或强制更新.原始错误:无法传输工件org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from/to central(http://repo1.maven.org/maven2):连接超时

pom.xml中:

<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.test.app</groupId>
  <artifactId>TestApp</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>TestApp</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
Run Code Online (Sandbox Code Playgroud)

将Settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <pluginGroups>
  </pluginGroups>
 <proxies>
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>user</username>
      <password>pass</password>
      <host>ip</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>    
  </proxies> 
  <servers>  
  </servers>
    <mirrors>   
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://repo1.maven.org/maven2/</url>
    </mirror>    
  </mirrors>  
<profiles>
 </profiles>
</settings>
Run Code Online (Sandbox Code Playgroud)

请注意,我能够构建它.在IDE中的pom.xml中显示错误.任何解决方案?

java maven

60
推荐指数
7
解决办法
26万
查看次数

无法创建请求的服务[org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

我正在尝试将hibernate orm映射工具配置到我的java类并使用PostgreSQL作为我的数据库并将密码配置为"密码".当我尝试运行应用程序时,我在控制台日志上遇到错误,因为 无法创建请求的服务[org.hibernate.engine.jdbc.env.spi.JdbcEnvironment].我在旧版本的hibernate上试过这个并且它有效.我现在使用的hibernate版本是5.1.0版.

以下是错误日志:

Mar 31, 2016 3:55:09 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {5.1.0.Final}
Mar 31, 2016 3:55:09 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Mar 31, 2016 3:55:09 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Mar 31, 2016 3:55:09 PM org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntity
WARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-configuration. Use namespace http://www.hibernate.org/dtd/hibernate-configuration instead.  Support for obsolete DTD/XSD namespaces may be removed at any time.
Mar 31, 2016 3:55:10 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: …
Run Code Online (Sandbox Code Playgroud)

java postgresql orm hibernate jdbc

34
推荐指数
3
解决办法
15万
查看次数

JPA @Entity注释的确切含义是什么?

我正在Spring应用程序中学习JPA,我对@Entity注释有一些疑问.

所以我有一个这样的模型类:

@Entity
@Table(name= “T_CUSTOMER”)
public class Customer {

    @Id
    @Column(name=“cust_id”)
    private Long id;

    @Column(name=“first_name”)
    private String firstName;

    @Transient
    private User currentUser;

    ...........................
    ...........................
    ...........................
}
Run Code Online (Sandbox Code Playgroud)

好的,我知道@Entity注释是在类级别上,这意味着作为此类实例的对象的字段将映射到T_CUSTOMER数据库表的字段.

但是为什么在JPA中必须使用@Entity注释,我不仅可以使用@Table注释将模型对象映射到特定的数据库表?它有一些其他意义\行为,实际上我错过了?

我错过了什么?@Entity注释的确切含义是什么?

entity annotations jpa

24
推荐指数
1
解决办法
3万
查看次数

安装node.JS时node.js运行时和npm包管理器选项有什么区别?

我试图通过下载.exe文件来安装node.js,我很困惑并且坚持在Node.js设置中,其中要求安装node.js运行时npm包管理器, 所以我想在知道后继续安装完全是两者之间的区别.

我的问题是node.js运行时和npm pacakage管理器之间有什么区别,我对这两个选项有什么功能.

我安装node.js的基本目的是编译Typescript,请帮我理解这两个包的功能 屏幕截图的安装窗口

node.js npm

23
推荐指数
3
解决办法
2万
查看次数

高效的在Python中查找两个给定路径之间的公共文件的方法

我编写了代码来查找两个给定文件夹(路径)之间的公共文件,这些文件夹占所有级别的子文件夹(如果存在).

请建议是否有更有效的方法.如果给出具有多级子文件夹的文件夹,则花费太长时间.

def findCommonDeep(self,path1,path2):
    commonfiles = []

    for (dirpath1, dirname1, filenames1) in os.walk(path1):
        for file in filenames1:
            for (dirpath2, dirname2, filenames2) in os.walk(path2):
                if (file in filenames2 and isfile(join(dirpath2, file))):
                        commonfiles.append(file)

    print(commonfiles)
Run Code Online (Sandbox Code Playgroud)

并使用路径调用此函数,如下所示:

findCommonDeep("/home/naseer/Python", "/home/naseer/C")
Run Code Online (Sandbox Code Playgroud)

据我所知,如果我存储任何给定路径的所有文件的列表,则可以降低执行速度.但我想这会耗尽内存.请指导我更有效地接近这个.

python operating-system file

8
推荐指数
1
解决办法
294
查看次数

为什么我的python程序与while循环无限运行

这是官方python文档中给出的用于打印Fibonacci系列的代码.

我不明白为什么这个代码运行到无穷大,因为while循环条件没有问题.

def fib(n):
    a, b = 0, 1
    while a < n:
        print a,
        a, b = b, a + b

number = raw_input("What's the number you want to get Fibonacci series up to?")
fib(number)
Run Code Online (Sandbox Code Playgroud)

python

0
推荐指数
1
解决办法
91
查看次数

为什么我的C代码出错了

以下是我的代码.编译器生成错误

#include<stdio.h>
struct Shelf{
    int clothes;
    int *books;
};
struct Shelf b;
b.clothes=5;
*(b.books)=6;
Run Code Online (Sandbox Code Playgroud)

编译器为语句b.clothes=5;b->books=6;上面的代码生成如下错误.

error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘->’ token
Run Code Online (Sandbox Code Playgroud)

我不是C的初学者,我相信我所写的是正确的.请解决我的问题

c pointers

0
推荐指数
1
解决办法
89
查看次数

标签 统计

java ×2

python ×2

annotations ×1

c ×1

entity ×1

file ×1

hibernate ×1

jdbc ×1

jpa ×1

maven ×1

node.js ×1

npm ×1

operating-system ×1

orm ×1

pointers ×1

postgresql ×1