就像您可能知道我是一名DevOps工程师一样,要获得我的学位,我必须提交一个项目
我到了必须离线编译Maven项目的地步
我的老师强加了一个nexus存储库,我将maven的settings.xml配置为从Nexus连接和下载存储库(这是第一次从maven中央连接并下载),并与代理连接,这与Nexus服务器相同,我的问题是插件的下载,我跟随this link并将maven存储库配置程序插件放到项目中,但是当我在项目中编写命令mvn clean install
时,出现503错误(屏幕截图为最后,我的目标是为项目成功编译并生成.ear,以便我可以将其部署在服务器上,在此先感谢sceenshot link 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>com.star</groupId>
<artifactId>Simulation</artifactId>
<packaging>pom</packaging>
<name>Simulation Project</name>
<version>1.0</version>
<properties>
<application.version>2.2</application.version>
<jboss.home>C:/jboss-eap-6.1-aya</jboss.home>
<!-- ************** -->
<!-- Build settings -->
<!-- ************** -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- maven-compiler-plugin -->
<maven.compiler.target>1.6</maven.compiler.target>
<maven.compiler.source>1.6</maven.compiler.source>
<!-- Options to override the compiler arguments directly on the compiler
arument line to separate between what the IDE understands as the source level
and what the Maven compiler actually use. -->
<maven.compiler.argument.target>${maven.compiler.target}</maven.compiler.argument.target>
<maven.compiler.argument.source>${maven.compiler.source}</maven.compiler.argument.source>
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
</properties>
<profiles>
<!-- The configuration of the development profile -->
<profile>
<id>dev</id>
<!-- The development profile is active by default -->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<build.profile.id>dev</build.profile.id>
</properties>
</profile>
<!-- The configuration of the production profile -->
<profile>
<id>prep</id>
<properties>
<build.profile.id>prep</build.profile.id>
</properties>
</profile>
<!-- The configuration of the testing profile -->
<profile>
<id>prod</id>
<properties>
<build.profile.id>prod</build.profile.id>
</properties>
</profile>
</profiles>
<modules>
<module>Simulation-ear</module>
<module>Simulation-ejb</module>
<module>Simulation-war</module>
</modules>
<build>
<filters>
<filter>../env.${build.profile.id}.properties</filter>
</filters>
<defaultGoal>package</defaultGoal>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<excludedGroups>${tests.excludedGroups}</excludedGroups>
</configuration>
</plugin>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[1.0,)</versionRange>
<goals>
<goal>unpack</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>false</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.1.1.Final</version>
<executions>
<execution>
<phase></phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.0</ejbVersion>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Version>${bioweb.version}_${maven.build.timestamp}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Version>${bioweb.version}_${maven.build.timestamp}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<inherited>true</inherited>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.build.finalName}</warName>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Version>${bioweb.version}_${maven.build.timestamp}</Implementation-Version>
</manifestEntries>
</archive>
<webResources>
<resource>
<filtering>true</filtering>
<directory>src/main/webapp</directory>
<includes>
<include>**/web.xml</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.star</groupId>
<artifactId>Simulation-ejb</artifactId>
<version>${application.version}</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>com.star</groupId>
<artifactId>Simulation-war</artifactId>
<version>${application.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>com.star</groupId>
<artifactId>Simulation-ear</artifactId>
<version>${application.version}</version>
<type>ear</type>
</dependency>
</dependencies>
</dependencyManagement>
</project>
答案 0 :(得分:0)
通过在maven的settings.xml中将nexus服务器ip添加到toproxy部分中,解决了该问题