新机器上的Maven配置
我在一个小实验室工作,我们有两台机器,intellij、svn和maven用于开发。我的任务是为开发配置第三台机器。 我想要一些关于如何做到这一点的指导。我有新机器上的Maven配置,maven,pom.xml,Maven,Pom.xml,我在一个小实验室工作,我们有两台机器,intellij、svn和maven用于开发。我的任务是为开发配置第三台机器。 我想要一些关于如何做到这一点的指导。我有svn checkout和所有文件,项目在intellij中打开: --main: --爪哇: --ca: --病毒学: --src: xml 我的pom.xml如下所示: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.
svn checkout
和所有文件,项目在intellij中打开:
--main:
--爪哇:
--ca:
--病毒学:
--src:
xml
我的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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ca.virology</groupId>
<artifactId>virology-parent</artifactId>
<version>1.0</version>
</parent>
<groupId>ca.virology</groupId>
<artifactId>gatu</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>ca.virology</groupId>
<artifactId>virology-lib</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.virology</groupId>
<artifactId>base-by-base</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.virology</groupId>
<artifactId>vgo</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.virology</groupId>
<artifactId>jdotter</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ptolemy</groupId>
<artifactId>ptolemy2</artifactId>
<version>0</version>
</dependency>
<dependency>
<groupId>ca.virology</groupId>
<artifactId>virology-common</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.biojava</groupId>
<artifactId>core</artifactId>
<!--virology-lib used 1.4, 1.8.2 is most recent-->
<version>1.8.2</version>
</dependency>
<!-- this is only in the local repository because the only available maven versions do not contain the classes we need-->
<!-- use "mvn install:install-file -DgroupId=org.ggf.drmaa -DartifactId=drmaa -Dversion=0 -Dpackaging=jar -Dfile=/path/to/file.jar" to install the file to your local repository if necessary-->
<dependency>
<groupId>org.ggf.drmaa</groupId>
<artifactId>drmaa</artifactId>
<version>0</version>
</dependency>
<!-- this is only in the local repository because a maven version does not exist-->
<!-- use "mvn install:install-file -DgroupId=javax.jnlp -DartifactId=jnlp -Dversion=0 -Dpackaging=jar -Dfile=/path/to/file.jar" to install the file to your local repository if necessary-->
<dependency>
<groupId>javax.jnlp</groupId>
<artifactId>jnlp</artifactId>
<version>0</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.0</version>
</dependency>
<!-- this is only in the local repository because a maven version does not exist-->
<!-- use "mvn install:install-file -DgroupId=pal -DartifactId=pal -Dversion=1.5 -Dpackaging=jar -Dfile=/path/to/file.jar" to install the file to your local repository if necessary-->
<dependency>
<groupId>pal</groupId>
<artifactId>pal</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-apache-oro</artifactId>
<version>1.9.2</version>
</dependency>
<!--Intellij GUI-->
<dependency>
<groupId>com.intellij</groupId>
<artifactId>forms_rt</artifactId>
<version>6.0.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<mainClass>ca.virology.gatu.GenomeAnnotator</mainClass>
</manifest>
<manifestEntries>
<Permissions>all-permissions</Permissions>
<Codebase>*</Codebase>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
<filters>
<filter>
<artifact>xerces:xercesImpl</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
但maven仍在尝试从其他地方下载:
[致命]ca的不可解析父POM.virology:gatu:1.0-SNAPSHOT:找不到ca.virology:virology父POM:1.0 in>/maven2缓存在本地存储库中,在经过central的更新间隔或强制更新且“parent.relativePath”指向错误的本地POM@第7行之前,不会重新尝试解析,第13栏
有什么见解吗?我觉得好像我遗漏了一些重要的东西你是在第三台机器上重新安装了maven,还是从前两台机器上复制了maven文件夹。如果安装了新版本,还需要查看以前计算机上.m2文件夹中的settings.xml文件。这些机器上的settings.xml文件中配置的存储库可能不在第三台机器上的settings.xml上 如果您的父项目不在本地maven存储库中,那么您还可以为父项目在条目中添加relativePath,如下所示:
<parent>
<groupId>com.test</groupId>
<artifactId>test-artifact</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>{path to}/test-artifact/pom.xml</relativePath>
</parent>
com.test
测试伪影
1.0-快照
{path to}/test artifact/pom.xml
此外,您需要检查intellij是否指向从以前的机器复制的maven安装。Intellij可能指向内置的maven设置 您是在第三台机器上重新安装了maven,还是从前两台机器上复制了maven文件夹。如果安装了新版本,还需要查看以前计算机上.m2文件夹中的settings.xml文件。这些机器上的settings.xml文件中配置的存储库可能不在第三台机器上的settings.xml上 如果您的父项目不在本地maven存储库中,那么您还可以为父项目在条目中添加relativePath,如下所示:
<parent>
<groupId>com.test</groupId>
<artifactId>test-artifact</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>{path to}/test-artifact/pom.xml</relativePath>
</parent>
com.test
测试伪影
1.0-快照
{path to}/test artifact/pom.xml
此外,您需要检查intellij是否指向从以前的机器复制的maven安装。Intellij可能指向内置的maven设置
mvn clean install
${project.version}
mvn clean install
${project.version}
如果您在本地拥有
jar
-文件,您可以[编辑]
尝试从项目网站手动下载该文件
然后,使用以下命令安装:
mvn install:install-file -DgroupId=ca.virology -DartifactId=virology-parent \
-Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file
(您是否尝试过
-offline
切换到maven?如果您本地有jar
-文件,您可以[编辑]
尝试从项目网站手动下载该文件
然后,使用以下命令安装:
mvn install:install-file -DgroupId=ca.virology -DartifactId=virology-parent \
-Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file
(您是否尝试过
-offline
切换到maven?我在新机器上安装了maven clean(3.3.3),但它没有在.m2中生成settings.xml,因此我将该文件复制到新机器中。文件的内容似乎没有指定“自定义”JAR的路径,只是指向maven.apache的链接。。。这是否意味着每台机器的磁盘上都有一个包含JAR的本地repo?是的,每台机器都有一个本地存储库。我如何指定maven来查找这些文件夹?它似乎试图从其他地方下载。。下载:这显然是不可能的。Maven在本地存储库的.m2文件夹中查找jar文件。复制settings.xml文件后,是否尝试从命令行上的项目目录运行mvn clean install?是的,这似乎不起作用(在central()中找不到工件ca.virology:virology parent:pom:1.0)。在您的帖子中,如何检查intellij是否指向我从以前的机器复制的maven安装?我在新机器上安装了maven clean(3.3.3),但它没有在.m2中生成settings.xml,因此我将该文件复制到新机器中。文件的内容似乎没有指定“自定义”JAR的路径,只是指向maven.apache的链接。。。这是否意味着每台机器的磁盘上都有一个包含JAR的本地repo?是的,每台机器都有一个本地存储库。我如何指定maven来查找这些文件夹?它似乎试图从其他地方下载。。下载:这显然是不可能的。Maven在本地存储库的.m2文件夹中查找jar文件。复制settings.xml文件后,是否尝试从命令行上的项目目录运行mvn clean install?是的,这似乎不起作用(在central()中找不到工件ca.virology:virology parent:pom:1.0)。在您的帖子中,如何检查intellij是否指向我从以前的机器复制的maven安装?同样的错误,[信息]扫描项目。。。[错误][错误]处理POM时遇到一些问题:[致命]ca的不可解析父POM。病毒学:gatu:1.0-SNAPSHOT:找不到ca。病毒学:病毒学父:POM:${project.version}缓存在本地存储库中,在更新之前不会重新尝试解析