- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在使用 Eclipse Kepler 和 Apache Maven 3.1.1。据我所知,我刚刚安装了两者并且安装正确。
我正在尝试从 Maven 存储库安装 Joda Time。我将依赖项添加到 pom.xml,但即使使用 Maven 全新安装,我的项目也无法解析 joda 库。
我的存储库位于 USER_FOLDER/.m2/repository/。在我导航到我的项目文件夹并运行“mvn clean”,然后“mvn install”之后,joda-time 文件夹及其内容就在那里。
我没有更改我的 Eclipse 项目中的任何构建路径或其他项目设置。
安装了 Eclipse Maven 集成。
我遵循了在 Spring 网站上找到的教程:http://spring.io/guides/gs/maven/
我的文件结构如下:
USER
|____ .m2
| |____ repository
| |____ joda-time [and other folders such as org]
| |____ joda-time
| |____ 2.3
| |____ _remote.repositories
| |____ joda-time-2.3.jar
| |____ joda-time-2.3.jar.sha1
| |____ joda-time-2.3.pom
| |____ joda-time-2.3.pom.sha1
|____ workspace
| |____ hello
| | |____ [project files]
| | |____ pom.xml
| | |____ dependency-reduced-pom.xml
| | |____ target
| | |____ [compiled files. Nothing related to Joda, though]
| |____ .metadata [with .plugins folder and others]
这是我的 pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework</groupId>
<artifactId>gs-maven</artifactId>
<packaging>jar</packaging>
<version>0.1.0</version>
<dependencies>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>main.java.hello.HelloWorld</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
这是我的 HelloWorld.java 主文件。在导入行上,我收到错误消息“导入 org.joda 无法解析”。
package main.java.hello;
import org.joda.time.LocalTime;
public class HelloWorld {
public static void main(String[] args) {
LocalTime currentTime = new LocalTime();
}
}
最佳答案
mvn eclipse:eclipse
还需要为 eclipse 生成包含 .classpath 的项目文件。
关于java - Eclipse 项目找不到 "org.joda",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21820078/
例如,我有一个父类Author: class Author { String name static hasMany = [ fiction: Book,
代码如下: dojo.query(subNav.navClass).forEach(function(node, index, arr){ if(dojo.style(node, 'd
我有一个带有 Id 和姓名的学生表和一个带有 Id 和 friend Id 的 Friends 表。我想加入这两个表并找到学生的 friend 。 例如,Ashley 的 friend 是 Saman
我通过互联网浏览,但仍未找到问题的答案。应该很容易: class Parent { String name Child child } 当我有一个 child 对象时,如何获得它的 paren
我正在尝试创建一个以 Firebase 作为我的后端的社交应用。现在我正面临如何(在哪里?)找到 friend 功能的问题。 我有每个用户的邮件地址。 我可以访问用户的电话也预订。 在传统的后端中,我
我主要想澄清以下几点: 1。有人告诉我,在 iOS 5 及以下版本中,如果您使用 Game Center 设置多人游戏,则“查找 Facebook 好友”(如与好友争夺战)的功能不是内置的,因此您需要
关于redis docker镜像ENTRYPOINT脚本 docker-entrypoint.sh : #!/bin/sh set -e # first arg is `-f` or `--some-
我是一名优秀的程序员,十分优秀!