我想使用 Maven 的密码加密,例如它用于节点的 Mojo 属性。我尝试将加密密码粘贴到 mojo 的正确属性中,但它将其视为纯文本。我希望有一个我可以在 Mojo 属性的注释上设置的属性来解释它可以被加密,如果是这样,使用系统主密码来解密,但我在文档中没有看到任何内容那。
有没有人设法将 Maven 的密码加密用于服务器密码节点以外的任何内容?很想为我的 Mojo 做这项工作。
使用source:jar目标,如何配置它以使target/generated-sources文件夹从存档中排除?我已经尝试了许多不同的配置,并且无法使它们中的任何一个工作.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<excludes>
<exclude>target/generated-sources</exclude>
</excludes>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
我已经在exlude标签中尝试了各种各样的东西target/generated-sources/**/*.java,com/mycompany/**/*.java因为我变得非常确信它甚至没有看到它,只是尝试过*.java,似乎没有被排除在外.
这是Maven 3.0.5和源代码2.2.1.我是从Maven CLI运行的.以下是感兴趣的人的完整POM.
<?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>com.example</groupId>
<artifactId>foo-service</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.2.8</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<packageName>com.example</packageName>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<excludes>
<exclude>target/generated-sources</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
Run Code Online (Sandbox Code Playgroud) 我在用 PHP 做一些非常基本的会话安全类型的事情时遇到了困难:
我想要做的不仅是在切换上下文时重新生成会话 ID,而且在切换这些上下文时立即将某些内容(例如 FLASH)放入会话中。这三页应该有希望澄清我的期望:
<?php
/* page1.php */
session_start();
# Just putting something in the session which I expect to
# not show up later
$_SESSION['INFO1'] = 'INFO1';
?>
<html>
<a href="page2.php">Page 2</a>
<?php print_r($_SESSION) ?>
</html>
Run Code Online (Sandbox Code Playgroud)
因此,当显示此页面时,我希望看到INFO1显示。我也希望当我回到这里时不要看到INFO2出现。如果我还没有会话 ID,我希望得到一个(我有)。
<?php
# page2.php
session_destroy();
session_regenerate_id(TRUE);
$_SESSION['INFO2'] = 'From page 2';
session_write_close();
header('Location: page3.php');
exit;
?>
Run Code Online (Sandbox Code Playgroud)
这最类似于注销功能 - 我们通过传递TRUE到session_regenerate_id. 另外,我在(大概)新会话中放了一些东西——它可能像一个闪存——说“你已经成功注销了。
#page3.php
<html>
<body>
<?php session_start(); ?> …Run Code Online (Sandbox Code Playgroud)