Tag: xml

为什么phpunit得不到phpunit.xml中指定的正确的APP_ENV?

我正在使用Laravel,这是我的./phpunit.xml文件 <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="false" backupStaticAttributes="false" bootstrap="bootstrap/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false"> <testsuites> <testsuite name="FeatureTests"> <directory suffix="Test.php">./tests/Feature</directory> </testsuite> <testsuite name="UnitTests"> <directory suffix="Test.php">./tests/Unit</directory> </testsuite> </testsuites> <filter> <whitelist processUncoveredFilesFromWhitelist="true"> <directory suffix=".php">./app</directory> </whitelist> </filter> <php> <env name="APP_ENV" value="testing"/> <env name="CACHE_DRIVER" value="array"/> <env name="SESSION_DRIVER" value="array"/> <env name="QUEUE_DRIVER" value="sync"/> <env name="DB_CONNECTION" value="sqlite_testing" /> </php> </phpunit> 我用下面的命令发射我的一个testing套件: ./vendor/phpunit/phpunit/phpunit –testsuite […]

使用骆驼春季启动项目中的环境variables的configuration文件

我正在骆驼春季启动项目上,在camelcontext.xml我通过环境variables使用configuration文件。 代码如下 – <?xml version="1.0" encoding="UTF-8"?> . . . <bean id="bridgePropertyPlaceholder" class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer"> <property name="location" value="file:${cfgfilepath}config.cfg" /> <property name="parser" ref="jasypt" /> </bean> . . // remaining code 现在,当我在Windows机器上正常运行这个项目时,它正在成功运行。 但是,当我尝试创build一个docker集装箱 ,我无法得到这个cfg文件。 我试过这些东西 – 将path硬编码为C:/Users/camelproject/src/main/resources/config.cfg和C:\Users\camelproject\src\main\resources\config.cfg (我不确定文件的结构path) 在Dockerfile创build一个ENV为: ENV cfgfilepath C:/Users/camelproject/src/main/resources/config.cfg和ENV cfgfilepath C:\Users\camelproject\src\main\resources\config.cfg和ENV cfgfilepath C://Users//camelproject//src//main//resources//config.cfg ,然后使用上面代码中的variables。 在运行C:/Users/camelproject/src/main/resources/config.cfg docker run命令时,传递了C:/Users/camelproject/src/main/resources/config.cfg作为-e选项中的值。 即。 docker run -e cfgfilepath=C:/Users/camelproject/src/main/resources/config.cfg 在Dockerfile我做了 – COPY target/config.cfg /app/config/config.cfg […]

Docker – maven在运行时连接到特定的存储库

我有一个镜像,需要在运行时连接到一个仓库,但它接触到Docker容器不能读取位于主机的〜/ .m2 / settings.xml文件。 有什么办法让docker现在在mavenconfiguration文件的位置? 或者实际上将mavenconfiguration文件导入容器?

如何将dockerfile命令转换为maven xml条目?

我是通过maven docker插件dockerizing我的Java应用程序。 我发现了一个简单的docker-maven-plugin,它创build了一个简单的docker文件..我想知道如何将docker文件命令(如ADD,COPY,VOLUME等)转换成maven xml条目? 我的意思是我需要能够通过maven pom.xml自定义我的dockerfile 我找不到任何文件或教程… 感谢您的input。