`

Maven Related

 
阅读更多

1. Install m2Eclipse

要使用下面这个link.

http://download.eclipse.org/technology/m2e/releases

 

apache-maven-3.2.3\lib\maven-model-builder-3.2.3.jar\org\apache\maven\model\pom-4.0.0.xml

  <repositories>
    <repository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <updatePolicy>never</updatePolicy>
      </releases>
    </pluginRepository>
  </pluginRepositories>

 

2. Maven 需要使用JDK,不能使用JRE.

 

3. setting.xml 中 server 元素的 id 必须与 POM 中需要谁的 repository 元素的 id 完全一致。正是此 id 将认证信息与仓库配置联系在一起。

settings.xml
  <servers>
    <server>
      <id>central</id>
      <username>repouser</username>
      <password>repopwd</password>
    </server>
  </servers>
  
pom-4.0.0
<project>
  <modelVersion>4.0.0</modelVersion>

  <repositories>
    <repository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>
</project>

 

4. Change version from 2.3.2 to 3.1, then problem sloved.

DescriptionResourcePathLocationType

Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from https://hostname:8081/nexus/service/local/repositories/mavencentral/content was cached in the local repository, resolution will not be reattempted until the update interval of dsnexus-central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from/to dsnexus-central (https://hostname:8081/nexus/service/local/repositories/mavencentral/content): Access denied to https://hostname:8081/nexus/service/local/repositories/mavencentral/content/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom. Error code 401, Unauthorizedpom.xml/MavenTest2line 1Maven Configuration Problem

 

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <executions>
          <execution>
            <id>default-compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <source>1.6</source>
              <target>1.6</target>
            </configuration>
          </execution>
          <execution>
            <id>default-testCompile</id>
            <phase>test-compile</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
            <configuration>
              <source>1.6</source>
              <target>1.6</target>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
 
分享到:
评论

相关推荐

    Android.Application.Development.with.Maven

    Whether you are already using Maven or another build tool, this book focuses only on Maven topics that are related to Android development. It would be helpful, but not necessary, if you have some ...

    Apache Maven Dependency Management

    Maven eliminates this need by reading the project files of dependencies to figure out their inter-relations and other related information. Gaining an understanding of project dependencies will allow ...

    Android代码-maven-git-commit-id-plugin

    maven git commit id plugin ... For those who don't know the previous plugins, it basically helps you to help you with the following tasks and answer related questions Which version had

    Web-Related-Examples

    【标题】"Web-Related-Examples" 涵盖了与Web开发相关的各种实例,主要集中在Java编程语言上。这个项目可能是一个集合,包含了不同类型的Web应用开发中的关键概念和技术的实战展示。以下是对这些知识点的详细说明: ...

    Android代码-DistilledViewPrefs

    Improvements, code related or suggestions. Fork it if you feel for it as well. :) Screens Implementation example Add this to your gradle build file repositories { maven { url ...

    Java学生信息管理系统的构建与实现

    It is outlined with five main steps from setting up Maven project structure and defining Student object models through managing these objects via code. Also provided are instructions related to ...

    Android代码-Android列表视图实现

    An Android List View implementation with support for drawable cells and many other swipe related features. Introduction Download Maven Dependency APKLib and others Dependencies XML Usage ...

    Android代码-android-swipelistview

    An Android List View implementation with support for drawable cells and many other swipe related features. Introduction Download Maven Dependency APKLib and others Dependencies Demo XML Usage ...

    concurrency-related-hello-worlds

    #Maven原型mvn原型:generate -DgroupId = com.mycompany -DartifactId =与并发相关的问候世界-DarchetypeGroupId = ...

    gradle 构建 Java 简单示例

    mavenCentral() } dependencies { compile 'org.junit.jupiter:junit-jupiter-api:5.7.0' testCompile 'org.junit.jupiter:junit-jupiter-engine:5.7.0' } test { useJUnitPlatform() } ``` 这个文件做了以下...

    基于spring4.x的RESTful环境搭建

    例如,对于Maven项目,可以添加以下依赖: ```xml &lt;groupId&gt;org.springframework &lt;artifactId&gt;spring-webmvc ${spring.version} &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt; &lt;artifactId&gt;jackson-...

    docker-jenkins:Jenkins的Docker映像

    docker-jenkins docker pull dustise/jenkins A Customizable docker image for Jenkins. With this image , you can simply add your own init groovy ...Added some CI/CD related tools into the image. Following t

    Android代码-fingerlock

    Check the related post on Medium. Gradle Dependency Repository repositories { maven { url "https://jitpack.io" } } Dependencies Core The core module contains the core class FingerLock to perform ...

    Android代码-Kotlin-Realm-Extensions

    Forget all boilerplate related with Realm API and perform database operations in one line of code with this lightweight library. Full test coverage. Download for Kotlin 1.3 and Realm 5.9 Grab via ...

    java邮件发送

    如果你使用的是Maven项目,可以在pom.xml文件中添加以下依赖: ```xml &lt;groupId&gt;com.sun.mail&lt;/groupId&gt; &lt;artifactId&gt;javax.mail &lt;version&gt;1.6.2 ``` 接下来,我们需要配置邮件服务器的相关信息,如SMTP...

    集成mail实现邮件推送带网页样式的消息.zip

    首先,`pom.xml`文件是Maven项目的配置文件,它包含了项目依赖的管理。为了实现邮件功能,我们需要引入SpringBoot的`spring-boot-starter-mail`依赖。在`pom.xml`中添加以下依赖段: ```xml &lt;groupId&gt;org.spring...

    java实现了发送邮件功能

    MimeMultipart multipart = new MimeMultipart("related"); multipart.addBodyPart(messagePart); message.setContent(multipart); ``` 对于附件,你可以创建一个新的`MimeBodyPart`,设置数据源,并将其添加到`...

    用java代码发邮件,真是牛啊,可群发,也可发附件

    MimeMultipart multipart = new MimeMultipart("related"); multipart.addBodyPart(messagePart); multipart.addBodyPart(attachmentPart); message.setContent(multipart); ``` 4. **发送邮件**:最后,使用...

    利用JavaMail发送邮件示例

    MimeMultipart multipart = new MimeMultipart("related"); BodyPart messagePart = new MimeBodyPart(); messagePart.setContent("&lt;html&gt;&lt;body&gt;&lt;h1&gt;Hello!&lt;/h1&gt;&lt;img src=\"cid:image\"&gt;&lt;/body&gt;&lt;/html&gt;", "text/...

Global site tag (gtag.js) - Google Analytics