jleyba / js-dossier

A JavaScript documentation generation tool.
Apache License 2.0
150 stars 15 forks source link

conflict in Maven settings.xml with Closure Compiler #84

Closed myphysicslab closed 8 years ago

myphysicslab commented 8 years ago

The instructions for building Closure Compiler with Maven state that it is necessary to "Add sonatype snapshots repository to ~/.m2/settings.xml". After creating this file I get errors when building Dossier.

[13:34:49 ~/Documents/Programming/js-dossier]$ ./gendossier.sh 
INFO: Starting clean (this may take a while). Consider using --expunge_async if
the clean takes more than several minutes.
ERROR: /Users/erikn/Documents/Programming/js-dossier/lib/maven/BUILD:94:1: no
such package '@gson//jar': Errors interpreting settings file: [[WARNING]
Unrecognised tag: 'id' (position: START_TAG seen ...<profiles>\n    <id>...
@14:9)  @ /Users/erikn/.m2/settings.xml, line 14, column 9] and referenced by
'//lib/maven:gson'.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 0.151s
ERROR: Couldn't start the build. Unable to run tests.

I tried changing the settings.xml to be more like what is shown at https://maven.apache.org/settings.html but I only got more similar errors.

If I disable that settings.xml file by renaming it to "XXXsettings.xml" then Dossier builds no problem.  But that doesn't seem like a great long term solution.

Here is the latest version of my settings.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <pluginGroups>
  </pluginGroups>
  <proxies>
  </proxies>
  <servers>
  </servers>
  <mirrors>
  </mirrors>
  <profiles>
    <id>allow-snapshots</id>
    <activation><activeByDefault>true</activeByDefault></activation>
    <repositories>
       <repository>
         <id>snapshots-repo</id>
         <url>https://oss.sonatype.org/content/repositories/snapshots</url>
         <releases><enabled>false</enabled></releases>
         <snapshots><enabled>true</enabled></snapshots>
       </repository>
     </repositories>
  </profiles>
</settings>
jleyba commented 8 years ago

Your settings are malformed. Should have <profiles><profile>....

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <pluginGroups>
  </pluginGroups>
  <proxies>
  </proxies>
  <servers>
  </servers>
  <mirrors>
  </mirrors>
  <profiles>
    <profile>
      <id>allow-snapshots</id>
      <activation><activeByDefault>true</activeByDefault></activation>
      <repositories>
         <repository>
           <id>snapshots-repo</id>
           <url>https://oss.sonatype.org/content/repositories/snapshots</url>
           <releases><enabled>false</enabled></releases>
           <snapshots><enabled>true</enabled></snapshots>
         </repository>
     </repositories>
   </profile>
  </profiles>
</settings>
myphysicslab commented 8 years ago

Confirmed, works now. Thanks.