Maven 生命周期

1.毫米波雷达心率、呼吸原理实现(一)实例 毫米波雷达心率、呼吸检测原理本项目分两到三篇文章写完,第一阶段借鉴TI开源项目以及根据自己的见解适当更改信号处理链通过AWR1843汽车雷达传感器和DCA1000采集卡采集数据完成人体呼吸和心跳检测算法的实现。第二阶段将仿真成功的代码搬移TIAWR1843传感器并通过串口数据实现生命体征的实时处理。本文即为第一阶段实现过程。本文首先概述毫米波雷达呼吸心跳检测的原理,紧接着概述本项目信号处理流程,另外本项目第一阶段通过matlab仿真验证算法的有效性,仿真源码可关注小编并私信可取。1.概述。 阅读详情

生命周期(Lifecycle)

    maven将整个项目构建过程分为三个过程,每个过程都已经被定义成抽象模板,并通过插件的方式来确认具体的使用。

clean(清理阶段)

* pre-clean: 清理之前do something
* clean:执行清理过程
* post-clean:清理之后do something
我们通过maven-clean-plugins插件绑定clean阶段;

mvn clean

[INFO] ------------------------------------------------------------------------
[INFO] Building maven-hello 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ maven-hello ---
[INFO] Deleting /Users/wangzhiping/idea-workspace/maven-study/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.346s
[INFO] Finished at: Mon Aug 21 14:55:40 CST 2017
[INFO] Final Memory: 6M/155M
[INFO] ------------------------------------------------------------------------
# 删除target文件夹
  • 自定义maven-clean-plugin插件

继承AbstractMojo自定义

package main.java.study.wzp.maven.plugin.clean;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;

import java.io.File;

/**
 * Created by wangzhiping on 17/8/21.
 * @goal myclean
 */
public class CleanMojo extends AbstractMojo {

    /**
     * @parameter expression = "${project.build.directory}"
     * @readOnly
     * @required
     *
     * @throws MojoExecutionException
     * @throws MojoFailureException
     *
     */
    private File targetDirectory;

    /**
     * 删除非空文件夹
     */
    private void deleteDir(File file) {

        if (file.isFile()){
            file.delete();
        } else if (file.isDirectory()){
            File[] files = file.listFiles();
            if (files.length == 0){
                file.delete();
            }else {
                for (File f : files) {
                    deleteDir(f);
                }
            }
        }

        file.delete();
    }

    /**
     * 核心执行逻辑
     * @throws MojoExecutionException
     * @throws MojoFailureException
     */
    public void execute() throws MojoExecutionException, MojoFailureException {

        if (null != targetDirectory && targetDirectory.exists() && targetDirectory.isDirectory()) {
            deleteDir(targetDirectory);
            getLog().info("Delete: " + targetDirectory.getAbsolutePath());
            return;
        }

        getLog().warn("Delete failure: " + targetDirectory.getAbsolutePath() + " is't exist!");

    }
}

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>

    <groupId>study.wzp.maven</groupId>
    <artifactId>my-clean-plugin</artifactId>
    <version>1.0</version>


    <!-- maven插件打包模式 -->
    <packaging>maven-plugin</packaging>

    <dependencies>
        <!-- 插件开发的API -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.1.0</version>
        </dependency>
    </dependencies>
</project>

可以通过mvn install安装到本地。

其他项目引用

<build>
        <plugins>
            <plugin>
                <groupId>study.wzp.maven</groupId>
                <artifactId>my-clean-plugin</artifactId>
                <version>1.0</version>
            </plugin>
        </plugins>
</build>

执行

mvn study.wzp.maven:my-clean-plugin:1.0:myclean
 详情可以参考:maven-clean-plugin 插件源码;

default(项目构建阶段)

详细的阶段:https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
不过可以大致分为:
1、主项目资源处理;
2、主项目代码编译;
3、测试资源处理;
4、测试代码编译;
5、执行单元测试;
6、打包;
7、安装;
8、发布;
其实就是:
编译(maven-compiler-plugin) --> 测试(maven-surefire-plugin) --> 
打包(maven-jar-plugin)      --> 安装(maven-install-plugin)  --> 
发布(maven-deploy-plugin) 

site(项目站点阶段)

这个阶段的目的是为了建立和发布项目站点,主要包括:各种文档(例如:javadoc);
主要包含:
1、pre-site
2、site 生成项目站点文档
3、post-site
4、site-deploy 将生成的项目站点发布到服务器上

plugin goal(插件目标)

简单理解就是插件的功能点,一个插件通常可以理解为一个功能的聚合。每一个功能就是一个goal,这样我们可以单独的出执行goal,从而提高功能的可复用性。
例如:mvn dependency:tree; mvn dependency:list; mvn dependency:analyze ,其中tree,list,analyze 都是goal,描述和承载的功能是独立的。

插件绑定

maven定义了所有的生命周期,就像定义了模板一样,具体的实现都是交给插件来完成的.
  • 内置绑定(默认绑定)
在使用maven时,我们并没有去显示的操作生命周期阶段步骤与插件进行绑定的动作,原因是maven已默认做了一些基本使用的插件绑定。其配置在:maven-core/src/main/resources/META-INF/plexus/default-binding.xml / components.xml 

default-binding.xml(定义了各种packaging对应的插件信息)

<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<!--

Mappings to default lifecycle, specific for each packaging.

-->

<component-set>
  <components>
    <!--
     | POM
     |-->
    <component>
      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
      <role-hint>pom</role-hint>
      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
      <configuration>
        <lifecycles>
          <lifecycle>
            <id>default</id>
            <!-- START SNIPPET: pom-lifecycle -->
            <phases>
              <install>
                org.apache.maven.plugins:maven-install-plugin:2.4:install
              </install>
              <deploy>
                org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
              </deploy>
            </phases>
            <!-- END SNIPPET: pom-lifecycle -->
          </lifecycle>
        </lifecycles>
      </configuration>
    </component>

    <!--
     | JAR
     |-->
    <component>
      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
      <role-hint>jar</role-hint>
      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
      <configuration>
        <lifecycles>
          <lifecycle>
            <id>default</id>
            <!-- START SNIPPET: jar-lifecycle -->
            <phases>
              <process-resources>
                org.apache.maven.plugins:maven-resources-plugin:2.6:resources
              </process-resources>
              <compile>
                org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
              </compile>
              <process-test-resources>
                org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
              </process-test-resources>
              <test-compile>
                org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
              </test-compile>
              <test>
                org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
              </test>
              <package>
                org.apache.maven.plugins:maven-jar-plugin:2.4:jar
              </package>
              <install>
                org.apache.maven.plugins:maven-install-plugin:2.4:install
              </install>
              <deploy>
                org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
              </deploy>
            </phases>
            <!-- END SNIPPET: jar-lifecycle -->
          </lifecycle>
        </lifecycles>
      </configuration>
    </component>

    <!--
     | EJB
     |-->
    <component>
      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
      <role-hint>ejb</role-hint>
      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
      <configuration>
        <lifecycles>
          <lifecycle>
            <id>default</id>
            <!-- START SNIPPET: ejb-lifecycle -->
            <phases>
              <process-resources>
                org.apache.maven.plugins:maven-resources-plugin:2.6:resources
              </process-resources>
              <compile>
                org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
              </compile>
              <process-test-resources>
                org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
              </process-test-resources>
              <test-compile>
                org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
              </test-compile>
              <test>
                org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
              </test>
              <package>
                org.apache.maven.plugins:maven-ejb-plugin:2.3:ejb
              </package>
              <install>
                org.apache.maven.plugins:maven-install-plugin:2.4:install
              </install>
              <deploy>
                org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
              </deploy>
            </phases>
            <!-- END SNIPPET: ejb-lifecycle -->
          </lifecycle>
        </lifecycles>
      </configuration>
    </component>

    <!--
     | MAVEN PLUGIN
     |-->
    <component>
      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
      <role-hint>maven-plugin</role-hint>
      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
      <configuration>
        <lifecycles>
          <lifecycle>
            <id>default</id>
            <!-- START SNIPPET: maven-plugin-lifecycle -->
            <phases>
              <process-resources>
                org.apache.maven.plugins:maven-resources-plugin:2.6:resources
              </process-resources>
              <compile>
                org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
              </compile>
              <process-classes>
                org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor
              </process-classes>
              <process-test-resources>
                org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
              </process-test-resources>
              <test-compile>
                org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
              </test-compile>
              <test>
                org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
              </test>
              <package>
                org.apache.maven.plugins:maven-jar-plugin:2.4:jar,
                org.apache.maven.plugins:maven-plugin-plugin:3.2:addPluginArtifactMetadata
              </package>
              <install>
                org.apache.maven.plugins:maven-install-plugin:2.4:install
              </install>
              <deploy>
                org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
              </deploy>
            </phases>
            <!-- END SNIPPET: maven-plugin-lifecycle -->
          </lifecycle>
        </lifecycles>
      </configuration>
    </component>

    <!--
     | WAR
     |-->
    <component>
      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
      <role-hint>war</role-hint>
      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
      <configuration>
        <lifecycles>
          <lifecycle>
            <id>default</id>
            <!-- START SNIPPET: war-lifecycle -->
            <phases>
              <process-resources>
                org.apache.maven.plugins:maven-resources-plugin:2.6:resources
              </process-resources>
              <compile>
                org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
              </compile>
              <process-test-resources>
                org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
              </process-test-resources>
              <test-compile>
                org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
              </test-compile>
              <test>
                org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
              </test>
              <package>
                org.apache.maven.plugins:maven-war-plugin:2.2:war
              </package>
              <install>
                org.apache.maven.plugins:maven-install-plugin:2.4:install
              </install>
              <deploy>
                org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
              </deploy>
            </phases>
            <!-- END SNIPPET: war-lifecycle -->
          </lifecycle>
        </lifecycles>
      </configuration>
    </component>

    <!--
     | EAR
     |-->
    <component>
      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
      <role-hint>ear</role-hint>
      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
      <configuration>
        <lifecycles>
          <lifecycle>
            <id>default</id>
            <!-- START SNIPPET: ear-lifecycle -->
            <phases>
              <generate-resources>
                org.apache.maven.plugins:maven-ear-plugin:2.8:generate-application-xml
              </generate-resources>
              <process-resources>
                org.apache.maven.plugins:maven-resources-plugin:2.6:resources
              </process-resources>
              <package>
                org.apache.maven.plugins:maven-ear-plugin:2.8:ear
              </package>
              <install>
                org.apache.maven.plugins:maven-install-plugin:2.4:install
              </install>
              <deploy>
                org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
              </deploy>
            </phases>
            <!-- END SNIPPET: ear-lifecycle -->
          </lifecycle>
        </lifecycles>
      </configuration>
    </component>

    <!--
     | RAR
     |-->
    <component>
      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
      <role-hint>rar</role-hint>
      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
      <configuration>
        <lifecycles>
          <lifecycle>
            <id>default</id>
            <!-- START SNIPPET: rar-lifecycle -->
            <phases>
              <process-resources>
                org.apache.maven.plugins:maven-resources-plugin:2.6:resources
              </process-resources>
              <compile>
                org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
              </compile>
              <process-test-resources>
                org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
              </process-test-resources>
              <test-compile>
                org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
              </test-compile>
              <test>
                org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
              </test>
              <package>
                org.apache.maven.plugins:maven-rar-plugin:2.2:rar
              </package>
              <install>
                org.apache.maven.plugins:maven-install-plugin:2.4:install
              </install>
              <deploy>
                org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
              </deploy>
            </phases>
            <!-- END SNIPPET: rar-lifecycle -->
          </lifecycle>
        </lifecycles>
      </configuration>
    </component>

  </components>
</component-set>

components.xml(clean,default,site生命周期插件绑定和步骤定义)

<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<!--
  There is currently only one component descriptor that cannot be generated from annotations because of the
  accompanying configuration. Our options are to embed this information programatically or use a configuration source
  to pull in the lifecycle information.
-->
<component-set>
  <components>
    <!-- 'default' lifecycle, without any binding since it is dependent on packaging -->
    <component>
      <role>org.apache.maven.lifecycle.Lifecycle</role>
      <implementation>org.apache.maven.lifecycle.Lifecycle</implementation>
      <role-hint>default</role-hint>
      <configuration>
        <id>default</id>
        <!-- START SNIPPET: lifecycle -->
        <phases>
          <phase>validate</phase>
          <phase>initialize</phase>
          <phase>generate-sources</phase>
          <phase>process-sources</phase>
          <phase>generate-resources</phase>
          <phase>process-resources</phase>
          <phase>compile</phase>
          <phase>process-classes</phase>
          <phase>generate-test-sources</phase>
          <phase>process-test-sources</phase>
          <phase>generate-test-resources</phase>
          <phase>process-test-resources</phase>
          <phase>test-compile</phase>
          <phase>process-test-classes</phase>
          <phase>test</phase>
          <phase>prepare-package</phase>
          <phase>package</phase>
          <phase>pre-integration-test</phase>
          <phase>integration-test</phase>
          <phase>post-integration-test</phase>
          <phase>verify</phase>
          <phase>install</phase>
          <phase>deploy</phase>
        </phases>
        <!-- END SNIPPET: lifecycle -->
      </configuration>
    </component>

    <!-- 'clean' lifecycle, with default binding -->
    <component>
      <role>org.apache.maven.lifecycle.Lifecycle</role>
      <implementation>org.apache.maven.lifecycle.Lifecycle</implementation>
      <role-hint>clean</role-hint>
      <configuration>
        <id>clean</id>
        <!-- START SNIPPET: clean -->
        <phases>
          <phase>pre-clean</phase>
          <phase>clean</phase>
          <phase>post-clean</phase>
        </phases>
        <default-phases>
          <clean>
            org.apache.maven.plugins:maven-clean-plugin:2.5:clean
          </clean>
        </default-phases>
        <!-- END SNIPPET: clean -->
      </configuration>
    </component>

    <!-- 'site' lifecycle, with default bindings -->
    <component>
      <role>org.apache.maven.lifecycle.Lifecycle</role>
      <implementation>org.apache.maven.lifecycle.Lifecycle</implementation>
      <role-hint>site</role-hint>
      <configuration>
        <id>site</id>
        <!-- START SNIPPET: site -->
        <phases>
          <phase>pre-site</phase>
          <phase>site</phase>
          <phase>post-site</phase>
          <phase>site-deploy</phase>
        </phases>
        <default-phases>
          <site>
            org.apache.maven.plugins:maven-site-plugin:3.3:site
          </site>
          <site-deploy>
            org.apache.maven.plugins:maven-site-plugin:3.3:deploy
          </site-deploy>
        </default-phases>
        <!-- END SNIPPET: site -->
      </configuration>
    </component>

    <component>
      <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>
      <role-hint>maven</role-hint>
      <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>
      <description>Maven Security dispatcher</description>
      <requirements>
        <requirement>
          <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>
          <field-name>_cipher</field-name>
        </requirement>
        <requirement>
          <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>
          <field-name>_decryptors</field-name>
        </requirement>
      </requirements>
      <configuration>
        <_configuration-file>~/.m2/settings-security.xml</_configuration-file>
      </configuration>
    </component>
  </components>
</component-set>

这里写图片描述

maven源码

https://github.com/apache/maven.git 有兴趣可以看看源码就对了解maven还是比较好的方式
  • 自定义绑定
这个比较简单,就是配置build->plugins->plugin即可。
<build>
    <plugins>
        <plugin>
            <groupId>####</groupId>
            <artifactId>####</artifactId>
            <version>####</version>
        </plugin>
    </plugins>
</build>
详细插件配置可参考:https://maven.apache.org/guides/mini/guide-configuring-plugins.html 这里不作概述

参考

[1] https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
[2] http://www.codetab.org/apache-maven-tutorial/maven-lifecycle-and-goals/
[3] https://maven.apache.org/guides/mini/guide-configuring-plugins.html

基于STM32与毫米波雷达的非接触式睡眠监测系统 物联网和嵌入式系统技术正在推动医疗健康设备的智能化发展。通过传感器网络采集生理信号,结合信号处理算法实现健康监测已成为主流技术方案。毫米波雷达凭借其非接触检测特性,在呼吸、心率等生命体征监测中展现出独特优势。STM32系列MCU凭借丰富外设和低功耗特性,成为医疗级嵌入式设备的首选平台。本系统整合60GHz毫米波雷达、红外测温与无线传输模块,构建了完整的睡眠质量评估解决方案,其硬件架构设计、信号处理算法和低功耗优化策略对可穿戴医疗设备开发具有参考价值。 阅读详情

相关推荐

STM32驱动HC-SR04超声波模块:两种精准测距方案详解

本文详解STM32驱动HC-SR04超声波模块的两种精准测距方案:定时器中断计数法和外部中断边沿检测法。涵盖硬件连接、代码实现与优化技巧,帮助开发者根据精度和复杂度需求选择合适方案,提升超声波测距在嵌入式项目中的稳定性和准确性。

g5h6i的博客 691

MAVEN的下载和安装-Unsupported major.minor version 51.0

1、下载 http://maven.apache.org/download.cgi 2、注意jdk版本提示 3、将下载的文件解压到某个目录 比如D:\apache-maven-3.3.9 注意其中的 /conf/setting.xml 4、配置环境变量 先要配置好jdk 然后是MAVEN的配置:M2_HOME 实际地址 D:\software\ap...

༺ bestcxx的专栏 ༻ 1万+

道闸不自动落杆故障排查:从传感器原理到控制器调试全解析

在工业自动化和物联网系统中,传感器与控制器构成的闭环控制是保障设备可靠运行的核心。其基本原理是通过传感器采集环境状态,控制器依据预设逻辑做出决策并驱动执行器动作。这一技术价值在于实现了无人值守下的安全、高效自动化,广泛应用于智能交通、安防和智能楼宇等领域。以停车场道闸系统为例,其自动落杆功能高度依赖地感线圈与防砸雷达的协同。地感线圈作为触发单元,负责感知车辆接近;而防砸雷达则作为持续监测的安全单元,通过微波探测防砸区域内是否有障碍物,其信号是控制器执行落杆决策的关键依据。当系统出现车辆通过后闸杆不落的典型故

weixin_29190651的博客 318

Maven安装与配置仓库路径

下载Maven 地址:https://maven.apache.org/download.cgi 配置环境变量 MAVEN_HOME=D:\Maven_Package\apache-maven-3.6.3 Path追加:;%MAVEN_HOME%\bin 测试:mvn -v 修改本地仓库位置 Maven会将下载的类库(jar包)放置到本地的一个目录下,该目录称作本地仓库,默认情况...

Zhang_Jian 3597

基于51单片机的智能灌溉系统

基于51单片机的智能灌溉系统

jiejiezuishuai的博客 2110

Xilinx平台Aurora IP介绍(汇总篇)

Aurora IP核使用超简单的,COME ON!

数字IC/FPGA杂货铺,找一找,或许有你想要的~ 2万+

创建maven项目卡住及错误解决办法

第一次通过命令行创建maven项目。结果,果不其然啊,还是出问题了,不过出问题比没有出问题强,知道哪里有问题并学会解决也是一种收获。 遇到的第一个问题,在从仓库下载东西的时候会卡住,我开始以为是网速问题,等了好一会儿发现还是没动静。突然想起来视频里说从默认的中央仓库中下载失败率会很高。于是乎采用了视频里提到的英国的一个仓库。果然速度上来了,但还是有点慢,而且遇到了第二个问题。 第二问...

baihu6628的博客 1489

ROSTCM6软件下载及语义网络分析详细操作教程(附网盘链接)

ROSTCM6是武汉大学沈阳教授研发编码的国内目前唯一的以辅助人文社会科学研究的大型免费社会计算平台。该软件可以实现微博分析、聊天分析、全网分析、网站分析、浏览分析、分词、词频统计、英文词频统计、流量分析、聚类分析等一系列文本分析。

m0_64336780的博客 4万+

[Sonar][WARNING] Error injecting: org.sonarsource.scanner.maven.SonarQubeMojo

sonar

unimme的专栏 3348

高通camx进程ExtensionModule::TeardownOverrideSession类型crash问题分析之一:【死锁导致】

摘要:本文分析了一个在相机老化测试中出现的pthread_cond_wait持锁超时导致的ExtensionModule::TeardownOverrideSession崩溃问题。通过crash堆栈和日志分析,发现close阶段存在近1分钟的无响应期。进一步分析trace文件发现存在多线程死锁:ChiFeature2Graph::GenerateSmartErrorCode和ChiFeature2RequestObject::SetCurRequestState两个线程分别持有不同锁并互相等待对方释放。最终

1115

深度学习-155-RAG技术之嵌入模型Embedding怎么选

Embedding技术在大型语言模型中发挥着至关重要的作用。它将文本转化为向量,使模型能够理解和处理复杂的语言信息。通过选择合适的Embedding方法和优化文本匹配策略,我们可以在搜索引擎、问答系统、推荐系统等领域实现高效且精准的文本匹配。

qq_20466211的博客 407

Maven —— 生命周期

每个生命周期的各个环节都是由各种插件完成!!! Maven有三个相互独立的生命周期(Maven的这三个生命周期不能看成一个整体)!!! mvn clean:清理编译的项目 mvn compile:编译项目 mvn test:测试项目(运行测试类) mvn package:负责将我们的项目打包 mvn install:将这个项目安装到仓库中 Clean生命周期(Clean Lifec...

Hern(宋兆恒) 1万+

RK3568-适配phy芯片ip101gri

复位时间查阅数据手册。

Paper_Love的博客 2651

Maven的生命周期详解

本篇文章重点针对这几个问题进行讲解:maven的生命周期都有哪些阶段?maven的生命周期和插件到低有什么关联?插件和插件的目标有什么关联?假如我们要用某个插件,怎么上官网查找?怎么手动调用插件?

怪咖@的博客 8864

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Maven生命周期

Maven生命周期 个人网站 https://blog.deschen.cn/ 文章目录Maven生命周期一、Maven生命周期的定义二、Maven三套独立的生命周期三、Maven的插件 一、Maven生命周期的定义 Maven的生命周期就是为了对所有的构建过程进行抽象和统一。包括项目的清理,初始化,编译,测试,打包,集成测试,验证,部署和生成站点等构建步骤。 二、Maven三套独立的生命周期 Maven提供了三套独立的生命周期:clean, default 和 site clean生命周期:清理项目

陈汉槟 7674

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

Maven的生命周期

Maven的生命周期是一系列预定义的构建阶段,用于自动化和标准化项目构建过程。它包含三个核心生命周期:默认生命周期(负责编译、测试、打包和部署)、清理生命周期(清除构建输出)和站点生命周期(生成项目文档)。每个生命周期由多个有序阶段组成,如默认生命周期包括validate、compile、test、package等阶段。Maven通过这些生命周期组合管理项目构建全流程,确保构建过程的一致性和可重复性,使开发者能专注于业务逻辑而非构建细节。

记录大学四年代码 1286

vb 6.0并口开发操作实例

vb6并口开发,简体中文,试例内有inpout32.dll动态链接库

Maven 的生命周期详解

Maven 是目前最流行的项目管理和构建工具之一,广泛应用于 Java 开发项目中。它通过一系列约定和配置,极大地简化了项目的构建、依赖管理和生命周期管理。其中,Maven 的生命周期是其核心概念之一,贯穿了项目从构建、测试、打包到部署的整个过程。理解和掌握 Maven 的生命周期,不仅能够提高构建效率,还能帮助开发者更好地控制项目的各个阶段。 本文将全面解析 Maven 的生命周期,详细介绍每个生命周期阶段及其执行规则。通过本文的学习,读者将能够深入理解 Maven 的生命周期机制,从而更好地应用于实际

栗筝i的博客 4181

maven构建生命周期

关于maven生命周期的详细分析

qq_41526047的博客 1958

Maven 生命周期详解

思考:我们常使用的maven命令,比如 mvn clean install,mvn clean package 这些命令到底最后是如何工作的? 在这里我们还是先一步步来,其实它们运行的是生命周期中对应的phase阶段。 Maven 拥有三套独立的生命周期,它们分别是clean、default 和 site。clean 生命周期的目的是清理项目;default 生命周期的目的是构建项目;site 生命周期的目的是建立项目站点。 生命周期相互独立 每个生命周期又包含了多个阶段。这些阶段在执行的时候是有.

wangxuelei036的博客 4459

Maven 构建生命周期

Maven 构建生命周期定义了一个项目构建跟发布的过程。为了完成 default 生命周期,这些阶段(包括其他未在上面罗列的生命周期阶段)将被按顺序地执行。

2009

maven的三大生命周期

一、Maven的生命周期 Maven的生命周期就是对所有的构建过程进行抽象和统一。包含了项目的清理、初始化、编译、测试、打包、集成测试、验证、部署和站点生成等几乎所有的构建步骤。 Maven的生命周期是抽象的,即生命周期不做任何实际的工作,实际任务由插件完成,类似于设计模式中的模板方法。 二、三套生命周期 Maven有三套相互独立的生命周期,分别是clean、default和site。每个生命周...

JavaBoy的博客 2343
上一篇: Maven 搭建私服(nexus)
下一篇: IDEA - 如何查看代码的字节指令
紫守笨
博客等级 码龄15年 55粉丝 26原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值